Query Gvcf Against My Variants
1
0
Entering edit mode
10.5 years ago
win ▴ 980

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 • 3.3k views
ADD COMMENT
2
Entering edit mode
10.5 years ago

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
ADD COMMENT

Login before adding your answer.

Traffic: 1059 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