Entering edit mode
Hi
I put locateVariants() in a test() function, save test() in "test.R"
file.
see bellow scripts,
In "test.R" file,
test <-function() {
vcf <-readVcf("var.raw.vcf","Arabidopsis")
rd <-rowData(vcf)
txdb <-loadDb("Arabidopsis.sqlite")
allvar <- locateVariants(rd,txdb, AllVariants())
}
Then I open R to run the following scripts,
source("test.R")
library(VariantAnnotation)
library(GenomicFeatures)
test()
I got an error "Error in isActiveSeq(x) :
error in evaluating the argument 'x' in selecting a method for
function
'isActiveSeq': Error: object 'txdb' not found"
However, when I run the following scripts directly (don't put in a
function) ,the locateVariants() works.
vcf <-readVcf("var.raw.vcf","Arabidopsis")
rd <-rowData(vcf)
txdb <-loadDb("Arabidopsis.sqlite")
allvar <- locateVariants(rd,txdb, AllVariants())
How can I load txdb object correctly so I can call locateVariants() in
function?
Thanks,
Rebecca
[[alternative HTML version deleted]]