From cb94ded3ea7d28a81ab41fc88ffd291bc0f8c079 Mon Sep 17 00:00:00 2001 From: AndreaGuarracino Date: Fri, 13 Nov 2020 22:29:10 +0100 Subject: generation of dates a little more robust --- scripts/download_genbank_data/from_genbank_to_fasta_and_yaml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/download_genbank_data') 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 8fbacd1..1352027 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 @@ -358,7 +358,7 @@ for path_metadata_xxx_xml in [os.path.join(dir_metadata, name_metadata_xxx_xml) else: info_for_yaml_dict['sample']['additional_collection_information'] = "The 'collection_date' is estimated (the original date was: {})".format(GBQualifier_value_text) elif len(GBQualifier_value_text.split('-')) == 2: - date_to_write += '-15' + date_to_write = parse(GBQualifier_value_text).strftime('%Y-%m') + '-15' if 'additional_collection_information' in info_for_yaml_dict['sample']: info_for_yaml_dict['sample']['additional_collection_information'] += "; The 'collection_date' is estimated (the original date was: {})".format(GBQualifier_value_text) -- cgit v1.2.3