Skip to content

Commit

Permalink
Added collected date exception
Browse files Browse the repository at this point in the history
  • Loading branch information
tgurbich committed Jul 23, 2024
1 parent 28e7648 commit d55ec5c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions genomeuploader/genome_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ def extract_ENA_info(genomeInfo, uploadDir, webin, password):
country = "not provided"

collectionDate = sampleInfo["collection_date"].lower()
if not collectionDate or collectionDate == "missing" or collectionDate == "not applicable":
if not collectionDate or collectionDate == "missing" or collectionDate in \
["not applicable", "not available"]:
collectionDate = "not provided"

tempDict[runAccession] = {
Expand Down Expand Up @@ -482,7 +483,7 @@ def combine_ENA_info(genomeInfo, ENADict):
collectionDate = collectionList[0]
if multipleElementSet(collectionList):
collectionDate = "not provided"
if collectionDate.lower() == "not applicable":
if collectionDate.lower() in ["not applicable", "not available"]:
collectionDate = "not provided"
genomeInfo[g]["collectionDate"] = collectionDate

Expand Down Expand Up @@ -514,7 +515,7 @@ def combine_ENA_info(genomeInfo, ENADict):
else:
run = genomeInfo[g]["accessions"][0]
genomeInfo[g]["sequencingMethod"] = ENADict[run]["instrumentModel"]
if ENADict[run]["collectionDate"].lower() == "not applicable":
if ENADict[run]["collectionDate"].lower() in ["not applicable", "not available"]:
genomeInfo[g]["collectionDate"] = "not provided"
else:
genomeInfo[g]["collectionDate"] = ENADict[run]["collectionDate"]
Expand Down

0 comments on commit d55ec5c

Please sign in to comment.