linxingchen / cobra

A tool to raise the quality of viral genomes assembled from short-read metagenomes via resolving and joining of contigs fragmented during de novo assembly.
MIT License
62 stars 10 forks source link

fix: fix key error caused by failed_join_potential #41

Closed Hocnonsense closed 3 months ago

Hocnonsense commented 3 months ago

Previously, if a query contig is link to a extended circle, and the query also fall into failed_join_potential, then it may raise key error afterward.

For example: image

graph {
    rankdir = "LR";
    ordering = "in";
    node [shape = plain;];

    k141_374016_L -- k141_374016_R [color=red;label="cov=2.6159"]
    k141_1275772_L -- k141_1275772_R [color=blue;label="cov=5.569"]
    k141_158261_L -- k141_158261_R [color=green;label="cov=1.2559"]
    k141_21772_L -- k141_21772_R [color=orange;label="cov=9.930"]

    k141_374016_L -- k141_158261_R [color=red]
                     k141_158261_L -- k141_21772_R [color=red]
    k141_374016_R -- k141_21772_L [color=red]
                     k141_21772_R -- k141_158261_L [color=red]

    k141_158261_L -- k141_21772_R [color=green]
                     k141_21772_L -- k141_1275772_R [color=green]
    k141_158261_R -- k141_374016_L [color=green]
                     k141_374016_R -- k141_21772_L [color=green]

    k141_21772_L -- k141_1275772_R [color=orange]
    k141_21772_R -- k141_158261_L [color=orange]
    k141_158261_R -- k141_374016_L [color=orange]

}