Finding Allele Frequency from Varscan VCFs

To pull the allele frequency for a given position use the following command:

awk '{if($1=="chr3" && $2=="178922324" && $5=="A") print $10}' /path/to/varscan/vcf | awk '{FS=":"}{print $7}'

The first awk command pulls all variants from position chr3:178922324 where the alternate allele is an A. This outputs the INFO field from the vcfs which match the conditions.

The INFO field looks like this:

$ awk '{if($1=="chr3" && $2=="178922324" && $5=="A") print $10}' /path/to/varscan/vcf

The second awk command takes the information field we just passed and splits it using a colon as a delimiter then prints the seventh field which is the allele frequency.

From our above example the output we expect to see is:

$ awk '{FS=":"}{print $7}