[BioC] BAM files to Genomic Ranges object

jluis.lavin at unavarra.es jluis.lavin at unavarra.es
Tue Jan 22 16:14:59 CET 2013


Dear all,

I'm afraid I have another question derived from the topic of this post.
I've used Repitools to calculate Cpg density from my samples, it worked
correctly, but now when I try to write the density calculations to a file,
I'm unable...
Is it possible to do it?

Here's how I tried to do it:

cpdens <- cpgDensityCalc(gr_list, organism=Mmusculus, seq.len = 300)

write.table(cpdens, file = "Cpg_dens.txt", append = FALSE, quote = TRUE,
sep = "\t", eol = "\n", na = "NA", dec = ".",
row.names = TRUE, col.names = TRUE)

And this is the error message I get:

Error in data.frame(c(0L, 1L, 2L, 3L, 3L, 3L, 1L, 2L, 14L, 14L, 3L, 1L,  :
  arguments imply differing number of rows: 530842, 3401342

And I also tried:


> write.csv(cpdens, file = "Cpg_dens.csv", quote = TRUE, eol = "\n", na =
"NA", + row.names = TRUE)

And got again this error:

Error in data.frame(c(0L, 1L, 2L, 3L, 3L, 3L, 1L, 2L, 14L, 14L, 3L, 1L,  :
  arguments imply differing number of rows: 530842, 3401342

Can somebody explain to me how to write the Cpg density calculations data
to a file (tab separated file or csv if possible).

Thanks in advance

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

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