cobra icon indicating copy to clipboard operation
cobra copied to clipboard

fix: fix handle of "6" shape path

Open Hocnonsense opened this issue 5 months ago • 0 comments

will fix #43

background

in the issue, queries are extended as follow pattern: 1368a2bafc107fc2e242dd719e03867

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:

  1. fix the bug report here. Now the shortest common path are kept.
  2. make code easier to read (seperate functions and NamedTuple)
  3. fix other bugs via adding tests

Hocnonsense avatar Sep 07 '24 06:09 Hocnonsense