bcftools icon indicating copy to clipboard operation
bcftools copied to clipboard

bcftools consensus error: No such sample

Open WeiCSong opened this issue 2 years ago • 1 comments

Hi, I'm running consensus with the following code: bcftools consensus -f int.fa -H 1 -s H1 haplotype.vcf.gz > id1.fa The input haplotype.vcf is like

##fileformat=VCFv4.2 #CHROM POS ID REF ALT QUAL FILTER INFO H1 H2 H3 .... H999 chr21 44674498 rs587635126 C T . . . 0 0 0...0 chr21 44674535 rs117434156 G A . . . 0 0 0...0

and I got the error

No such sample: H1

Do you have any idea about this issue? Thanks in advance for your help.

WeiCSong avatar Jul 20 '22 04:07 WeiCSong

Most likely the VCF is not well formatted, with the latest version an informative error message should be printed. Which version of bcftools are you using? Try if the sample selection works in other commands work, for example bcftools view -s H1 file.vcf

pd3 avatar Jul 20 '22 12:07 pd3