How can I use a vcf file in trackViewer? Issues with TabixFile - coercing S4 class to a vector
0
1
Entering edit mode
2.9 years ago

Hello, 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. Thanks

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:
 [1] grid      stats4    parallel  stats     graphics  grDevices utils     datasets  methods  
[10] base     

other attached packages:
 [1] rtracklayer_1.48.0          Gviz_1.32.0                 maftools_2.4.12            
 [4] VariantAnnotation_1.34.0    Rsamtools_2.4.0             Biostrings_2.56.0          
 [7] XVector_0.28.0              SummarizedExperiment_1.18.2 DelayedArray_0.14.1        
[10] matrixStats_0.58.0          Biobase_2.48.0              GenomicRanges_1.40.0       
[13] GenomeInfoDb_1.24.2         IRanges_2.22.2              S4Vectors_0.26.1           
[16] BiocGenerics_0.37.0   
vcf R VariantAnnotation trackViewer • 700 views
ADD COMMENT

Login before adding your answer.

Traffic: 1622 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6