Skip to content

Commit

Permalink
Fix for voucher identification & relabeling bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dportik committed May 1, 2021
1 parent ed07919 commit 7ed3745
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions supercrunch-scripts/Parse_Loci.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def parse_fasta_record(line, species, subspecies, no_subspecies):
#try to obtain a field/museum/sample code using the keywords
#voucher, isolate, and strain in the description line
if 'VOUCHER' in description:
if len([i for i in description.split('VOUCHER ') if i]) > 1:
if len([i for i in description.split('VOUCHER ')]) > 1:
parts = description.split('VOUCHER ')[-1].split()
if parts[0].replace("-", "").isalpha() and len(parts) > 1:
voucher = "Voucher_{}_{}".format(parts[0], parts[1])
Expand All @@ -262,7 +262,7 @@ def parse_fasta_record(line, species, subspecies, no_subspecies):
voucher = "NA"

elif 'ISOLATE' in description:
if len([i for i in description.split('ISOLATE ') if i]) > 1:
if len([i for i in description.split('ISOLATE ')]) > 1:
parts = description.split('ISOLATE ')[-1].split()
if parts[0].replace("-", "").isalpha() and len(parts) > 1:
voucher = "Voucher_{}_{}".format(parts[0], parts[1])
Expand All @@ -272,7 +272,7 @@ def parse_fasta_record(line, species, subspecies, no_subspecies):
voucher = "NA"

elif 'STRAIN' in description:
if len([i for i in description.split('STRAIN ') if i]) > 1:
if len([i for i in description.split('STRAIN ')]) > 1:
parts = description.split('STRAIN ')[-1].split()
if parts[0].replace("-", "").isalpha() and len(parts) > 1:
voucher = "Voucher_{}_{}".format(parts[0], parts[1])
Expand Down

0 comments on commit 7ed3745

Please sign in to comment.