How can I use a vcf file in trackViewer? Issues with TabixFile - coercing S4 class to a vector
I am trying to use TrackViewer to generate a lollipop plot for mutations annotated in a vcf file format.
I am pretty bad at R and cannot get past the vcf itself!
I've not found how to get by this step.
Example vcf (no quality info available):
#CHROM POS ID REF ALT QUAL FILTER INFO 2 60553260 mbsb C A 2 60546217 shcd T G
What I have tried:
vcf.fl <- VariantAnnotation::readVcf(file = "test.vcf", genome = "hg38") tab <- TabixFileList(vcf.fl, index=paste(vcf.fl, "tbi", sep=".")) Error in as.vector(x, mode = "character") : no method for coercing this S4 class to a vector gr <- GRanges("2", IRanges(60457194, 60553654, names="BCL11A")) vcf <- readVcf(vcf.fl, "hg38", param=gr) Error in (function (classes, fdef, mtable) : #unable to find an inherited method for function 'readVcf' for signature '"CollapsedVCF", "GRanges"' sessionInfo() R version 4.0.3 (2020-10-10) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Mojave 10.14.6 attached base packages:  grid stats4 parallel stats graphics grDevices utils datasets methods  base other attached packages:  rtracklayer_1.48.0 Gviz_1.32.0 maftools_2.4.12  VariantAnnotation_1.34.0 Rsamtools_2.4.0 Biostrings_2.56.0  XVector_0.28.0 SummarizedExperiment_1.18.2 DelayedArray_0.14.1  matrixStats_0.58.0 Biobase_2.48.0 GenomicRanges_1.40.0  GenomeInfoDb_1.24.2 IRanges_2.22.2 S4Vectors_0.26.1  BiocGenerics_0.37.0
• 26 views