[BioC] 'which' argument to readGappedAlignments

Juliet Hannah juliet.hannah at gmail.com
Thu Feb 16 17:04:27 CET 2012


All,

I am studying the document "CountAndMeasure-lab.pdf" by Martin Morgan
obtained from:

http://www.bioconductor.org/help/course-materials/2011/BioC2011/

In the code below, I am unable to get the following line working:

> aln1 <- readBamGappedAlignments(bam[[1]], which=which)
Error in readBamGappedAlignments(bam[[1]], which = which) :
  unused argument(s) (which = which)

Any suggestions? Also, I'm trying to learn how to use the
documentation better. I looked over the reference manual for
GenomicRanges, but I was unable to locate this. I would appreciate any
suggestions regarding that as well. Apologies if I have missed
something obvious.

Thanks for your help.

Juliet

Here are all the required lines:

library(Rsamtools)
library(leeBamViews)
library(org.Sc.sgd.db)
library(TxDb.Scerevisiae.UCSC.sacCer2.ensGene)

fls <- dir(system.file("bam", package="leeBamViews"),
           "bam$", full=TRUE)
names(fls) <- sub("_13e.bam$", "", basename(fls))
bam <- BamFileList(fls)

regex <- "([[:alpha:]]+)([[:digit:]])"
values(bam) <-
    DataFrame(Genotype=factor(sub(regex, "\\1", names(bam))),
              Lane=sub(regex, "\\2", names(bam)))
open(bam)

aln <- readBamGappedAlignments(bam[[1]])
aln <- keepSeqlevels(aln, "Scchr13")

seqlevels(bam[[1]])

start <- org.Sc.sgdCHRLOC[["YMR297W"]]
end <- org.Sc.sgdCHRLOCEND[["YMR297W"]]
which <- GRanges("Scchr13", IRanges(start, end))
aln1 <- readBamGappedAlignments(bam[[1]], which=which)

> sessionInfo()
R version 2.14.1 (2011-12-22)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=C                 LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
 [1] TxDb.Scerevisiae.UCSC.sacCer2.ensGene_2.5.3
 [2] GenomicFeatures_1.6.8
 [3] org.Sc.sgd.db_2.6.4
 [4] RSQLite_0.11.1
 [5] DBI_0.2-5
 [6] AnnotationDbi_1.16.15
 [7] leeBamViews_0.99.13
 [8] BSgenome_1.22.0
 [9] Biobase_2.14.0
[10] Rsamtools_1.6.3
[11] Biostrings_2.22.0
[12] GenomicRanges_1.6.7
[13] IRanges_1.12.5

loaded via a namespace (and not attached):
[1] biomaRt_2.10.0     bitops_1.0-4.1     RCurl_1.9-5        rtracklayer_1.14.4
[5] tools_2.14.1       XML_3.9-4          zlibbioc_1.0.0



More information about the Bioconductor mailing list