Skip to content

Commit f4855f2

Browse files
Merge pull request #214 from jeromekelleher/remove-epi-isl
Remove epi isl
2 parents 6e70114 + 0734f1b commit f4855f2

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

notebooks/qc-template.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
"name": "python",
190190
"nbconvert_exporter": "python",
191191
"pygments_lexer": "ipython3",
192-
"version": "3.10.6"
192+
"version": "3.10.12"
193193
}
194194
},
195195
"nbformat": 4,

sc2ts/utils.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,9 @@ def max_descendant_samples(ts, show_progress=True):
319319

320320

321321
class TreeInfo:
322-
def __init__(self, ts, show_progress=True, pango_source="Nextclade_pango"):
323-
# Can current set pango_source to "Nextclade_pango" or "GISAID_lineage"
322+
def __init__(self, ts, show_progress=True, pango_source="Viridian_pangolin"):
324323
self.ts = ts
325324
self.pango_source = pango_source
326-
self.epi_isl_map = {}
327325
self.strain_map = {}
328326
self.recombinants = get_recombinants(ts)
329327
self.nodes_max_descendant_samples = max_descendant_samples(ts)
@@ -348,10 +346,6 @@ def __init__(self, ts, show_progress=True, pango_source="Nextclade_pango"):
348346
md = node.metadata
349347
self.nodes_metadata[node.id] = md
350348
if node.is_sample():
351-
self.epi_isl_map[md["gisaid_epi_isl"]] = node.id
352-
if md["gisaid_epi_isl"] is not None:
353-
if "." in md["gisaid_epi_isl"]:
354-
self.epi_isl_map[md["gisaid_epi_isl"].split(".")[0]] = node.id
355349
self.strain_map[md["strain"]] = node.id
356350
self.nodes_date[node.id] = md["date"]
357351
self.nodes_submission_date[node.id] = md["date_submitted"]
@@ -1036,11 +1030,9 @@ def _mutation_summary(self, mut_id):
10361030
"metadata": self.ts.mutation(mut_id).metadata,
10371031
}
10381032

1039-
def node_report(self, node_id=None, strain=None, epi_isl=None):
1033+
def node_report(self, node_id=None, strain=None):
10401034
if strain is not None:
10411035
node_id = self.strain_map[strain]
1042-
if epi_isl is not None:
1043-
node_id = self.epi_isl_map[epi_isl]
10441036
# node_summary = pd.DataFrame([self._node_summary(node_id)])
10451037
# TODO improve this for internal nodes
10461038
node_summary = [self.ts.node(node_id).metadata]
@@ -2021,6 +2013,8 @@ def add_gisaid_lineages_to_ts(ts, node_gisaid_lineages, linmuts_dict):
20212013
return edited_ts
20222014

20232015

2016+
# NOTE: this is broken since moving to Viridian metadata, we no longer have
2017+
# GISAID EPI ISL in the metadata
20242018
def check_lineages(
20252019
ts,
20262020
ti,

0 commit comments

Comments
 (0)