aboutsummaryrefslogtreecommitdiff
path: root/scripts/from_genbank_to_fasta_and_yaml.py
diff options
context:
space:
mode:
authorPeter Amstutz2020-04-21 13:22:53 -0400
committerPeter Amstutz2020-04-21 13:22:53 -0400
commit7e085b2958d9bd4f0a2b1912cf259a05b56366bc (patch)
tree29227cc5e55264945521ed27172db70c8de46d73 /scripts/from_genbank_to_fasta_and_yaml.py
parent88d81f853cf04b7f28681dd9cdee775b0422f252 (diff)
downloadbh20-seq-resource-7e085b2958d9bd4f0a2b1912cf259a05b56366bc.tar.gz
bh20-seq-resource-7e085b2958d9bd4f0a2b1912cf259a05b56366bc.tar.lz
bh20-seq-resource-7e085b2958d9bd4f0a2b1912cf259a05b56366bc.zip
Tweak handling of "coverage" also fix typo
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>
Diffstat (limited to 'scripts/from_genbank_to_fasta_and_yaml.py')
-rwxr-xr-xscripts/from_genbank_to_fasta_and_yaml.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/from_genbank_to_fasta_and_yaml.py b/scripts/from_genbank_to_fasta_and_yaml.py
index 1a12513..00c0012 100755
--- a/scripts/from_genbank_to_fasta_and_yaml.py
+++ b/scripts/from_genbank_to_fasta_and_yaml.py
@@ -130,9 +130,12 @@ if not os.path.exists(dir_fasta_and_yaml_today):
if field_in_yaml == 'sequencing_coverage':
# A regular expression would be better!
- info_for_yaml_dict['technology'][field_in_yaml] = ';'.join(
- [x.strip('(average)').strip("reads/nt").replace(',', '.').strip(' xX>') for x in tech_info_to_parse.split(';')]
- )
+ try:
+ info_for_yaml_dict['technology'][field_in_yaml] = float(
+ tech_info_to_parse.strip('(average)').strip("reads/nt").replace(',', '.').strip(' xX>'))
+ except ValueError:
+ print(accession_version, "Couldn't make sense of Coverage '%s'" % tech_info_to_parse)
+ pass
elif field_in_yaml == 'sample_sequencing_technology':
new_seq_tec_list = []
for seq_tec in tech_info_to_parse.split(';'):