PlantandFoodResearch / MCHap

Polyploid micro-haplotype assembly using Markov chain Monte Carlo simulation.
MIT License
18 stars 3 forks source link

Final alt allele count includeds counts of null allleles #115

Closed timothymillar closed 3 years ago

timothymillar commented 3 years ago

In version 0.5.0 the count of the final allele in the INFO/AC field is wrong in the presence of null-alleles .. This is caused by this line here: https://github.com/pfrnz/MCHap/blob/master/mchap/application/baseclass.py#L303 Where the null alleles are encoded as -1 and that value is used as an index to the last field in the array resulting in the addition of null alleles to the count of the final allele. This only affects the INFO/AC field.

This bug should only affect the assemble sub-tool as the call sub-tool should always identify a complete genoyype. Testing for this at the application level requires a test assembly that produces null-alleles. The easiest way to do this with a small test is a test case where one or more samples have low/zero read depth and/or the --haplotype-posterior-theshold is high.

timothymillar commented 3 years ago

Fixed in #118