Hi,
i am trying to count bam files on a specific bed file with the following script. Unfortunately, the same snippet, which worked good a only last week, is not running any more.
I keep getting error messages like the one mentioned above, but interestingly only when I call the object, not when I am running the command. When I run this snippet:
chromLength <- seqinfo(Scerevisiae) # create the Granges obejct with 500 bases width windows bins1 <- tileGenome(seqinfo(Scerevisiae), tilewidth=500, cut.last.tile.in.chrom=TRUE) seqlevelsStyle(bins1) seqlevelsStyle(bins1) <- "NCBI" # read the bam files into R Rad51 <- readGAlignments("1.Ensembl.sorted.bam") In <- readGAlignments("2.Ensembl.sorted.bam") seqlevelsStyle(In)
it doesn't show any error/warnings
but when I try to call the objects:
> chromLength Seqinfo object with 17 sequences (1 circular) from sacCer3 genome: Error in nchar(rownames.label) : could not find symbol "keepNA" in environment of the generic function > Rad51 GAlignments object with 2057068 alignments and 0 metadata columns: Error in nchar(x, type = "width") : could not find symbol "keepNA" in environment of the generic function > In GAlignments object with 2099495 alignments and 0 metadata columns: Error in nchar(x, type = "width") : could not find symbol "keepNA" in environment of the generic function
What is happening here?
another problem occurs when I try to run summarizeOverlaps and count the reads on specific regions in a bed file
bamFiles <- list.files(path = "~/Projects/Claudio_ChIPSeq/", pattern = ".bam$", full.names = TRUE) > bins1 GRanges object with 24322 ranges and 0 metadata columns: seqnames ranges strand <Rle> <IRanges> <Rle> [1] I [ 1, 500] * [2] I [ 501, 1000] * [3] I [1001, 1500] * [4] I [1501, 2000] * [5] I [2001, 2500] * ... ... ... ... [24318] MT [83501, 84000] * [24319] MT [84001, 84500] * [24320] MT [84501, 85000] * [24321] MT [85001, 85500] * [24322] MT [85501, 85779] * ------- seqinfo: 17 sequences (1 circular) from sacCer3 genome > bamFiles [1] "/Users/ayeroslaviz/Projects/Claudio_ChIPSeq/In.Ensembl.sorted.bam" [2] "/Users/ayeroslaviz/Projects/Claudio_ChIPSeq/Rad51.Ensembl.sorted.bam"
but than:
> olapTable <- summarizeOverlaps(bins1, bamFiles, inter.feature=FALSE) Error in SummarizedExperiment(assays = SimpleList(counts = counts), rowRanges = features, : error in evaluating the argument 'assays' in selecting a method for function 'SummarizedExperiment': Error in validObject(.Object) : invalid class “SimpleList” object: invalid object for slot "listData" in class "SimpleList": got class "matrix", should be or extend class "list"
thanks
Assa
> sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.3 (Yosemite)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats4 parallel stats graphics grDevices utils datasets methods base
other attached packages:
[1] csaw_1.2.1 BSgenome.Scerevisiae.UCSC.sacCer3_1.4.0
[3] BSgenome_1.36.1 rtracklayer_1.28.5
[5] GenomicAlignments_1.4.1 Rsamtools_1.20.4
[7] Biostrings_2.36.1 XVector_0.8.0
[9] GenomicRanges_1.20.5 GenomeInfoDb_1.4.1
[11] IRanges_2.2.5 S4Vectors_0.6.1
[13] BiocGenerics_0.14.0
loaded via a namespace (and not attached):
[1] AnnotationDbi_1.30.1 edgeR_3.10.2 zlibbioc_1.14.0 BiocParallel_1.2.6
[5] tools_3.2.0 Biobase_2.28.0 DBI_0.3.1 lambda.r_1.1.7
[9] futile.logger_1.4.1 futile.options_1.0.0 bitops_1.0-6 biomaRt_2.24.0
[13] RCurl_1.95-4.7 RSQLite_1.0.0 limma_3.24.12 GenomicFeatures_1.20.1
[17] XML_3.98-1.3
> RStudio.Version()
$citation
To cite RStudio in publications use:
RStudio Team (2015). RStudio: Integrated Development for R. RStudio, Inc., Boston, MA URL
http://www.rstudio.com/.
A BibTeX entry for LaTeX users is
@Manual{,
title = {RStudio: Integrated Development Environment for R},
author = {{RStudio Team}},
organization = {RStudio, Inc.},
address = {Boston, MA},
year = {2015},
url = {http://www.rstudio.com/},
}
$mode
[1] "desktop"
$version
[1] ‘0.99.447’
I have checked it on a different version of R and Rstudio and it works perfectly.
the working version:
> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats4 parallel stats graphics grDevices utils datasets methods base
other attached packages:
[1] BiocParallel_1.0.3 BSgenome.Scerevisiae.UCSC.sacCer3_1.4.0 BSgenome_1.34.1
[4] rtracklayer_1.26.3 BiocInstaller_1.16.5 edgeR_3.8.6
[7] limma_3.22.7 GenomicAlignments_1.2.2 Rsamtools_1.18.3
[10] Biostrings_2.34.1 XVector_0.6.0 GenomicRanges_1.18.4
[13] GenomeInfoDb_1.2.5 IRanges_2.0.1 S4Vectors_0.4.0
[16] BiocGenerics_0.12.1
loaded via a namespace (and not attached):
[1] base64enc_0.1-2 BatchJobs_1.6 BBmisc_1.9 bitops_1.0-6 brew_1.0-6 checkmate_1.5.2 codetools_0.2-11
[8] DBI_0.3.1 digest_0.6.8 fail_1.2 foreach_1.4.2 iterators_1.0.7 RCurl_1.95-4.5 RSQLite_1.0.0
[15] sendmailR_1.2-1 stringr_0.6.2 tools_3.1.1 XML_3.98-1.1 zlibbioc_1.12.0
on RStudio Version 0.98.1091