marbl / merqury

k-mer based assembly evaluation
Other
272 stars 19 forks source link

Does merqury output phased block NG50 ? #60

Open HaploKit opened 2 years ago

HaploKit commented 2 years ago

Hi, may I ask a question: merqury provides phased block N50, it seems it does not provide phased block NG50, is it right or I missed something? Thanks in advance.

arangrhie commented 2 years ago

Hello @HaploTookit ,

No, there is no direct way to get the NG50 from merqury. I use the *.phased_block.sizes to get the NG50 and associated continuity plots.

Rscript $MERQURY/plot/plot_block_N.R -b asm1.100_20000.phased_block.sizes -o asm1.phased_blocks -g 3100000000
Rscript $MERQURY/plot/plot_block_N.R -b asm2.100_20000.phased_block.sizes -o asm2.phased_blocks -g 3100000000

Each line of the phased_block.sizes contains 2nd column: haplotype of each block 3rd column: block size

They are sorted by size, should be easy to get the haplotype NG50 from there. I use faiCalcNGStats.jar to get the NG values; but should be trivial to calculate the NG50s in other ways.

cut -f2-3 asm1.100_20000.phased_block.sizes | java -jar -Xmx256m $tools/vgp-assembly/pipeline/stats/faiCalcNGStats.jar - 3100000000

I'll make a feature request for that in merqury. Would be handy to have it in.

HaploKit commented 2 years ago

Many thanks for your help.