Question: Remove genes that each of a gene with multiple SNVs
0
gravatar for zengtony743
2.7 years ago by
zengtony74370
Canada
zengtony74370 wrote:

I generated a vcf file with snpEff annotation tool . In this file, there are many genes needed to be removed because a gene with multiple SNVs, these are all false positive SNVs that I need to remove. Is there tools can do this? I usually do manually by transferring vcf to a txt format file and then excel file using annovar package. Is there tools can do this by running a script by not by excel table ?

vcf • 861 views
ADD COMMENTlink modified 2.7 years ago by Alex Reynolds28k • written 2.7 years ago by zengtony74370

Please respond quickly and remove other(same) questions of your.

ADD REPLYlink written 2.7 years ago by venu6.1k

Thanks ! Just don't know what's going on with my cell phone today

ADD REPLYlink written 2.7 years ago by zengtony74370
1
gravatar for Alex Reynolds
2.7 years ago by
Alex Reynolds28k
Seattle, WA USA
Alex Reynolds28k wrote:

Say your threshold is one SNP per gene, and you have a file of SNPs called snps.vcf and a BED file containing gene annotations called genes.bed. You could use vcf2bed and bedmap:

$ vcf2bed < snps.vcf > snps.bed
$ bedmap --count --echo --delim '\t' genes.bed snps.bed \
    | awk '$1==1' \
    | cut -f2- \
    > genes_with_one_overlapping_snp.bed

Or as a one-liner:

$ vcf2bed < snps.vcf | bedmap --count --echo --delim '\t' genes.bed - | awk '$1==1' | cut -f2- > genes_with_one_overlapping_snp.bed
ADD COMMENTlink written 2.7 years ago by Alex Reynolds28k

Thanks Alex, this is the first time to use vcf2bed,

When i run

$ perl PATH/vcf2bed.pl —keep-header < my_file.vcf

It shows

Cannot open --keep-header at PATH/vcf2bed.pl line 12

my_file.vcf works fine, did I miss something?

ADD REPLYlink written 2.7 years ago by zengtony74370

I'm not sure what vcf2bed.pl is. You might take a look here and see if you have this installed? https://bedops.readthedocs.io/en/latest/content/reference/file-management/conversion/vcf2bed.html

ADD REPLYlink written 2.7 years ago by Alex Reynolds28k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1523 users visited in the last hour