<p>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 (<a href="https://samtools.github.io/hts-specs/VCFv4.3.pdf" rel="nofollow noreferrer">vcf specification</a>).</p>
<p>The first lines are the header, but afterwards you can find your information in a tab delimited fashion:</p>
<pre><code>#CHROM POS ID REF ALT QUAL FILTER INFO
</code></pre>
<p>So the information on genomic positions is directly readable from the vcf file (first 2 columns)</p>

CC BY-SA 4.0
2022-10-13T08:57:33.987Z
2022-10-13T09:03:24.947Z
2022-10-13T09:03:24.947Z
user16294
<p>I have two strains, <strong>X</strong> and <strong>Y</strong>, and I would like to compare the variants found in both. I have my own parent strain, <strong>Z</strong>, that was sequenced and assembled to be used as the reference genome.</p>
<p>I first aligned <strong>X</strong> and <strong>Y</strong> to <strong>Z</strong> 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 <strong>X</strong> and <strong>Y</strong>.</p>
<p>I found the <code>bcftools isec</code> tool to be my best bet so I went ahead and ran this line of code:</p>
<p><code>./bcftools isec -p out/path/ X.vcf.gz Y.vcf.gz</code></p>
<p>Now I have three new VCF files:</p>
<ul>
<li><code>0000.vcf</code> (variants unique to X)</li>
<li><code>0001.vcf</code> (variants unique to Y)</li>
<li><code>0002.vcf</code> (variants in both X and Y)</li>
</ul>
<p>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 <code>bcftools stats</code> but it just lists out how many SNPs there are and not their position.</p>
<p><strong>TLDR:</strong> Can someone help me find a way to list out the locations of SNPs from a VCF file in human readable format?</p>

CC BY-SA 4.0
2022-10-13T09:03:07.137Z
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?
terdon
<vcf><snp><variant-calling><bcftools><variants>
Compare VCF files
# Compare VCF files

(Asked by: username_0 on 2022-10-12)

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?

**Tags:** vcf, snp, variant-calling, bcftools, variants
> **Comments:**
> **username_1**: 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?  

---

## 1 answers

### Answer by username_2 on 2022-10-13. Score: 1

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)


---

