bcftools consensus files only has reference sequence in it

Open
#934 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale

Research direction

Start by inspecting species1.calls.vcf.gz produced by the samtools mpileup and bcftools call pipeline, then compare it with ref_geneA.fa and the bcftools consensus command. Done means the cause of the reference-only output is established and the expected consensus behavior is documented or reproducible.

Written by the indexing model from the issue text.

Description

enhancement

After running bwa index on my ref_geneA.fa file and running bwa mem on the ref and different species exome data, I then used samtools to sort and index the output files. I am now trying to get just the consensus sequence from the aln.sorted.bam files for each species, 1 at a time (so I can later align them all using MAFFT to create one MSA).

Here is my command that I am stuck on (the versions of samtools and bcftools are both 1.9).

samtools mpileup -uf ref_geneA.fa species1.aln.sorted.bam | bcftools call -mv -Oz -o species1.calls.vcf.gz
tabix species1.calls.vcf.gz
cat ref_geneA.fa | bcftools consensus species1.calls.vcf.gz > consensus.fa

When I open the consensus.fa it only has the sequence from ref_geneA.fa, and nothing else. Why is this happening?

Dominant language
C
Stars
891
Forks
277
Avg merge
2d 23h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from samtools/bcftools

All issues in samtools/bcftools

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.