[BioC] EasyRNASeq issue (missing bai files)
Nicolas Delhomme
delhomme at embl.de
Fri Jul 20 13:06:35 CEST 2012
Hi Jorge,
On Jul 20, 2012, at 12:27 PM, Jorge Beira wrote:
>
> Hi Nico,
>
> Thanks for your help - I hadn't replied back yet as I wanted to try to index them bam file first and see if other problems arised (as they did...!).
>
> I changed the arguments with the suggestions you made for the conditions and output, however the chrsize didn't really work, now I've got this error " Error in .readGffGtf(filename = filename, ignoreWarnings = ignoreWarnings, :
> The filename you provided: does not exists
Well, the error is clear enough :-) This: system.file("dmel-all-r5.45.gff") does not seem to be a valid file path. What does this returns:
file.exists(system.file("dmel-all-r5.45.gff"))
> In addition: Warning message:
> In easyRNASeq(filesDirectory = getwd(), filenames = c("J05_orig_genome.sorted.bam"), :
> You enforce UCSC chromosome conventions, however the provided chromosome size list is not compliant. Correcting it."
This warning is expected if your chromosome size list does not contain UCSC compliant names (i.e. for the fruit-fly chr2L, chr2R, etc.), however this should be dealt with smoothly; i.e. you can ignore this warning in your case. I should really avoid reporting those warnings then, I'll add that to my TODO list.
>
> I guess I also am not doing something properly with the gff file, given the error, but since it didn't spit out any error about this before I don't know why this happens now...
Well, it stopped before getting to that point so of course you would not see it. So there's progress :-)
> I tried to use library(BSgenome.Dmelanogaster.UCSC.dm3) to try to solve the chrsize issue but maybe that's what generated some incompatibility?
That should not, no. As I said above, I need a better handling of the warnings.
>
> Let me paste here my current code to see if you spot a problem:
>
> setwd("/Users/jbeira/Desktop/bams")
> library("easyRNASeq")
> count.table <- easyRNASeq(
> filesDirectory=getwd(),
> filenames=c("J05_orig_genome.sorted.bam"),
> organism="Dmelanogaster",
> readLength=75L,
> chr.sizes=as.list(seqlengths(Dmelanogaster)),
> annotationMethod="gff",
> annotationFile=system.file("dmel-all-r5.45.gff"),
> format="bam",
> conditions=c("J05_orig_genome.sorted.bam"="wt"),
> count="exons",
> outputFormat="RNAseq")
>
You do not need the "conditions" if you are not asking for a "DESeq" or "edgeR" outputFormat. If you want just a count table (an exons x samples matrix), then you do not need to precise the outputFormat at all.
Did you look at the package vignette and help pages that defines the arguments and their usage?
?easyRNASeq
vignette("easyRNASeq")
If you did, let me know what was unclear, so that I can rectify them.
>
> --- You told me I didn't need the chrsize with the developer's version, but because of a proxy permission here at the institute I am not able to install the latest version of the package now, so if there's any way around this by defining the variable, that would be a good help.
Importing this new feature from the development version into the release one would introduce too many changes to the release version, so I can't do that.
You can always create your own named list instead of using as.list(seqlengths(Dmelanogaster)).
>
> Sorry if this is getting more complicated, thanks for your help!
>
No worries. One thing that could be helpful is that you post the results of the "sessionInfo()" command when posting on this list. This way, I would know directly if we are talking about the release or development version of the package. You'd get faster and more accurate answers then :-)
Cheers,
Nico
> Best
> Jorge
>
> On Wed Jul 18 16:49:24 2012, Nicolas Delhomme wrote:
>> Dear Jorge,
>>
>> I've Cc'ed the Bioc mailing list as it can be of help to others.
>>
>> You're missing the index (.bam.bai) files for your bam files; i.e. you need to run 'samtools index TTGR1.bam' on the command line in your /Users/jbeira/Desktop/bams directory to create the TTGR1.bam.bai file.
>>
>> You may as well want to use the indexBam function of the Rsamtools package. This package is required by easyRNASeq, so the following would index all your bam files in your bams directory:
>>
>> library(easyRNASeq)
>>
>> setwd("/Users/jbeira/Desktop/bams")
>>
>> indexBam(files=dir(".",pattern="*\\.bam$"))
>>
>> Note that it is important for your bam files to be sorted first (check the samtools webpage for more info: http://samtools.sourceforge.net/)
>>
>> In your easyRNASeq call, you're missing the "conditions" argument that describes your samples (e.g. tumor, control). This is necessary if you want to produce a DESeq output. The conditions should be a named vector, the names being the actual filenames: e.g. in your case conditions=c("TTGR1.bam"="tumor"). Asking for a DESeq output with a single sample is not going to work, but I suppose you've got more than one sample :-); you can provide all of them at once in the filenames argument or use the pattern argument instead (as in the indexBam for example).
>>
>> Finally, if you are using easyRNASeq version 1.3.8 (the development version), you do not need to precise the chr.sizes argument, provided your bam files have an header (which they most probably have). The readLength would as well be determined from your data, but it does not harm providing it. Moreover, if the computer you're running on as enough memory and CPUs, you can process the input file in parallel using the nbCore argument (as of easyRNASeq version 1.3.8). The memory usage is roughly the size of the BAM files, i.e. if you have 12GB RAM, you could proceed 4 x 3GB bam files in parallel (in an ideal world, in practice I would go for 3 just in case)
>>
>> Cheers,
>>
>> Nico
>>
>> ---------------------------------------------------------------
>> Nicolas Delhomme
>>
>> Genome Biology Computational Support
>>
>> European Molecular Biology Laboratory
>>
>> Tel: +49 6221 387 8310
>> Email: nicolas.delhomme at embl.de
>> Meyerhofstrasse 1 - Postfach 10.2209
>> 69102 Heidelberg, Germany
>> ---------------------------------------------------------------
>>
>>
>>
>>
>>
>> On Jul 18, 2012, at 5:24 PM, Jorge Beira wrote:
>>
>>> Dear Nicolas,
>>>
>>> I am trying to use the easyRNASeq package to obtain read counts so that I can proceed with my analysis for DESeq. However I must be doing something wrong in giving it the right arguments, since it gives me errors like
>>> " Error in easyRNASeq(filesDirectory = getwd(), filenames = c("TTGR1.bam"), :
>>> Index files (bai) are required. They are missing for the files: /Users/jbeira/Desktop/bams/TTGR1.bam "
>>>
>>> Info: I have my bam files in a folder "bams" in my Desktop, and I also added the Drosophila .gff file on the same directory. So the whole code I'm trying to run is:
>>>
>>>
>>> setwd("~/Desktop/bams")
>>> library("easyRNASeq")
>>> count.table <- easyRNASeq(
>>> filesDirectory=getwd(),
>>> filenames=c("TTGR1.bam"),
>>> organism="Dmelanogaster",
>>> chr.sizes=as.list(seqlengths(Dmelanogaster)),
>>> readLength=75L,
>>> annotationMethod="gff",
>>> annotationFile=system.file("dmel-all-r5.45.gff"),
>>> format="bam",
>>> count="exons",
>>> outputFormat="DESeq")
>>>
>>>
>>> If you could help me spotting where the problem is, it'd be great. Thanks a lot!
>>>
>>> Best wishes
>>>
>>> Jorge Beira
>>> National Institute for Medical Research
>>> and University College London, UK
>>
>>
>
>
More information about the Bioconductor
mailing list