Skip to content

Commit 0e58b09

Browse files
committed
Fix sorting of measurements by subclade y axis position instead of clade position
1 parent d708188 commit 0e58b09

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

scripts/generate_collection_config_json.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ def calc_row(clade):
7878

7979
# Find minimum y-axis position for reference strains within each clade. This
8080
# position represents the earliest instance of the clade in the tree.
81-
min_y_axis_position_by_reference_clade = collection_df.groupby("clade_reference")["y_axis_position_in_phylogeny"].min().reset_index().rename(
81+
min_y_axis_position_by_reference_clade = collection_df.groupby("subclade_reference")["y_axis_position_in_phylogeny"].min().reset_index().rename(
8282
columns={"y_axis_position_in_phylogeny": "min_y_axis_position_in_phylogeny"}
8383
)
8484

8585
# Annotate min y-axis position per clade to collection.
8686
collection_df = collection_df.merge(
8787
min_y_axis_position_by_reference_clade,
88-
on="clade_reference",
88+
on="subclade_reference",
8989
how="left",
9090
)
9191

workflow/snakemake_rules/titer_models.smk

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ rule generate_collection_config_json:
125125
groupings=[
126126
"reference_strain",
127127
"reference_strain_source",
128-
"clade_reference",
128+
"subclade_reference",
129129
"emerging_haplotype_reference",
130130
"derived_haplotype_reference",
131131
"source",
@@ -141,8 +141,8 @@ rule generate_collection_config_json:
141141
"source",
142142
"test_date",
143143
"reference_date",
144-
"clade_test",
145-
"clade_reference",
144+
"subclade_test",
145+
"subclade_reference",
146146
"emerging_haplotype_test",
147147
"emerging_haplotype_reference",
148148
"derived_haplotype_test",
@@ -185,7 +185,7 @@ rule export_measurements:
185185
filters=[
186186
"reference_strain",
187187
"reference_strain_source",
188-
"clade_reference",
188+
"subclade_reference",
189189
"emerging_haplotype_reference",
190190
"derived_haplotype_reference",
191191
"source",
@@ -201,8 +201,8 @@ rule export_measurements:
201201
"source",
202202
"test_date",
203203
"reference_date",
204-
"clade_test",
205-
"clade_reference",
204+
"subclade_test",
205+
"subclade_reference",
206206
"emerging_haplotype_test",
207207
"emerging_haplotype_reference",
208208
"derived_haplotype_test",

0 commit comments

Comments
 (0)