taxoniumtools 2.1.22__py3-none-any.whl → 2.1.24__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- taxoniumtools/_version.py +3 -3
- taxoniumtools/ushertools.py +19 -9
- {taxoniumtools-2.1.22.dist-info → taxoniumtools-2.1.24.dist-info}/METADATA +1 -1
- {taxoniumtools-2.1.22.dist-info → taxoniumtools-2.1.24.dist-info}/RECORD +7 -7
- {taxoniumtools-2.1.22.dist-info → taxoniumtools-2.1.24.dist-info}/WHEEL +1 -1
- {taxoniumtools-2.1.22.dist-info → taxoniumtools-2.1.24.dist-info}/entry_points.txt +0 -0
- {taxoniumtools-2.1.22.dist-info → taxoniumtools-2.1.24.dist-info}/top_level.txt +0 -0
taxoniumtools/_version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '2.1.
|
|
32
|
-
__version_tuple__ = version_tuple = (2, 1,
|
|
31
|
+
__version__ = version = '2.1.24'
|
|
32
|
+
__version_tuple__ = version_tuple = (2, 1, 24)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g9d251e3c4'
|
taxoniumtools/ushertools.py
CHANGED
|
@@ -73,22 +73,29 @@ def get_codon_table():
|
|
|
73
73
|
codon_table = get_codon_table()
|
|
74
74
|
|
|
75
75
|
|
|
76
|
-
def get_gene_name(cds):
|
|
76
|
+
def get_gene_name(cds, gene_records):
|
|
77
77
|
"""Returns gene if available, otherwise locus tag"""
|
|
78
78
|
if "gene" in cds.qualifiers:
|
|
79
79
|
return cds.qualifiers["gene"][0]
|
|
80
80
|
elif "locus_tag" in cds.qualifiers:
|
|
81
81
|
return cds.qualifiers["locus_tag"][0]
|
|
82
82
|
else:
|
|
83
|
+
for gene in gene_records:
|
|
84
|
+
if gene.location == cds.location:
|
|
85
|
+
if "gene" in gene.qualifiers:
|
|
86
|
+
return gene.qualifiers["gene"][0]
|
|
87
|
+
if "product" in cds.qualifiers:
|
|
88
|
+
return cds.qualifiers["product"][0].replace(" ", "_")
|
|
83
89
|
raise ValueError(f"No gene name or locus tag for {cds}")
|
|
84
90
|
|
|
85
91
|
|
|
86
|
-
def get_genes_dict(cdses):
|
|
92
|
+
def get_genes_dict(cdses, gene_records):
|
|
87
93
|
genes = {}
|
|
88
94
|
for cds in cdses:
|
|
89
95
|
|
|
90
|
-
|
|
91
|
-
|
|
96
|
+
gene_name = get_gene_name(cds, gene_records)
|
|
97
|
+
genes[gene_name] = Gene(gene_name, cds.strand, cds.location.start,
|
|
98
|
+
cds.location.end)
|
|
92
99
|
return genes
|
|
93
100
|
|
|
94
101
|
|
|
@@ -333,17 +340,18 @@ class UsherMutationAnnotatedTree:
|
|
|
333
340
|
def load_genbank_file(self, genbank_file):
|
|
334
341
|
self.genbank = SeqIO.read(genbank_file, "genbank")
|
|
335
342
|
self.cdses = [x for x in self.genbank.features if x.type == "CDS"]
|
|
343
|
+
gene_records = [x for x in self.genbank.features if x.type == "gene"]
|
|
336
344
|
# Assert that there are no compound locations and that all strands are positive,
|
|
337
345
|
# and that all CDS features are a multiple of 3
|
|
338
346
|
|
|
339
|
-
self.genes = get_genes_dict(self.cdses)
|
|
347
|
+
self.genes = get_genes_dict(self.cdses, gene_records)
|
|
340
348
|
|
|
341
349
|
by_everything = defaultdict(lambda: defaultdict(dict))
|
|
342
350
|
total_lengths = {}
|
|
343
351
|
|
|
344
352
|
for feature in self.cdses:
|
|
345
353
|
|
|
346
|
-
gene_name = get_gene_name(feature)
|
|
354
|
+
gene_name = get_gene_name(feature, gene_records)
|
|
347
355
|
|
|
348
356
|
nucleotide_counter = 0
|
|
349
357
|
for part in feature.location.parts:
|
|
@@ -370,9 +378,11 @@ class UsherMutationAnnotatedTree:
|
|
|
370
378
|
codon_obj = Codon(feat_name, codon_index, codon_dict,
|
|
371
379
|
self.genes[feat_name].strand)
|
|
372
380
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
381
|
+
if len(codon_dict) % 3 == 0:
|
|
382
|
+
for k, v in codon_dict.items():
|
|
383
|
+
nuc_to_codon[v].append(codon_obj)
|
|
384
|
+
else:
|
|
385
|
+
print(f"Skipping partial codon for feature {feat_name}")
|
|
376
386
|
|
|
377
387
|
self.nuc_to_codon = nuc_to_codon
|
|
378
388
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
taxoniumtools/__init__.py,sha256=iizd2XLvtBHVDz6j82ZWJ2eojVvbTmtJCWQGk5MtqhE,51
|
|
2
2
|
taxoniumtools/__main__.py,sha256=0-mrc1_4NaJur-6SQXV6vGrJFFDuRRFvqeQvnlOA5l4,25
|
|
3
|
-
taxoniumtools/_version.py,sha256=
|
|
3
|
+
taxoniumtools/_version.py,sha256=c9729_qM883xccr_V43bsBBjoeG7fZF3f-dZHO91oaw,714
|
|
4
4
|
taxoniumtools/newick_to_taxonium.py,sha256=05JMQgmYLEo4nZVGPB0afAlF2s93WE7Ka_jwd0kCw0A,6207
|
|
5
5
|
taxoniumtools/parsimony_pb2.py,sha256=hE6jWYlgTpUbTS1uTjRKwVgPNO232QIu3LqjpJUlthU,15575
|
|
6
6
|
taxoniumtools/usher_to_taxonium.py,sha256=fir7_p18f8CaFGX7H1tRTm5YSryMhmcuA_PlL3sY2m4,12295
|
|
7
|
-
taxoniumtools/ushertools.py,sha256=
|
|
7
|
+
taxoniumtools/ushertools.py,sha256=Af5KApxNSjTT6NHpb2m8bM8jCjz1_DSKgsnUbiBCndo,16985
|
|
8
8
|
taxoniumtools/utils.py,sha256=sNbadwK7CNLK-sQFf31Au8nG1rUmcrbGMKDSV7UJMJo,10477
|
|
9
9
|
taxoniumtools/view_taxonium.py,sha256=LYWBhaXYrmOOrIHI2bBYhqNUw-HZRtYzdvMQb6ZombI,4640
|
|
10
|
-
taxoniumtools-2.1.
|
|
11
|
-
taxoniumtools-2.1.
|
|
12
|
-
taxoniumtools-2.1.
|
|
13
|
-
taxoniumtools-2.1.
|
|
14
|
-
taxoniumtools-2.1.
|
|
10
|
+
taxoniumtools-2.1.24.dist-info/METADATA,sha256=e8Kl3sDSY9R_QlBQsgbwhyxTbTY3CiQqXq6lZzraMAY,2168
|
|
11
|
+
taxoniumtools-2.1.24.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
+
taxoniumtools-2.1.24.dist-info/entry_points.txt,sha256=oIcDnAw81KjfG32-ePuBFvqS_wbLXWB8NmWo61o1LW0,183
|
|
13
|
+
taxoniumtools-2.1.24.dist-info/top_level.txt,sha256=EEWGvODb1nR_CiPHUDxcfU4UzxtPnVN4yTywlT3Z0nE,14
|
|
14
|
+
taxoniumtools-2.1.24.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|