Skip to content

Commit

Permalink
Edited script to have format that we want in the preprint
Browse files Browse the repository at this point in the history
  • Loading branch information
simonleandergrimm committed Nov 18, 2023
1 parent 2ab28f2 commit 483dd1f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions preprint_stats/relative_abundance_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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],
Expand Down

0 comments on commit 483dd1f

Please sign in to comment.