Modified from the R package "Patchwork" on http://patchwork.r-forge.r-project.org/. patchwork-lite can read VCF results from newer versions of Samtools and BcfTools (Tested on v1.3 on both) without the need for mpileup files to lower the disk-space requirements.
patchwork.plot()
input , i.e. vcf.gz or vcf.bgz files.Prepare the VCF file like this:
samtools mpileup -t 'SP,INFO/AD,INFO/ADF,INFO/ADR' -uvf hg19.fa -r chr2:100000-110000 test.bam | \
bcftools call --ploidy GRCh37 -mv | \
bcftools filter -g 5 -G 5 -e 'TYPE!="snp" || AD[0]<5 || DP4[1]<2 || DP4[2]<2' -O z -o ./test.vcf.gz
so that we have only SNV lines and DP4 field is in the file.
And then run plot function like this:
patchwork.plot(Tumor_bam, Tumor_vcf_gz, Normal_bam, Normal_vcf_gz, Alpha=alpha, SD=sd)
Wenlong JIA (wenlongkxm@gmail.com)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.