Entering edit mode
Veerendra GP
▴
100
@veerendra-gp-4214
Last seen 10.2 years ago
Hello Everyone!
Greetings!
I am using "GenomicFeatures" library to create Transcript db objects
for
the mouse genome.
I did it by using biomart, *makeTranscriptDbFromBiomart()* and also
UCSC, makeTranscriptDbFromUCSC()
functions.
As I am interested in the strand information, I tried fetching the it
using
*as.integer(),* *runValue**()* & *strand()* functions. I am able to
get it
from the transcriptdb object, created using
*makeTranscriptDbFromBiomart()* but
ending up with an error when I am trying to do the same with
transcriptdb object created using makeTranscriptDbFromUCSC()
function*.*
working code:
mouseGNM <- makeTranscriptDbFromBiomart (biomart = "ensembl", dataset=
"mmusculus_gene_ensembl");
saveDb(mouseGNM, file="MouseGNM.sqlite");
library("GenomicFeatures");
MouseGNM<- loadDb("MouseGNM.sqlite");
GenegroupedTranscripts<- transcriptsBy(MouseGNM, by = "gene");
strand.info <-as.integer(runValue(strand(GenegroupedTranscripts)));
> runValue(strand(GenegroupedTranscripts)) CompressedIntegerList of
length
37315 [["ENSMUSG00000000001"]] 2 [["ENSMUSG00000000003"]] 2
[["ENSMUSG00000000028"]] 2 [["ENSMUSG00000000031"]] 2
[["ENSMUSG00000000037"]] 1 [["ENSMUSG00000000049"]] 1
[["ENSMUSG00000000056"]] 1 [["ENSMUSG00000000058"]] 1
[["ENSMUSG00000000078"]] 1 [["ENSMUSG00000000085"]] 1 ... <37305 more
elements>
> strand.info[1:100]
[1] 2 2 2 2 1 1 1 1 1 1 1 1 1 2 2 1 1 1 2 1 1 1 2 1 2 1 1 2 2 1 1 2 1
2 2
1 2 [38] 2 1 1 1 1 1 1 2 1 1 2 2 1 1 1 2 2 1 1 1 2 1 2 1 2 2 1 1 1 1 1
2 1
2 2 2 2 [75] 2 2 2 2 2 2 2 1 2 1 1 2 2 2 1 1 1 2 1 2 2 2 1 1 2 1
here 2 is the antisense strand and 1 the sense strand
UCSC.mouseGNM <- makeTranscriptDbFromUCSC(genome = "mm9", tablename =
"knownGene");
saveDb(UCSC.mouseGNM, file="UCSCMouseGNM.sqlite");
UCSCMouseGNM<- loadDb("UCSCMouseGNM.sqlite");
UCSCGenegroupedTranscripts<- transcriptsBy(UCSCMouseGNM, by = "gene");
strand.info2<-
as.integer(runValue(strand(UCSCGenegroupedTranscripts)));
> runValue(strand(UCSCGenegroupedTranscripts))
CompressedIntegerList of length 21761
[["100009600"]] 2
[["100009609"]] 2
[["100009614"]] 1
[["100012"]] 2
[["100017"]] 2
[["100019"]] 1
[["100033459"]] 1
[["100034251"]] 1
[["100034361"]] 2
[["100034684"]] 2
...
<21751 more elements>
*ERROR:*
> strand.info2<-
as.integer(runValue(strand(UCSCGenegroupedTranscripts)));
Error in as.vector(x, mode = "integer") : coercing an AtomicList
object to
an atomic vector is supported only for objects with top-level elements
of
length <= 1
I am not able to understand this error message, could anyone let me
know
what is going wrong in the code.
Here is the session information.
> sessionInfo() R version 2.15.2 (2012-10-26) Platform: x86_64-pc-
linux-gnu
(64-bit) locale: [1] LC_CTYPE=en_AU.UTF-8 LC_NUMERIC=C [3]
LC_TIME=en_US.UTF-8 LC_COLLATE=en_AU.UTF-8 [5] LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_AU.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] GenomicFeatures_1.10.1
AnnotationDbi_1.20.3
Biobase_2.18.0 [4] GenomicRanges_1.10.5 IRanges_1.16.4
BiocGenerics_0.4.0
loaded via a namespace (and not attached): [1] biomaRt_2.14.0
Biostrings_2.26.2 bitops_1.0-5 BSgenome_1.26.1 [5] DBI_0.2-5
parallel_2.15.2 RCurl_1.95-3 Rsamtools_1.10.2 [9] RSQLite_0.11.2
rtracklayer_1.18.2 stats4_2.15.2 tools_2.15.2 [13] XML_3.95-0.1
zlibbioc_1.4.0
Thank you in advance.
Regards,
Veerendra.
--
GP.Veerendra
PhD Student (Bioinformatics)
Stazione Zoologica Anton Dohrn
Naples, Italy
M:+393663915221
[[alternative HTML version deleted]]