Skip to content

Commit

Permalink
residuals
Browse files Browse the repository at this point in the history
  • Loading branch information
tanghaibao committed May 1, 2024
1 parent 067d185 commit 9f963bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
1 change: 0 additions & 1 deletion jcvi/annotation/reformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"""
import os
import sys
import logging
import re

from collections import defaultdict
Expand Down
27 changes: 13 additions & 14 deletions jcvi/assembly/syntenypath.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@
Syntenic path assembly.
"""
import sys
import logging

from collections import defaultdict
from itertools import groupby, combinations
from more_itertools import pairwise

from jcvi.formats.blast import BlastSlow, Blast
from jcvi.formats.sizes import Sizes
from jcvi.formats.base import LineFile, must_open
from jcvi.utils.range import range_intersect
from jcvi.algorithms.graph import BiGraph
from jcvi.apps.base import OptionParser, ActionDispatcher
from ..algorithms.graph import BiGraph
from ..apps.base import ActionDispatcher, OptionParser, logger
from ..formats.base import LineFile, must_open
from ..formats.blast import Blast, BlastSlow
from ..formats.sizes import Sizes
from ..utils.range import range_intersect


class OVLLine:
Expand Down Expand Up @@ -60,12 +59,12 @@ def __init__(self, filename):
alledges[o.a + "-3`"].append(o)
elif o.tag == "b->a":
alledges[o.a + "-5`"].append(o)
logging.debug(
logger.debug(
"Imported {} links. Contained tigs: {}".format(len(self), len(contained))
)
self.contained = contained

logging.debug("Pruning edges to keep the mutual best")
logger.debug("Pruning edges to keep the mutual best")
for k, v in alledges.items():
bo = max(v, key=lambda x: x.score)
bo.best = True
Expand Down Expand Up @@ -360,7 +359,7 @@ def happy(args):
fw = fw2 if is_uncertain else fw1
print(e, file=fw)

logging.debug("Edges written to `{0}`".format(",".join((certain, uncertain))))
logger.debug("Edges written to `{0}`".format(",".join((certain, uncertain))))


def fromblast(args):
Expand Down Expand Up @@ -425,7 +424,7 @@ def graph_to_agp(g, blastfile, subjectfasta, exclude=[], verbose=False):

from jcvi.formats.agp import order_to_agp

logging.debug(str(g))
logger.debug(str(g))
g.write("graph.txt")
# g.draw("graph.pdf")

Expand All @@ -441,7 +440,7 @@ def graph_to_agp(g, blastfile, subjectfasta, exclude=[], verbose=False):

npaths = len(paths)
ntigs = sum(len(x) for x in paths)
logging.debug(
logger.debug(
"Graph decomposed to {0} paths with {1} components.".format(npaths, ntigs)
)

Expand Down Expand Up @@ -469,14 +468,14 @@ def graph_to_agp(g, blastfile, subjectfasta, exclude=[], verbose=False):
object = ctg
order_to_agp(object, ctgorder, sizes.mapping, fwagp)
nsingletons += 1
logging.debug(
logger.debug(
"scaffolded={} excluded={} singletons={}".format(
nscaffolded, nexcluded, nsingletons
)
)

fwagp.close()
logging.debug("AGP file written to `{0}`.".format(agpfile))
logger.debug("AGP file written to `{0}`.".format(agpfile))


def connect(args):
Expand Down
1 change: 0 additions & 1 deletion jcvi/compara/synteny.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import os.path as op
import sys
import logging

from collections import defaultdict
from collections.abc import Iterable
Expand Down

0 comments on commit 9f963bb

Please sign in to comment.