2
$\begingroup$

I have two strains, X and Y, and I would like to compare the variants found in both. I have my own parent strain, Z, that was sequenced and assembled to be used as the reference genome.

I first aligned X and Y to Z using minimap2 and then I used FreeBayes as the variant caller. Once I had the two separate VCF files I looked online to see what was the best way to filter out the unique and common variants in X and Y.

I found the bcftools isec tool to be my best bet so I went ahead and ran this line of code:

./bcftools isec -p out/path/ X.vcf.gz Y.vcf.gz

Now I have three new VCF files:

  • 0000.vcf (variants unique to X)
  • 0001.vcf (variants unique to Y)
  • 0002.vcf (variants in both X and Y)

However, it's still in VCF format. I need a way to parse through the VCF file to list out the SNPs with high quality with their position on the genome. I tried using bcftools stats but it just lists out how many SNPs there are and not their position.

TLDR: Can someone help me find a way to list out the locations of SNPs from a VCF file in human readable format?

$\endgroup$
1
  • $\begingroup$ Can you explain what you need a bit more clearly? Try showing us a few lines of the VCF file and what you would like to convert them to, for example. Since the VCF already gives locations of variants in a human readable format, your question is a bit unclear. Do you want SNPs only, without any larger variants? Do you just want the first, second, fourth and fifth fields of the VCF? Do you want to convert it to hgvs notation? Something else? $\endgroup$
    – terdon
    Oct 13, 2022 at 9:03

1 Answer 1

1
$\begingroup$

If I understood you correctly you are searching for a way to represent the genomic locations in your vcf file. However, the vcf file is already a human readable file (vcf specification).

The first lines are the header, but afterwards you can find your information in a tab delimited fashion:

#CHROM POS ID REF ALT QUAL FILTER INFO

So the information on genomic positions is directly readable from the vcf file (first 2 columns)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.