[BioC] EasyRNASeq issue (missing bai files)
Nicolas Delhomme
delhomme at embl.de
Fri Jul 20 15:43:49 CEST 2012
Hi Jorge,
On Jul 20, 2012, at 2:16 PM, Jorge Beira wrote:
>
> Hi Nico,
>
> Thanks for your patient reply :)
>
> Update: I could get the proxy problem solved now, and install the latest easyRNASeq package
Good.
>
> So, sessionInfo() returns the following:
>
>> sessionInfo()
> R version 2.15.1 (2012-06-22)
> Platform: i386-apple-darwin9.8.0/i386 (32-bit)
>
> locale:
> [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
>
> attached base packages:
> [1] parallel stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] easyRNASeq_1.3.8 ShortRead_1.14.4 latticeExtra_0.6-19 RColorBrewer_1.0-5 lattice_0.20-6
> [6] Rsamtools_1.8.5 DESeq_1.8.3 locfit_1.5-8 BSgenome_1.24.0 GenomicRanges_1.8.7
> [11] Biostrings_2.24.1 IRanges_1.14.4 edgeR_2.6.9 limma_3.12.1 BiocInstaller_1.4.7
> [16] biomaRt_2.12.0 Biobase_2.16.0 genomeIntervals_1.12.0 BiocGenerics_0.2.0 intervals_0.13.3
>
> loaded via a namespace (and not attached):
> [1] annotate_1.34.1 AnnotationDbi_1.18.1 bitops_1.0-4.1 DBI_0.2-5 genefilter_1.38.0 geneplotter_1.34.0
> [7] grid_2.15.1 hwriter_1.3 RCurl_1.91-1 RSQLite_0.11.1 splines_2.15.1 stats4_2.15.1
> [13] survival_2.36-14 tools_2.15.1 XML_3.9-4 xtable_1.7-0 zlibbioc_1.2.0
>
>
I'm really surprised you could install version 1.3.8 actually. It requires edgeR >= 2.7.23 (yours is 2.6.9), and IRanges >= 1.15.18 (yours is 1.14.4). How did you do the installation?
Anyway, if you want to use the development version of the easyRNASeq package, you should use the development version of every package (knowing that they are then more unstable and might be broken for a couple of days from time to time). If you want to use the development version, you should do the following:
library(BiocInstaller)
useDevel(TRUE)
chooseBioCmirror() ## pick the closest one
update.packages(ask=FALSE)
If not, you're better off reverting to easyRNASeq version 1.2.3.
>
> -------
>
> getting back to the issues:
>
> indeed when I query file.exists(system.file("dmel-all-r5.45.gff")) is turns FALSE -- but now this is very strange, then, since I know the file is in the bams directory together with the bam files so why is it not reading it?.... In any case looks like the major problem is here before I can proceed. Any idea on this one?...
>
system.file is not appropriate here, look at the help about it for more details (it basically look up files in your R installation directories), i.e. in R type:
?system.file
Just using annotationFile="dmel-all-r5.45.gff" should do it.
> My current code is as follows:
>
> setwd("/Users/jbeira/Desktop/bams")
> library("easyRNASeq")
> library(BSgenome.Dmelanogaster.UCSC.dm3)
> count.table <- easyRNASeq(
> filesDirectory=getwd(),
> filenames=c("J05_orig_genome.sorted.bam"),
> format="bam",
> count="exons",
> organism="Dmelanogaster",
> chr.sizes=as.list(seqlengths(Dmelanogaster)),
> readLength=75L,
> annotationMethod="gff",
> annotationFile=system.file("dmel-all-r5.45.gff"))
>
>
> Just thinking of some info in case it explains some incompatibilities:
>
> I aligned my reads to the "dmel-all-chromosome-r5.45.fasta" version, however now I'm using the gff file "dmel-all-r5.45.gff" -- does this suggest any issue to you?
No, that should be fine, but we can double check. What does the following gives you (in a terminal, not in R)
grep ">" dmel-all-chromosome-r5.45.fasta
Cheers,
Nico
>
> Thanks once again,
>
> Jorge
>
>
>
> On Fri Jul 20 11:27:42 2012, 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
>> 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."
>>
>> 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...
>> I tried to use library(BSgenome.Dmelanogaster.UCSC.dm3) to try to
>> solve the chrsize issue but maybe that's what generated some
>> incompatibility?
>>
>> 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 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.
>>
>> Sorry if this is getting more complicated, thanks for your help!
>>
>> 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