From 483dd1f7f6ac7be3983ad0f2b0cd16a5c2a2a610 Mon Sep 17 00:00:00 2001 From: simonleandergrimm Date: Sat, 18 Nov 2023 10:47:21 -0500 Subject: [PATCH] Edited script to have format that we want in the preprint --- preprint_stats/relative_abundance_table.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/preprint_stats/relative_abundance_table.py b/preprint_stats/relative_abundance_table.py index a7f0e35..476194e 100644 --- a/preprint_stats/relative_abundance_table.py +++ b/preprint_stats/relative_abundance_table.py @@ -73,7 +73,14 @@ def create_tsv(): sorted_viruses = sorted(viruses, key=lambda x: (x[1], x[0])) - headers = ["Virus", "Predictor Type", "Study", "Median", "Lower", "Upper"] + study_tidy = { + "rothman": "Rothman", + "crits_christoph": "Crits-Christoph", + "spurbeck": "Spurbeck", + "brinch": "Brinch", + } + + headers = ["Virus", "Study", "Median", "Lower", "Upper"] with open("output_summary.tsv", "w", newline="") as file: writer = csv.DictWriter(file, fieldnames=headers, delimiter="\t") @@ -88,8 +95,7 @@ def create_tsv(): writer.writerow( { "Virus": virus, - "Predictor Type": predictor_type, - "Study": study, + "Study": study_tidy[study], "Median": stats.percentiles[50], "Lower": stats.percentiles[5], "Upper": stats.percentiles[95],