From da4ca1c23d36a50e8218d76b25a327057719783c Mon Sep 17 00:00:00 2001 From: Tatiana Gurbich Date: Tue, 23 Jul 2024 11:24:42 +0100 Subject: [PATCH] Added a fix for collection date format --- genomeuploader/genome_upload.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/genomeuploader/genome_upload.py b/genomeuploader/genome_upload.py index 84dd092..f1438bd 100755 --- a/genomeuploader/genome_upload.py +++ b/genomeuploader/genome_upload.py @@ -506,7 +506,10 @@ def combine_ENA_info(genomeInfo, ENADict): else: run = genomeInfo[g]["accessions"][0] genomeInfo[g]["sequencingMethod"] = ENADict[run]["instrumentModel"] - genomeInfo[g]["collectionDate"] = ENADict[run]["collectionDate"] + if ENADict[run]["collectionDate"].lower() == "not applicable": + genomeInfo[g]["collectionDate"] = "not provided" + else: + genomeInfo[g]["collectionDate"] = ENADict[run]["collectionDate"] genomeInfo[g]["study"] = ENADict[run]["study"] genomeInfo[g]["description"] = ENADict[run]["projectDescription"] genomeInfo[g]["sample_accessions"] = ENADict[run]["sampleAccession"] @@ -517,7 +520,6 @@ def combine_ENA_info(genomeInfo, ENADict): genomeInfo[g]["accessions"] = ','.join(genomeInfo[g]["accessions"]) - def getAccessions(accessionsFile): accessionDict = {} with open(accessionsFile, 'r') as f: