This is a test version of Biostars. For the public version, visit https://www.biostars.org.
WHATSHAP : ValueError: Expecting as many genotypes as there are samples (SOLUTION?)

Hello everyone, can someone please help me to debug this error from whatshap ?!

Context: I wanted to phase a VCF using Whatshap with a file.bam (that i got after alignement to REF with vg toolkit) I tried with both options : - ignore RG or -setting RG with picard

ERROR I GET:

DEBUG: Read groups in CRAM/BAM header: [] DEBUG: Found 1 sample(s) in the VCF file. Working on 1 samples from 1 family ValueError: Expecting as many genotypes as there are samples

WHATSHAP version: This is WhatsHap 0.18 running under Python 3.6.9

Commands used :

# Set sample name in VCF to match reads RG **(VCF has only one sample)**
bcftools reheader -s samples.txt T001-call.vcf -o T001-call.vcf
bgzip -c T001-call.vcf > T001-call.vcf.gz
tabix -p vcf T001-call.vcf.gz

#GET BAM from VG
vg surject -x REF.vg T001.gam -b > T001.bam

samtools sort T001.bam -o T001.sorted.bam
samtools index T001.sorted.bam

# SET RG WITH PICARD
picard  AddOrReplaceReadGroups I=T001.sorted.bam O=T001.picard.bam RGID=1 RGLB=lib451783 RGPL=illumina RGPU=unit1 RGSM=T001

#PHASE 
# 1st try with argument  --ignore-read-groups
whatshap phase -r REF.fasta T001-calls.vcf T001.sorted.bam --ignore-read-groups -o T001.phased.ignor.vcf 

# 2nd try with ajusted BAM FILE
whatshap phase -r REF.fasta T001-calls.vcf T001.picard.bam -o T001.phased.picard.vcf
vg whatshap vcf bam

0 answers

No answers yet.

Log in to answer this question.