I am trying to run SomaticSignatures package but I can't get the input file (a VRange object) right.
In the examples given by their vignette is this:
>sca_vr = VRanges( seqnames = seqnames(sca_data), ranges = ranges(sca_data), ref = sca_data$Reference_Allele, alt = sca_data$Tumor_Seq_Allele2, sampleNames = sca_data$Patient_ID, seqinfo = seqinfo(sca_data), study = sca_data$study)
But when I try to use exactly the same code with my data, that I pulled from a vcf example, provided but the VariantAnnotation package, I am unable to obtain the same VRange object:
> test_range=VRanges( + seqnames = seqnames(vcfRange), + ranges = ranges(vcfRange), + ref = vcfRange$REF, + alt = vcfRange$ALT) Error in as.vector(x, mode = "character") : no method for coercing this S4 class to a vector
This is how I obtained the vcf example:
>library(VariantAnnotation) #load the package >fl <- system.file("extdata", "chr22.vcf.gz", package="VariantAnnotation") #folder >vcf <- readVcf(fl, "hg19") #input vcf >vcfRange=rowRanges(vcf)
Can anyone help me to figure this out? Thanks