Question: Plot data from VCF using Gviz?
0
3.9 years ago by
Johannes Rainer1.5k
Italy
Johannes Rainer1.5k wrote:

Dear all,

I was just wondering, is there a way to visualize variants in a VCF file using Gviz? I had a quick look at the vignette and googled around but could not find anything.

Any help appreciated!

cheers, jo

variantannotation gviz vcf • 1.4k views
modified 3.9 years ago by Valerie Obenchain6.7k • written 3.9 years ago by Johannes Rainer1.5k

Have you looked at ggbio for that sort of thing?

No, I haven't, but I will, thanks!

Answer: Plot data from VCF using Gviz?
0
3.9 years ago by
United States
Valerie Obenchain6.7k wrote:

I don't know of a method on a VCF file but if you have a VCF class object you can just extract/manipulate the rowRanges():

DataTrack(rowRanges(myVCF))

Valerie

That works, yes. However, I didn't want to load the full VCF file. I fetched a VcfFile from AnnotationHub and was looking for a possibility to just load variants in the genomic region that is plotted from the file (on the fly). I've just added such a functionality for FaFiles to Gviz... if possible that would be nice for VcfFiles too.

2

Have you tried ScanVcfParam() to load select regions and/or fields? Make a GRanges of the region you want to plot and use it as the 'which':

param <- ScanVcfParam(which = GRanges("chr1", IRanges(5000, 7000)), info="DP")

readVcf(file, "genome", param=param)