Closed marcelm closed 4 years ago
Your genetic map file (--genmap
) is not in the format that WhatsHap needs. Does your file follow the format as described in the documentation?
We definitely need to improve the error message here.
Print proper error messages when genetic map file cannot be parsed
Closes #224
This has now been fixed in the development version. This is how it looks now:
$ whatshap phase --ped=tests/data/trio.ped --genmap=invalid.map --chromosome=1 -o /dev/null tests/data/trio.vcf trio.pacbio.bam
This is WhatsHap 0.19.dev154+g8359d1d.d20200221 running under Python 3.7.5
Using region-specific recombination rates from genetic map invalid.map.
ERROR: whatshap error: Error at line 2 of genetic map file 'invalid.map': Found 4 fields instead of 3
Your AssertionError
could also arise if there were any empty lines in the file (such as at the end). This is now also fixed: Empty lines are simply ignored.
Original comment by Weisheng Wu (Bitbucket: [Weisheng Wu](https://bitbucket.org/Weisheng Wu), ).
Indeed my genetic map is in wrong format. Sorry I didn’t notice it:
$ head plink.chr1.GRCh38.map
1 . 0 55550
1 . 0.080572 82571
1 . 0.092229 88169
1 . 0.439456 285245
1 . 1.478148 629218
1 . 1.478214 629241
1 . 1.480558 630053
1 . 1.488889 632942
Where can I download the correctly formatted hg38 genetic map? I’ve looked at shapeit and beagle. They either don’t have recombination rate or only have hg19.
Original comment by Tobias Marschall (Bitbucket: tobiasmarschall, GitHub: tobiasmarschall).
We don’t provide a ready-made genetic map right now. Sorry. I’m afraid you’d have to create this yourself. In my experience however the genetic map for read-based trio phasing is much less important than for statistical phasing. Therefore we rarely use this option ourselves and just run with a uniform recombination rate (i.e. just omit --genmap
). In a way, that can even have advantages because it’d detect recombination in an unbiased manner.
Original comment by Weisheng Wu (Bitbucket: [Weisheng Wu](https://bitbucket.org/Weisheng Wu), ).
Thanks. I’ll try it without a genetic map file.
Original report by Weisheng Wu (Bitbucket: [Weisheng Wu](https://bitbucket.org/Weisheng Wu), ).
I’ve tried to run whatshap on a vcf with pedigree and bams, but it failed with an “AssertionError“. Could someone take a look at my command line and the log and tell me where the problem is? Thanks.
My command line is:
“
DNA.phased.chr1.vcf
“ is a vcf that contains chr1 variants in 600 samples. I’m using “--use-ped-samples
“ so whatshap should only phase the samples in the pedigree file. “trio_FAM001.ped
“ is the pedigree file that contains 5 samples (one father, one mother and three children):Here is part of the log: