Hello! I am new to both RSEM and tximport, so I am unsure which this is an issue with. All of my RNA seq samples are in separate SampleName.rsem.genes.results files in one directory. Based on the vignette, it almost seems like all the samples should be in one gene.results file? Either way, I attempted to pack the files and read them in via the below code:
library(tximport)
rsem.files=list.files(".","*.genes.results")
txi.rsem=tximport(rsem.files, type = "rsem")
And got the following error:
reading in files with read.delim (install 'readr' package for speed up)
1 Error: all(c(geneIdCol, abundanceCol, lengthCol) %in% names(raw)) is not TRUE
Thank you for any feedback!
Thanks for yours thoughts, I started just at the RSEM section and missed the making of the vector. It would be helpful to see the example inputs, so I tried running the vignette examples, but I cannot locate the 'extdata' anywhere within the package. When I run the command:
I get:
character(0)
Note this part of the sentence in the vignette when we talk about building the 'files' vector:
"First, we locate the directory containing the files. (Here we use system.file to locate the package directory, but for a typical use, we would just provide a path, e.g. "/path/to/dir".)"
Which I understand and have done, what I'm trying to understand now is what the sample.txt file should look like.
Ok, one thing I'm not sure about: right now, are you trying to work with your own RSEM files, or re-run the vignette code?
tximport() can import the 'genes.results' files for RSEM by setting type="rsem".
If you want RSEM quantifications on at the transcript level, you can set these columns below manually. We didn't implement an transcript-level preset for RSEM, just the gene-level import.
I was trying to run the vignette code just to make sure I formatted my own files correctly. I want to run my own genes.results files. I'm trying to determine if a sample.txt file is needed for that as it states here:
RSEM
sample.genes.results
files can be imported by setting type to"rsem"
.I thought the samples variable was made from a .txt file. As seen earlier in the vignette:
Do I need a sample.txt file made to run tximport on genes.results files? I tried just running the following:
With files being all my genes.results files.
I get the following error:
Maybe you can do a bit of debugging. tximport() is looking for these column names in each of the files.
Can you confirm that all the files in 'files' have these columns?
My files have no column names. From what I can tell my file formats seems to be gene_id some# some# and transcript_id. I reached out to the person who processed the files. Turns out they used rsem v1.1.13.... which has different columns. I'll see if I can import it manually.
Thanks!
I came across this question because I am similarly confused with using tximport (and very new to R in general). I am working on a class project and what I have are RSEM files which I would like to do further analysis with DESeq2. I'm having problems with reading in the files. The rsem txt files which I've downloaded (9 individual files) have the following columns:
gene_id, transcript_id, length, effective_length, expected_count, TPM, FPKM
When I tried to run this:
```{r }
files=file.path("~/Applied Bioinformatics/STATS 555/Project/GSE101642_RAW")
txi.rsem=tximport(files, type="rsem", txIn = FALSE, txOut = FALSE,
geneIdCol = "gene_id",
abundanceCol="FPKM",
countsCol="expected_count",
lengthCol = "effective_length")
head(txi.rsem$counts)
```
Error in computeRsemGeneLevel(files, importer, geneIdCol, abundanceCol, : all(c(geneIdCol, abundanceCol, lengthCol) %in% names(raw)) is not TRUE
I have also tried:
```{r}
txi=tximport(files,type = "rsem",txOut=TRUE, tx2gene = tx2gene, geneIdCol = "transcript_id(s)" )
```
Error in tximport(files, type = "rsem", txOut = TRUE, tx2gene = tx2gene, : all(c(lengthCol, abundanceCol) %in% names(raw)) is not TRUE
I've done various combinations of the above, where I used "gene_id" for the geneIdCol or not use the tx2gene. The authors used HG38 so I downloaded the TxDb for that version to make the table.
I am at a loss of what to do and would greatly appreciate any help. Thank you.
You need to create a vector which contains the path to all the files you want to import. So if you have 3 files you want to import the vector need to contain the path to all of them. Right now you just have a string pointing to the parent directory.
Thank you so much for your help! I was so frustrated on what to do but now I have all 9 files imported.
I am also getting the sam error. Is it possible to know how it got imported ?
Would you post a new issue with example code and maybe what the files look like?