likui345 / PGA

Other
13 stars 2 forks source link

graph2chr.py error in compose_ctg #2

Open yanwei-bio opened 2 years ago

yanwei-bio commented 2 years ago

Hello Likui,

I'm using the graph2chr.py to generate the final assembly of Hifi reads. All the required files were generated, including the ec.fa, overlap, sg_edges_list and chr_paths. However, there comes the error as below:

Traceback (most recent call last): File "graph2chr.py", line 457, in main(sys.argv) File "graph2chr.py", line 453, in main run(**vars(args)) File "graph2chr.py", line 420, in run p_edge_lines, p_ctg_seq_chunks, p_total_score, p_total_length = compose_ctg(seqs, edge_data, ctg_id, one_path_edges, True) File "graph2chr.py", line 320, in compose_ctg rid, s, t, aln_score, idt, e_seq = edge_data[(vv, ww)] KeyError: ('m64257e_211206_205428/126289547/ccs:E', 'm64257e_211206_205428/134810423/ccs:E')

I'd checked the reported reads in KeyError. Nothing special was found. Could you please help me to solve the final step in assembly?

likui345 commented 2 years ago

Hello yanwei, There is no overlap between these two reads. This problem is caused by Purge-dups. You can rerun hifiasm with the parameter -l 0.

yanwei-bio commented 2 years ago

Hi Likui, Thank you for your suggestion. I'd added the parameter -l 0 and rerun hifiasm and following graph2chr.py. However, there still reported the similar error but different reads.

File "graph2chr.py", line 457, in main(sys.argv) File "graph2chr.py", line 453, in main run(**vars(args)) File "graph2chr.py", line 420, in run p_edge_lines, p_ctg_seq_chunks, p_total_score, p_total_length = compose_ctg(seqs, edge_data, ctg_id, one_path_edges, True) File "graph2chr.py", line 320, in compose_ctg rid, s, t, aln_score, idt, e_seq = edge_data[(vv, ww)] KeyError: ('m64257e_211206_205428/64684781/ccs:B', 'm64257e_211206_205428/28445004/ccs:B')

Is there any code should be modified in this program?

likui345 commented 2 years ago

Hi yanwei: You can check the file asm.ovlp.paf to see if there is any overlap between m64257e_211206_205428/64684781/ccs and m64257e_211206_205428/28445004/ccs. In the last step,you need to use the unfiltered overlap file(asm.ovlp.paf).

------------------ 原始邮件 ------------------ 发件人: "likui345/PGA" @.>; 发送时间: 2022年1月12日(星期三) 上午9:01 @.>; 抄送: "KUI @.**@.>; 主题: Re: [likui345/PGA] graph2chr.py error in compose_ctg (Issue #2)

Hi Likui, Thank you for your suggestion. I'd added the parameter -l 0 and rerun hifiasm and following graph2chr.py. However, there still reported the similar error but different reads.

File "graph2chr.py", line 457, in main(sys.argv) File "graph2chr.py", line 453, in main run(**vars(args)) File "graph2chr.py", line 420, in run p_edge_lines, p_ctg_seq_chunks, p_total_score, p_total_length = compose_ctg(seqs, edge_data, ctg_id, one_path_edges, True) File "graph2chr.py", line 320, in compose_ctg rid, s, t, aln_score, idt, e_seq = edge_data[(vv, ww)] KeyError: ('m64257e_211206_205428/64684781/ccs:B', 'm64257e_211206_205428/28445004/ccs:B')

Is there any code should be modified in this program?

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>

Johnsonzcode commented 1 year ago

@yanwei-bio, I met the same error. Maybe we can overlap HiFi reads by minimap2 and reformat the paf file. I am trying to do it.

shimiao123 commented 1 year ago

@likui345 @yanwei-bio @Johnsonzcode ,I met the same error. My error information: Traceback (most recent call last): File "graph2chr.py", line 457, in main(sys.argv) File "graph2chr.py", line 453, in main run(**vars(args)) File "graph2chr.py", line 420, in run p_edge_lines, p_ctg_seq_chunks, p_total_score, p_total_length = compose_ctg(seqs, edge_data, ctg_id, one_path_edges, True) File "graph2chr.py", line 320, in compose_ctg rid, s, t, aln_score, idt, e_seq = edge_data[(vv, ww)] KeyError: ('m64438e_221116_021511/81789594/ccs:B', 'm64438e_221116_021511/102827493/ccs:E')

Everyone has solved this problem?
Johnsonzcode commented 1 year ago

You need to rerun HiFiasm with -l 0.