From d9165d64840daca222305a6bf8d414a77a3cff21 Mon Sep 17 00:00:00 2001 From: AndreaGuarracino Date: Sun, 15 Nov 2020 14:23:09 +0100 Subject: fix sequencing_coverage --- scripts/download_genbank_data/from_genbank_to_fasta_and_yaml.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/download_genbank_data/from_genbank_to_fasta_and_yaml.py b/scripts/download_genbank_data/from_genbank_to_fasta_and_yaml.py index 17b741a..788f7e9 100755 --- a/scripts/download_genbank_data/from_genbank_to_fasta_and_yaml.py +++ b/scripts/download_genbank_data/from_genbank_to_fasta_and_yaml.py @@ -225,7 +225,8 @@ for path_metadata_xxx_xml in [os.path.join(dir_metadata, name_metadata_xxx_xml) # A regular expression would be better! try: info_for_yaml_dict['technology'][field_in_yaml] = [ - float(tech_info_to_parse.strip('(average)').strip("reads/nt").strip('(average for 6 sequences)').replace(',', '.').strip(' xX>')) + float(tech_info_to_parse.replace('(average)', '').replace("reads/nt", ''). + replace('(average for 6 sequences)', '').replace(',', '.').strip(' xX>')) ] except ValueError: print(accession_version, "Couldn't make sense of Coverage '%s'" % tech_info_to_parse) -- cgit v1.2.3