cobra
cobra copied to clipboard
fix: fix handle of "6" shape path
will fix #43
background
in the issue, queries are extended as follow pattern:
and the environment is:
query_set = frozenset(( "AcMG_5518", "AcMG_12242", "AcMG_3793", "AcMG_755", "AcMG_9925", "AcMG_9528"))
contig2assembly = {
"AcMG_3793" : {"AcMG_925032", "AcMG_5518", "AcMG_12242", "AcMG_3793"},
"AcMG_755" : {"AcMG_925032", "AcMG_5518", "AcMG_12242", "AcMG_3793", "AcMG_755", "AcMG_9925"},
"AcMG_12242": {"AcMG_925032"} | query_set,
"AcMG_5518" : {"AcMG_925032"} | query_set,
"AcMG_9925" : {"AcMG_925032"} | query_set,
}
path_circular_potential=frozenset({"AcMG_755"})
contig_link_no_pe=frozenset({"AcMG_9528"})
bug analysis
in this case, a query (AcMG_9528
) exists as an arm of a ring (represenated by AcMG_755
). In this case, both the ring and the longer path should be marked as failed. A shorter not-ring path inner the failed ring can be reported instead (but failed for bug)
fixes:
- fix the bug report here. Now the shortest common path are kept.
- make code easier to read (seperate functions and NamedTuple)
- fix other bugs via adding tests