Entering edit mode
5.0 years ago
Heinrich_M
•
0
I want to extract the mapped regions out of bam files. So I tried bcftools. I have the current version of bcftools (V.19). I tried the following steps
bcftools mpileup -Ou -f reference.fa alignments.bam | bcftools call -mv -Oz -o calls.vcf.gz
after that a note appeared
Note: none of --samples-file, --ploidy or --ploidy-file given, assuming all sites are diploid
but this file has the regions which I want, so I go on with:
bcftools index calls.vcf.gz
cat reference.fa | bcftools consensus calls.vcf.gz > consensus.fa
Here also the note appear, and the whole fasta regions are displayed in consensus.fa
Note: the --sample option not given, applying all records
But when doing this:
cat reference.fa | bcftools consensus -s calls.vcf.gz > consensus.fa
nothing works. I tried a lot of stuff and have no idea where the mistake is.
Hope you can help me.
The
-s
option ofbcftools consensus
is meant for specifying the sample name (i.e. if the input is a multi-sample VCF file, this tells bcftools which sample to pick). Can you see what the sample name is in the VCF file?Okay thanks, than
-s
is not necessary. The sample has the following header:Is there something wrong with the vcf file?