Skip to content
Snippets Groups Projects
Commit 4c7e0611 authored by Jasper Koehorst's avatar Jasper Koehorst
Browse files

taxonomy split fix

parent 16167999
No related branches found
No related tags found
No related merge requests found
......@@ -140,7 +140,7 @@ def process_rdf_files(rdf_file):
def biom_preformatter():
# Format tax matrix a bit so further parsing as added prefixes
tax_df = process_tax()
# Load and transform the ASV file into a matrix
lines = []
for line in open("asv.tsv"):
......@@ -218,9 +218,12 @@ def tsv_to_biom():
# Create Python object from JSON string data
obj = json.loads(json_data)
# Fix taxonomy split issue
for index, row in enumerate(obj["rows"]):
row['metadata']['taxonomy'] = row['metadata']['taxonomy'].split("; ")
# Pretty Print JSON
json_formatted_str = json.dumps(obj, indent=4, sort_keys=True)
biom_file = job.split("/")[-1].replace(".job", ".biom")
print("Writing biom file to", biom_file)
print(json_formatted_str, file=open(biom_file, "w"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment