From 0cfda756519bb74a471f1271c1c7ba264a035b65 Mon Sep 17 00:00:00 2001 From: Haibao Tang Date: Fri, 7 Jun 2024 23:08:19 -0700 Subject: [PATCH 1/2] don't make index --- jcvi/formats/gff.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jcvi/formats/gff.py b/jcvi/formats/gff.py index 36f8faf5..da13f3b6 100644 --- a/jcvi/formats/gff.py +++ b/jcvi/formats/gff.py @@ -2829,9 +2829,9 @@ def note(args): if type: type = type.split(",") - g = make_index(gffile) exoncounts = {} if opts.exoncount: + g = make_index(gffile) for feat in g.features_of_type("mRNA"): nexons = 0 for c in g.children(feat.id, 1): @@ -2851,7 +2851,7 @@ def note(args): if AED is not None and float(g.attributes["_AED"][0]) > AED: continue keyval = [g.accn] + [ - ",".join(g.attributes[x]) for x in attrib if x in g.attributes + ",".join(g.attributes.get(x, ["nan"])) for x in attrib ] if exoncounts: nexons = exoncounts.get(g.accn, 0) From 893d46867e2277f0c83d49955a185de5627eb5ae Mon Sep 17 00:00:00 2001 From: Haibao Tang Date: Sat, 8 Jun 2024 00:07:29 -0700 Subject: [PATCH 2/2] updated webcolors broke --- jcvi/utils/webcolors.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jcvi/utils/webcolors.py b/jcvi/utils/webcolors.py index 41e8e4f8..e1c33c41 100755 --- a/jcvi/utils/webcolors.py +++ b/jcvi/utils/webcolors.py @@ -12,7 +12,8 @@ import numpy as np from skimage.color import rgb2lab, deltaE_cmc -from webcolors import CSS3_HEX_TO_NAMES, hex_to_rgb +from webcolors._definitions import _CSS3_NAMES_TO_HEX +from webcolors import hex_to_rgb def color_diff(rgb1, rgb2): @@ -38,8 +39,8 @@ def closest_color(requested_color): """ logging.disable(logging.DEBUG) colors = [] - for key, name in CSS3_HEX_TO_NAMES.items(): - diff = color_diff(hex_to_rgb(key), requested_color) + for name, hex in _CSS3_NAMES_TO_HEX.items(): + diff = color_diff(hex_to_rgb(hex), requested_color) colors.append((diff, name)) logging.disable(logging.NOTSET) _, min_color = min(colors)