derfinder and BAM indexes
2
@jessicahekman-6877
Last seen 9.2 years ago
United States
Hi all. I'm trying to get derfinder working. I have some pretty simple code right now:
library(derfinder)
library(Rsamtools)
b1 <- BamFile("tophat/tophat-juncs-10_130/accepted_hits.bam", index="tophat/tophat-juncs-10_130/accepted_hits.bam.bai")
fullCov <- fullCoverage(bl)
When I run this (R 3.1.1, updated Bioconductor yesterday), I get the error:
Error in loadCoverage(files = files, chr = chrs[idx], cutoff = NULL, bai = bai, : Not all BAM files have a BAM index. If the BAM index files are in a separate directory from the BAM files or are not named as 'bamFile.bam.bai' then consider using the 'bai' argument.
The BAI file does exist and I even specified it in the BamFile() call, so I'm not sure what's going on!
Thanks,
Jessica
derfinder
• 2.1k views
@lcolladotor
Last seen 4 weeks ago
United States
Hi Jessica,
`fullCoverage()` and `loadCoverage()` can take as input a character vector or a BamFileList object for the `files` argument, not a BamFile object. Your example however lead me to find a small bug when you input a BamFileList. In the meantime, use the functionality where you provide a character vector.
(Edit : BamFile and BigWigFile objects are now supported in `derfinder` versions 1.0.3 and 1.1.3 for release and devel respectively.)
That is, the equivalent of:
> library('derfinder')
> bam <- system.file('extdata', 'genomeData', 'ERR009101_accepted_hits.bam', package = 'derfinder')
> fullCov <- fullCoverage(bam, chrs = '21')
2014-10-16 16:22:24 fullCoverage: processing chromosome 21
2014-10-16 16:22:24 loadCoverage: finding chromosome lengths
2014-10-16 16:22:24 loadCoverage: loading BAM file /Library/Frameworks/R.framework/Versions/3.1/Resources/library/derfinder/extdata/genomeData/ERR009101_accepted_hits.bam
2014-10-16 16:22:24 loadCoverage: applying the cutoff to the merged data
2014-10-16 16:22:24 filterData: originally there were 48129895 rows, now there are 48129895 rows. Meaning that 0 percent was filtered.
> devtools::session_info()
Session info-----------------------------------------------------------------------------------------------------------------------------------
setting value
version R version 3.1.1 (2014-07-10)
system x86_64, darwin10.8.0
ui AQUA
language (EN)
collate en_US.UTF-8
tz America/New_York
Packages---------------------------------------------------------------------------------------------------------------------------------------
package * version date source
acepack 1.3.3.3 2013-05-03 CRAN (R 3.1.0)
AnnotationDbi 1.28.0 2014-10-14 Bioconductor
base64enc 0.1.2 2014-06-26 CRAN (R 3.1.0)
BatchJobs 1.4 2014-09-24 CRAN (R 3.1.1)
BBmisc 1.7 2014-06-21 CRAN (R 3.1.0)
Biobase 2.26.0 2014-10-14 Bioconductor
BiocGenerics 0.12.0 2014-10-14 Bioconductor
BiocParallel 1.0.0 2014-10-15 Bioconductor
biomaRt 2.22.0 2014-10-14 Bioconductor
Biostrings 2.34.0 2014-10-14 Bioconductor
bitops 1.0.6 2013-08-17 CRAN (R 3.1.0)
brew 1.0.6 2011-04-13 CRAN (R 3.1.0)
bumphunter 1.6.0 2014-10-14 Bioconductor
checkmate 1.4 2014-09-03 CRAN (R 3.1.1)
cluster 1.15.3 2014-09-04 CRAN (R 3.1.1)
codetools 0.2.9 2014-08-21 CRAN (R 3.1.1)
DBI 0.3.1 2014-09-24 CRAN (R 3.1.1)
derfinder * 1.1.2 2014-10-14 Bioconductor
derfinderHelper 1.0.1 2014-10-15 Bioconductor
devtools 1.6.1 2014-10-07 CRAN (R 3.1.1)
digest 0.6.4 2013-12-03 CRAN (R 3.1.0)
doRNG 1.6 2014-03-07 CRAN (R 3.1.1)
fail 1.2 2013-09-19 CRAN (R 3.1.0)
foreach 1.4.2 2014-04-11 CRAN (R 3.1.0)
foreign 0.8.61 2014-03-28 CRAN (R 3.1.0)
Formula 1.1.2 2014-07-13 CRAN (R 3.1.1)
GenomeInfoDb 1.2.0 2014-10-14 Bioconductor
GenomicAlignments 1.2.0 2014-10-14 Bioconductor
GenomicFeatures 1.18.0 2014-10-14 Bioconductor
GenomicFiles 1.2.0 2014-10-14 Bioconductor
GenomicRanges 1.18.1 2014-10-16 Bioconductor
Hmisc 3.14.5 2014-09-12 CRAN (R 3.1.1)
IRanges 2.0.0 2014-10-14 Bioconductor
iterators 1.0.7 2014-04-11 CRAN (R 3.1.0)
lattice 0.20.29 2014-04-04 CRAN (R 3.1.0)
latticeExtra 0.6.26 2013-08-15 CRAN (R 3.1.0)
locfit 1.5.9.1 2013-04-20 CRAN (R 3.1.0)
Matrix 1.1.4 2014-06-15 CRAN (R 3.1.0)
matrixStats 0.10.0 2014-06-08 CRAN (R 3.1.0)
nnet 7.3.8 2014-03-28 CRAN (R 3.1.0)
pkgmaker 0.22 2014-05-14 CRAN (R 3.1.0)
qvalue 1.40.0 2014-10-14 Bioconductor
R.methodsS3 1.6.1 2014-01-05 CRAN (R 3.1.0)
RColorBrewer 1.0.5 2011-06-17 CRAN (R 3.1.0)
RCurl 1.95.4.3 2014-07-29 CRAN (R 3.1.1)
registry 0.2 2012-01-24 CRAN (R 3.1.0)
rngtools 1.2.4 2014-03-06 CRAN (R 3.1.0)
rpart 4.1.8 2014-03-28 CRAN (R 3.1.0)
Rsamtools 1.18.0 2014-10-14 Bioconductor
RSQLite 0.11.4 2013-05-26 CRAN (R 3.1.0)
rstudioapi 0.1 2014-03-27 CRAN (R 3.1.0)
rtracklayer 1.26.0 2014-10-14 Bioconductor
S4Vectors 0.4.0 2014-10-14 Bioconductor
sendmailR 1.2.1 2014-09-21 CRAN (R 3.1.1)
stringr 0.6.2 2012-12-06 CRAN (R 3.1.0)
survival 2.37.7 2014-01-22 CRAN (R 3.1.0)
XML 3.98.1.1 2013-06-20 CRAN (R 3.1.0)
xtable 1.7.4 2014-09-12 CRAN (R 3.1.1)
XVector 0.6.0 2014-10-14 Bioconductor
zlibbioc 1.12.0 2014-10-14 Bioconductor
Cheers,
Leo
@jessicahekman-6877
Last seen 9.2 years ago
United States
Perfect -- I tried a character vector and it worked great. Thanks for your fast answer!
Jessica
Login before adding your answer.
Traffic: 800 users visited in the last hour
`derfinder` versions 1.0.3 and 1.1.3 for release and devel respectively address the issue reported here.