knitr::opts_chunk$set(echo = TRUE)
Functions for plotting the genotypes from a vcf file.
You can install the released version of SorghumTestingData from Github with:
devtools::install_github("AnzaGhaffar/GT-Plotting") install.packages("GTPlotting") library(GTPlotting)
We will have access to three functions:
vcf_testdata<-VcfToTable('vcffilename')
This function takes as input a vcf file with extension vcf or vcf.gz and creates an object which consists of 2 data frames
vcf_testdata$vcfdata
The vcfdata is the data frame which has the important features extracted from the vcf file for the genotype plotting
vcf_testdata$chromlen
This data frame has the chromosome names and the size of each chromosome.
GTPlotting_Chromosome(vcf_testdata$vcfdata,vcf_testdata$chromlen,'Grinkan_CTRL')
This function plots the genotype of each chromosome, it takes three inputs the vcf data frame generated by the VcfToTable function, the chromosome length table generated by the VcfToTable function and the name of the control sample should be same as in the vcf file.
GTPlotting_Chromosome_Combined(vcf_testdata$vcfdata,vcf_testdata$chromlen)
This function plots the genotype of all the chromosomes, it takes two inputs the vcf data frame generated by the VcfToTable function, the chromosome length table generated by the VcfToTable function.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.