Skip to content

Commit

Permalink
Add incomplete epi info to microreact
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjcroucher committed Dec 9, 2024
1 parent a5e69b1 commit 78ee2e3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
15 changes: 7 additions & 8 deletions PopPUNK/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,14 +730,13 @@ def writeClusterCsv(outfile, nodeNames, nodeLabels, clustering,
d['Status'].append("Reference")
if epiCsv is not None:
if label in epiData.index:
if label in epiData.index:
for col, value in zip(epiData.columns.values, epiData.loc[[label]].iloc[0].values):
if col not in columns_to_be_omitted:
d[col].append(str(value))
else:
for col in epiData.columns.values:
if col not in columns_to_be_omitted:
d[col].append('nan')
for col, value in zip(epiData.columns.values, epiData.loc[[label]].iloc[0].values):
if col not in columns_to_be_omitted:
d[col].append(str(value))
else:
for col in epiData.columns.values:
if col not in columns_to_be_omitted:
d[col].append('')

else:
sys.stderr.write("Cannot find " + name + " in clustering\n")
Expand Down
5 changes: 5 additions & 0 deletions test/batch123_info.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
id,Location
19183_4#55,CountryX
19183_4#48,CountryY
12754_4#89,CountryZ
12754_5#16,CountryZ
2 changes: 1 addition & 1 deletion test/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
subprocess.run(python_cmd + " ../poppunk-runner.py --fit-model dbscan --ref-db batch12 --output batch12 --overwrite", shell=True, check=True)
subprocess.run(python_cmd + " ../poppunk-runner.py --fit-model refine --ref-db batch12 --output batch12 --overwrite", shell=True, check=True)
subprocess.run(python_cmd + " ../poppunk_assign-runner.py --db batch12 --query rfile3.txt --output batch3 --external-clustering batch12_external_clusters.csv --save-partial-query-graph --overwrite", shell=True, check=True)
subprocess.run(python_cmd + " ../poppunk_visualise-runner.py --ref-db batch12 --query-db batch3 --output batch123_viz --external-clustering batch12_external_clusters.csv --previous-query-clustering batch3/batch3_external_clusters.csv --cytoscape --rapidnj rapidnj --use-partial-query-graph ./batch3/batch3_query.subset --recalculate-distances --extend-query-graph --overwrite", shell=True, check=True)
subprocess.run(python_cmd + " ../poppunk_visualise-runner.py --ref-db batch12 --query-db batch3 --output batch123_viz --external-clustering batch12_external_clusters.csv --previous-query-clustering batch3/batch3_external_clusters.csv --cytoscape --rapidnj rapidnj --use-partial-query-graph ./batch3/batch3_query.subset --recalculate-distances --extend-query-graph --info-csv batch123_info.csv --microreact --overwrite", shell=True, check=True)

# citations
sys.stderr.write("Printing citations\n")
Expand Down

0 comments on commit 78ee2e3

Please sign in to comment.