diff --git a/libcodonusage/__init__.py b/libcodonusage/__init__.py index a79d9a56401f7f9bc3565091ebbac3f643411fc6..1254cf9ee64479b766bfb0f1403c8b2100dabd41 100644 --- a/libcodonusage/__init__.py +++ b/libcodonusage/__init__.py @@ -1,6 +1,6 @@ __copyright__ = "Copyright (C) 2022 Blaise Li" __licence__ = "GNU GPLv3" -__version__ = "0.26" +__version__ = "0.27" from .libcodonusage import ( aa2colour, aa_usage, diff --git a/libcodonusage/libcodonusage.py b/libcodonusage/libcodonusage.py index 3bb2a5ede3ec557e0f3a201b40bdbbd0c6b09d6b..9e60d26b39ea4b993692e499a159729147339af5 100644 --- a/libcodonusage/libcodonusage.py +++ b/libcodonusage/libcodonusage.py @@ -21,7 +21,8 @@ from pathlib import Path # python3 -m pip install cytoolz from cytoolz import concat, groupby, unique # To render mardown in a Jupyter notebook on gitlab -from IPython.core.display import display, HTML +from IPython.display import display +from IPython.core.display import HTML # python3 -m pip install markdown from markdown import markdown # Basic plotting library for Python @@ -67,6 +68,7 @@ fmt_metadata = { "Title": "Distribution of standardized codon usages biases (by aa), by chromosome"} } + def render_md(md_str): """ Render a markdown string *md_str* in a Jupyter notebook. @@ -112,7 +114,7 @@ nuc2colour = dict(zip(nuc_alphabet, nuc_colours)) def load_counts_table( table_path, index_col="old_locus_tag", index_unique=True): """ - Load a table or pre-computed codon counts at *table_path*. + Load a table of pre-computed codon counts at *table_path*. The lines correspond to genes. Besides the columns containing the counts for each codon, @@ -933,7 +935,9 @@ def compare_clusterings( for (clust_1, clust_2) in combinations(cluster_names, 2): # assert crosstabs[aa][clust_1][clust_2] == 0 try: - if crosstabs[aa][clust_1][clust_2] != 0: + # if crosstabs[aa][clust_1][clust_2] != 0: + if (crosstabs[aa][clust_1][clust_2] != 0) \ + or (crosstabs[aa][clust_2][clust_1] != 0): same_clusters = False except KeyError: # At least one cluster is absent.