diff --git a/notebooks/qc-template.ipynb b/notebooks/qc-template.ipynb index b549807..aa7ab5e 100644 --- a/notebooks/qc-template.ipynb +++ b/notebooks/qc-template.ipynb @@ -189,7 +189,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/sc2ts/utils.py b/sc2ts/utils.py index 0e4f4ce..0752ce9 100644 --- a/sc2ts/utils.py +++ b/sc2ts/utils.py @@ -319,11 +319,9 @@ def max_descendant_samples(ts, show_progress=True): class TreeInfo: - def __init__(self, ts, show_progress=True, pango_source="Nextclade_pango"): - # Can current set pango_source to "Nextclade_pango" or "GISAID_lineage" + def __init__(self, ts, show_progress=True, pango_source="Viridian_pangolin"): self.ts = ts self.pango_source = pango_source - self.epi_isl_map = {} self.strain_map = {} self.recombinants = get_recombinants(ts) self.nodes_max_descendant_samples = max_descendant_samples(ts) @@ -348,10 +346,6 @@ def __init__(self, ts, show_progress=True, pango_source="Nextclade_pango"): md = node.metadata self.nodes_metadata[node.id] = md if node.is_sample(): - self.epi_isl_map[md["gisaid_epi_isl"]] = node.id - if md["gisaid_epi_isl"] is not None: - if "." in md["gisaid_epi_isl"]: - self.epi_isl_map[md["gisaid_epi_isl"].split(".")[0]] = node.id self.strain_map[md["strain"]] = node.id self.nodes_date[node.id] = md["date"] self.nodes_submission_date[node.id] = md["date_submitted"] @@ -1036,11 +1030,9 @@ def _mutation_summary(self, mut_id): "metadata": self.ts.mutation(mut_id).metadata, } - def node_report(self, node_id=None, strain=None, epi_isl=None): + def node_report(self, node_id=None, strain=None): if strain is not None: node_id = self.strain_map[strain] - if epi_isl is not None: - node_id = self.epi_isl_map[epi_isl] # node_summary = pd.DataFrame([self._node_summary(node_id)]) # TODO improve this for internal nodes node_summary = [self.ts.node(node_id).metadata] @@ -2021,6 +2013,8 @@ def add_gisaid_lineages_to_ts(ts, node_gisaid_lineages, linmuts_dict): return edited_ts +# NOTE: this is broken since moving to Viridian metadata, we no longer have +# GISAID EPI ISL in the metadata def check_lineages( ts, ti,