This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Query Gvcf Against My Variants

hi all, i have an Illumina gVCF file and a list of variants, for each variant i might have a dbSNP ID but i most definitely have chromosome number and coordinate. I want to generate another VCF file with only my variants in that even if they are variant or non variant.

i wanted to know how this can be done via tabix or some other tool?

any help will be much appreciated.

ngs

1 answer

Hi,

You can get the gvcftools package here:

https://sites.google.com/site/gvcftools/home/download

This package contains the 'break_blocks' tool which will extract a set of sites overlapping with the regions in bed file -- this seems like it could cover your workflow.

As an example, if you format your chrom/position list into a bed file called 'my_regions.bed', then this command would uncompress and extract these regions:

gzip -dc sample.genome.vcf.gz  |  break_blocks --region-file my_regions.bed --ref hg19.fa --exclude-off-target  > output.vcf

If you also wanted to ensure that any variants not overlapped by your bed file regions are included in the output, add the 'include-variants' argument:

gzip -dc sample.genome.vcf.gz  |  break_blocks --region-file my_regions.bed --ref hg19.fa --exclude-off-target  --include-variants > output.vcf

The full break_blocks usage is:

break_blocks converts non-reference blocks to individual positions in specified regions

usage: break_blocks [options] < (g)VCF > unblocked_(g)VCF

options:

configuration:
  --region-file arg     A bed file specifying regions where call blocks should 
                        be broken into individual positions (required)
  --ref arg             samtools reference sequence (required)
  --exclude-off-target  Don't output off-target vcf records. 'targeted' records
                        include all those intersecting the input region plus 
                        any optionally included types specified below (default:
                        output all records)
  --include-variants    Add all variant calls to the targeted record set (only 
                        applies when exclude-off-target is used)

help:
  -h [ --help ]         print this message

Log in to answer this question.