From 9f963bb71b4c148878794a5c56b4435a8166f0a1 Mon Sep 17 00:00:00 2001 From: Haibao Tang Date: Tue, 30 Apr 2024 20:57:36 -0700 Subject: [PATCH] residuals --- jcvi/annotation/reformat.py | 1 - jcvi/assembly/syntenypath.py | 27 +++++++++++++-------------- jcvi/compara/synteny.py | 1 - 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/jcvi/annotation/reformat.py b/jcvi/annotation/reformat.py index 5b661130..26d52af5 100644 --- a/jcvi/annotation/reformat.py +++ b/jcvi/annotation/reformat.py @@ -9,7 +9,6 @@ """ import os import sys -import logging import re from collections import defaultdict diff --git a/jcvi/assembly/syntenypath.py b/jcvi/assembly/syntenypath.py index c0b1e855..7d12d24f 100644 --- a/jcvi/assembly/syntenypath.py +++ b/jcvi/assembly/syntenypath.py @@ -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: @@ -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 @@ -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): @@ -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") @@ -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) ) @@ -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): diff --git a/jcvi/compara/synteny.py b/jcvi/compara/synteny.py index 7d569f71..31c6a941 100755 --- a/jcvi/compara/synteny.py +++ b/jcvi/compara/synteny.py @@ -6,7 +6,6 @@ import os.path as op import sys -import logging from collections import defaultdict from collections.abc import Iterable