chhylp123 / hifiasm

Hifiasm: a haplotype-resolved assembler for accurate Hifi reads
MIT License
505 stars 84 forks source link

How --n-hap works? #433

Closed shelkmike closed 1 year ago

shelkmike commented 1 year ago

Could you please explain in detail, how the option --n-hap affects the work of Hifiasm?

chhylp123 commented 1 year ago

--n-hap is only useful for polyploidy samples. It is used to infer how many haplotypes a HiFi read/unitig corresponding to. If you don't care about the polyploidy assembly, just ignore it.

shelkmike commented 1 year ago

I know. However, I would like to know the details. Could you please explain in more detail, which steps of Hifiasm are affected by this parameter and how. The article about Hifiasm doesn't describe this.

chhylp123 commented 1 year ago

Given the homozygous coverage threshold H and --n-hap n, hifiasm will think the heterozygous coverage as H/n. Usually hifiasm will discard tips/bubbles with coverage smaller than H/n as artifacts, and assgin unitigs to corresponding haplotypes by using the coverage information. This option does not affect the error correction step of HiFi read, it only makes sense during the graph cleaning and the UL integration.

shelkmike commented 1 year ago

Thank you