methphaser icon indicating copy to clipboard operation
methphaser copied to clipboard

The command of Methphaser N50

Open Humonex opened this issue 1 year ago • 4 comments

We noticed that your N50 is different from Whatshap N50, and the Methphaser N50 is more reasonable. Could you please provide a command to call the N50 calculation method in the code or provide a script to calculate N50? for example the code in the [post_processing_script.ipynb] get_methphase_n50(block_relationships_df_30x_high_acc), get_methphase_n50(block_relationships_df_60x_high_acc), get_methphase_n50(block_relationships_df_LSK60x_high_acc), get_methphase_n50(block_relationships_df_LSK30x_high_acc), get_methphase_n50(block_relationships_df_80x_high_acc) or the code in the file [meth_phaser_post_processing] def get_n50(final_block_dict): chrom_n50 = {} for chrom in final_block_dict.keys(): block_len_list = [] for i in final_block_dict[chrom]: block_len_list.append(i[1] - i[0]) sum_block_len = 0 for i in sorted(block_len_list, reverse=False): sum_block_len += i if sum_block_len > sum(block_len_list) / 2: chrom_n50.update({chrom: i}) break return chrom_n50 But it seems that this function has not been called.

Humonex avatar Aug 21 '24 12:08 Humonex

get_genome_n50

should be this one I guess. Forgot the details.

Fu-Yilei avatar Aug 21 '24 13:08 Fu-Yilei

Yes, I have seen the get_genome_n50 in the [post_processing_script.ipynb], do I need to fully run this .ipynb every time if want to get the Methphaser N50?

Humonex avatar Aug 22 '24 02:08 Humonex

Not really. I think it takes the middle csv files as input.

Fu-Yilei avatar Aug 22 '24 02:08 Fu-Yilei

Thank you, I know this, I think it would be more convenient for people to use the software and promote the popularity of Methphaser N50 if the get_genome_n50 could be added to [methphasing] or have a command to call the function.

Humonex avatar Aug 22 '24 03:08 Humonex