Question: Do you know how to filter a .vcf to only return positions with simple SNPs?
0
gravatar for Guy Reeves
3.3 years ago by
Guy Reeves1.0k
Germany
Guy Reeves1.0k wrote:

Hi

Does anybody know a filter expression for a tool on usegalaxy.org to use with this format  .vcf file (see below) so it only positions  with   biallelic SNPs?

As there is no variable listing the length of the variants or the number of alleles I am a little bit lost.

Thanks Guy

##fileformat=VCFv4.1
##INFO=<ID=AC,Number=1,Type=Integer,Description="Allele count">
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">

#CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO	FORMAT	DGRP-021
chr2L	2262	.	T	TTC	0	PASS	AC=20	GT	0/0
chr2L	5462	.	A	AA	0	PASS	AC=57	GT	0/0
chr2L	6631	.	A	G	0	PASS	AC=51	GT	0/0
chr2L	13474	.	TTTT	T,TTT	0	PASS	AC=44,30	GT	0/0
snp vcf fliter expression • 1.7k views
ADD COMMENTlink modified 3.3 years ago • written 3.3 years ago by Guy Reeves1.0k
1
gravatar for Guy Reeves
3.3 years ago by
Guy Reeves1.0k
Germany
Guy Reeves1.0k wrote:

In the end I took the file out of Galaxy and used awk to filter the length of the 'ALT' column and then the length of the 'REF' column  so they both equal 1.

awk '{if(length($5)==1) print $0;}' vcfin > ALT
awk '{if(length($4)==1) print $0;}' ALT > REFALT

Then I put the  vcf header back on, then reset the metadata. This appears to have worked. Though I would be very interested if there was a galaxy only way.  Guy

ADD COMMENTlink written 3.3 years ago by Guy Reeves1.0k
0
gravatar for Jennifer Hillman Jackson
3.3 years ago by
United States
Jennifer Hillman Jackson25k wrote:

Hey Guy,

I would try using the "Filter" tool, doing basically the same thing as the awk script. 

Hope that works! Jen, Galaxy team

ADD COMMENTlink written 3.3 years ago by Jennifer Hillman Jackson25k
0
gravatar for Guy Reeves
3.3 years ago by
Guy Reeves1.0k
Germany
Guy Reeves1.0k wrote:

HI Jen 

I did try with  SnpSift Filter and VCFfilter but I could not find an expression that worked.  Would you happen to know? Thanks Guy

 

ADD COMMENTlink written 3.3 years ago by Guy Reeves1.0k
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 16.09
Traffic: 172 users visited in the last hour