This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Running Purge_dups on Hifiasm assemblies.

HI, I have this nieve question which is causing some confusion.

Is it a good idea to run Purge_dups on PacBIo Hifi reads based assemblies generated with Hifiasm.

In hifiasm assmebly log file i see some tags like [M::purge_dups] and a quick Chat-Gpt search suggested that i don't need to run it externally again.

Although i tried running it and it drastically reduced the number of contigs. for example one sample

Raw Hifiasm assembly had

  • contigs 122
  • genome size 61130207 bp / 61.13021 Mbp

After running Purge-Dups

  • contigs 18
  • genome size 56781658 bp / 56.78166 Mbp

The size difference is not that much (only 4348549 [4.348549 Mbp]).

But i am just not sure if i need to run Purge_dups. As these are Fungal genomes and I have not seen this step in any fungal related Publication.

Your insights will be helpful.

Thanks

genome assemblies purge_dups

How many chromosomes do you expect for this organism? Is 18 is more or less in-line than 122?

typically 11 are core and some accessory ( in reference they are 4 but some strains can have more or less than 4) and during comperative analysis with reference (after purge_dups) the remaining do align exactly to the known core and accessory chromosomes. so i was kind of really happy that i got near to chromosomes level assemblies.

1 answer

In the hifiasm github, they specifically mention that Hifiasm does automatic purging of the duplicated haplotigs. What you might want to do instead, is make the built-in PurgeDups algorithm more aggressive by changing the -l parameter. I haven't tried it though, so I don't know what the result will be.

But in any case, you should evaluate your purged assembly using e.g. BUSCO, Merqury etc. If purging results in losing lots of BUSCOs for example, or results in a drastic reduction in k-mer completeness, then you shouldn't do it! Or that it shouldn't be so aggressive. Fyi, BUSCO can also tell you if your pre-purge assembly really needs purging; look at the "complete and duplicated" BUSCOs.

Hi Panos

I ran Hifiasm with mostly the default options

hifiasm -o $asmOUT/${sample}_hifiasm -t 48 --n-hap 1 --telo-m TTAGGG PB01.fastq

I see on Hifiasm github the details for -l option you mentioned and it says

Level of purge-dup. 0 to disable purge-dup, 1 to only purge contained haplotigs, 
2 to purge all types of haplotigs, 3 to purge all types of haplotigs in most aggressive way. 
In default, [3] for non-trio assembly, [0] for trio assembly.
For trio assembly, only level 0 and level 1 are allowed.

I guess it used default level 3 as default.

Looking at other results you mentioned.

For Raw assemblies (for one of the sample) i see

Before Purge_dups

    C:99.5%[S:98.9%,D:0.5%],F:0.2%,M:0.4%,n:1122,E:18.5%       
    1116    Complete BUSCOs (C) (of which 207 contain internal stop codons)        
    1110    Complete and single-copy BUSCOs (S)    
    6   Complete and duplicated BUSCOs (D)     
    2   Fragmented BUSCOs (F)              
    4   Missing BUSCOs (M)             
    1122    Total BUSCO groups searched        

Assembly Statistics:
    92  Number of scaffolds
    92  Number of contigs
    52595290    Total length
    0.000%  Percent gaps
    4 Mbp   Scaffold N50
    4 Mbp   Contigs N50

And other stats
merqury_kmer_completeness(%)    merqury_qv(phred)   CRAQ_R-AQI(%)   CRAQ_S-AQI(%)   coverage_normal(%)
99.9179                            61.0756            94.46184176    100               99.3025

After Purge_dups

    C:99.5%[S:98.9%,D:0.5%],F:0.2%,M:0.4%,n:1122,E:18.7%       
    1116    Complete BUSCOs (C) (of which 209 contain internal stop codons)        
    1110    Complete and single-copy BUSCOs (S)    
    6   Complete and duplicated BUSCOs (D)     
    2   Fragmented BUSCOs (F)              
    4   Missing BUSCOs (M)             
    1122    Total BUSCO groups searched        

Assembly Statistics:
    17  Number of scaffolds
    17  Number of contigs
    50071250    Total length
    0.000%  Percent gaps
    4 Mbp   Scaffold N50
    4 Mbp   Contigs N50

And other stats
merqury_kmer_completeness(%)    merqury_qv(phred)   CRAQ_R-AQI(%)   CRAQ_S-AQI(%)   coverage_normal(%)
99.8061                            63.3515          94.46184176  96.01210831             99.6212

To me even after purging they look same (really close)

You're right! They look identical before and after purging. And, as GenoMax mentioned, since the number of chromosomes is closer to 18, then I'd say that you should keep the purged assembly (which hasn't lost anything important in terms of BUSCOs and k-mer completeness).

It's just weird that the built-in Hifiasm purger left so many redundant contigs... Unless it wasn't run in the aggressive mode...

I made a special program that automatically finds the optimal value of "-s" of Hifiasm, which is the main parameter that regulates haplotype purging by Hifiasm (https://github.com/shelkmike/Mabs).

Log in to answer this question.