From 7ed3745db318f7de6cac5b5c7329a68dfbbe4d38 Mon Sep 17 00:00:00 2001 From: dportik Date: Sat, 1 May 2021 15:21:02 -0700 Subject: [PATCH] Fix for voucher identification & relabeling bug --- supercrunch-scripts/Parse_Loci.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/supercrunch-scripts/Parse_Loci.py b/supercrunch-scripts/Parse_Loci.py index 2582f06..7a77543 100644 --- a/supercrunch-scripts/Parse_Loci.py +++ b/supercrunch-scripts/Parse_Loci.py @@ -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]) @@ -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]) @@ -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])