Skip to content
Snippets Groups Projects
Commit 12c11d66 authored by Jakub Dylag's avatar Jakub Dylag
Browse files

output reproducible - order and uniformity in output files

parent 3ad40be1
No related branches found
No related tags found
No related merge requests found
......@@ -9,11 +9,12 @@ def main(config):
else:
raise Exception("Concepts file must be '.csv' filetype")
filename = config["concepts"][:-4]
for name, concept in df.groupby("MELDB_concept"):
concept.sort_values(by="code")
concept.to_csv(os.path.join(config["output"], str(name)+".csv"),
concept = concept.sort_values(by="code") #sort rows
concept = concept.dropna(how='all', axis=1) #remove empty cols
concept = concept.reindex(sorted(concept.columns), axis=1) #sort cols alphabetically
concept.to_csv(os.path.join(config["output"], str(name)+".csv"), #save to csv
index=False )
......
#! /usr/bin/bash
version="V3_2_7"
previous="V3_2_6"
version="V3_2_10"
previous="V3_2_9"
python main.py -r2 PHEN_assign_v3.json CONC_summary_working.xlsx
mv output/MELD_concepts_read.csv output/${version}_MELD_concepts_readv2.csv
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment