Entering edit mode
Prashantha Hebbar
▴
260
@prashantha-hebbar-3526
Last seen 5.0 years ago
Hello friends,
I am trying to get genome cordinate information for list of genes
using sapply function. I find an error saying "
Error in c(values, x) : all arguments in '...' must be CompressedList
objects
"
Following is the code I am using.
library(VariantAnnotation)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
txdb = TxDb.Hsapiens.UCSC.hg19.knownGene
txg = transcriptsBy(txdb,by="gene")
allGeneRange <- GRanges()
genes<-c("47","4067","2017")
gRangeFun <- function(i){
geneRange <- reduce(txg[i])
allGeneRange<-append(allGeneRange, geneRange)
return(allGeneRange)
}
x<-sapply(genes, gRangeFun )
print(x)
I wanted to have coordination of all genes in one GRange object to
process it further. when I print x following error appears. Can
somebody tell me what is going wrong with sapply() usage?
Here is sessionInfo()
> sessionInfo() R version 2.15.2 (2012-10-26)
Platform: i686-pc-linux-gnu (32-bit) locale: [1] LC_CTYPE=en_US.UTF-8
LC_NUMERIC=C LC_TIME=C LC_COLLATE=C [5]
LC_MONETARY=C LC_MESSAGES=C LC_PAPER=C
LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C
LC_MEASUREMENT=C LC_IDENTIFICATION=C attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages: [1] VariantAnnotation_1.4.12
Rsamtools_1.10.2 [3] Biostrings_2.26.3
TxDb.Hsapiens.UCSC.hg19.knownGene_2.8.0 [5] GenomicFeatures_1.10.2
AnnotationDbi_1.20.7 [7] Biobase_2.18.0
GenomicRanges_1.10.7 [9] IRanges_1.16.6
BiocGenerics_0.4.0 loaded via a namespace (and
not attached): [1] BSgenome_1.26.1 DBI_0.2-7
RCurl_1.95-4.1 RSQLite_0.11.4 [5] XML_3.98-1.1
biomaRt_2.14.0 bitops_1.0-5 parallel_2.15.2 [9]
rtracklayer_1.18.2 stats4_2.15.2 tools_2.15.2
zlibbioc_1.4.0
Regards,
Prashantha
[[alternative HTML version deleted]]