[BioC] BAM files to Genomic Ranges object

jluis.lavin at unavarra.es jluis.lavin at unavarra.es
Mon Jan 14 11:20:48 CET 2013


First of all I want to thank Herve Pages and Martin Morgan for their kind
answers. And I want to apologize for this delay answering back, but I was
offline for a few days...

I used Herve code to read my BAM files into GRanges objects, but I don't
seem to be able to use that Granges object into the cpgDensityCalc
function.
This is how I try to do it:

-(My files are in the working directory already)

library(Mus.musculus)
library(Repitools)
library(GenomicRanges)
library(Rsamtools)

 bam_files <- list.files(pattern="*.bam")
   gr_list <- lapply(bam_files,
                     function(bam_file)
                       as(readGappedAlignments(bam_file), "GRanges"))
   names(gr_list) <- bam_files

require(BSgenome.Mmusculus.UCSC.mm9)

cpdens <- cpgDensityCalc(gr_list, organism=Mmusculus, window =600)

-And I get the following error:

Error in function (classes, fdef, mtable)  :
unable to find an inherited method for function "cpgDensityCalc", for
signature "character", "BSgenome"

What does this error mean? Can't "gr_list" be used as input for
cpgDensityCalc? Do my R installation lack any module required to perform
this analysis?

*I'm awfully sorry for my lack of intermediate-advance R scripting
knowledge, I'm trying to fix that...

Thanks in advance, once more

JL


sessionInfo()

R version 2.15.1 (2012-06-22)
Platform: x86_64-redhat-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] Mus.musculus_1.0.0
 [2] TxDb.Mmusculus.UCSC.mm10.ensGene_2.8.0
 [3] org.Mm.eg.db_2.8.0
 [4] GO.db_2.8.0
 [5] RSQLite_0.11.2
 [6] DBI_0.2-5
 [7] OrganismDbi_1.0.2
 [8] GenomicFeatures_1.10.1
 [9] AnnotationDbi_1.20.3
[10] Biobase_2.18.0
[11] Rsamtools_1.10.2
[12] BSgenome.Hsapiens.UCSC.hg18_1.3.19
[13] BiocInstaller_1.8.3
[14] Repitools_1.4.0
[15] BSgenome.Mmusculus.UCSC.mm9_1.3.19
[16] BSgenome_1.26.1
[17] Biostrings_2.26.2
[18] GenomicRanges_1.10.5
[19] IRanges_1.16.4
[20] BiocGenerics_0.4.0

loaded via a namespace (and not attached):
 [1] biomaRt_2.14.0     bitops_1.0-5       edgeR_3.0.8        graph_1.36.1
 [5] limma_3.14.3       parallel_2.15.1    RBGL_1.34.0        RCurl_1.95-3
 [9] rtracklayer_1.18.2 stats4_2.15.1      tools_2.15.1       XML_3.95-0.1
[13] zlibbioc_1.4.0

-- 
Dr. José Luis Lavín Trueba

Dpto. de Producción Agraria
Grupo de Genética y Microbiología
Universidad Pública de Navarra
31006 Pamplona
Navarra
SPAIN



More information about the Bioconductor mailing list