This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Exclude mono morphic variants from VCF file

Hello Everyone

I am trying to exclude all the mono-morphic variants from GWAS vcf file. I used GATK SelecttVaraint walker with -env option.

Not sure am i doing the right thing or there in another way to exclude them?

Regards Moeen

snp

Do you mean to say if alt column has a . ?

awk '{ if ( $0~/^#/ ) { print } else if ( $5!="." ) { print } }' in.vcf > out.vcf

Thanks ...

i want to exclude non-variant sites.. which could be '.' or same alternate allele .

1 answer

vcf-subset --exclude-ref in.vcf > out.vcf

Log in to answer this question.