From 3fbb71e93d63f405555d10f9caa10709675dcbdf Mon Sep 17 00:00:00 2001 From: Blaise Li <blaise.li__git@nsup.org> Date: Thu, 24 Mar 2022 11:30:39 +0100 Subject: [PATCH] Allow custom info columns in counts table. --- libcodonusage/libcodonusage.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libcodonusage/libcodonusage.py b/libcodonusage/libcodonusage.py index 7721658..5167856 100644 --- a/libcodonusage/libcodonusage.py +++ b/libcodonusage/libcodonusage.py @@ -280,16 +280,18 @@ might be excluded. def make_counts_only( counts_table, - seq_id_kw="locus_tag", alt_tag_kw="old_locus_tag"): + seq_id_kw="locus_tag", alt_tag_kw="old_locus_tag", + ref_info_cols=None): """ Integrate "informative" columns of *counts_table* into the index. """ # To ensure a stable order: - ref_info_cols = [ - alt_tag_kw, seq_id_kw, - "start", "end", "length", - "start_codon", "expected_start_aa", - "first_stop", "nb_stops", "start_upstream", "end_downstream"] + if ref_info_cols is None: + ref_info_cols = [ + alt_tag_kw, seq_id_kw, + "start", "end", "length", + "start_codon", "expected_start_aa", + "first_stop", "nb_stops", "start_upstream", "end_downstream"] # To ensure no info columns are lost: info_cols = [ counts_table.index.name, -- GitLab