From 0d7f1bc0000df215e85f0da1143703e311328dea Mon Sep 17 00:00:00 2001 From: AndreaGuarracino Date: Fri, 13 Nov 2020 22:41:47 +0100 Subject: fix check date sra script --- scripts/create_sra_metadata/create_sra_metadata.py | 8 ++++---- scripts/download_genbank_data/from_genbank_to_fasta_and_yaml.py | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/create_sra_metadata/create_sra_metadata.py b/scripts/create_sra_metadata/create_sra_metadata.py index 85d4e9e..f5dc0c8 100644 --- a/scripts/create_sra_metadata/create_sra_metadata.py +++ b/scripts/create_sra_metadata/create_sra_metadata.py @@ -290,10 +290,10 @@ for i, EXPERIMENT_PACKAGE in enumerate(EXPERIMENT_PACKAGE_SET): year, month, day = [int(x) for x in info_for_yaml_dict['sample']['collection_date'].split('-')] collection_date_in_yaml = datetime(year, month, day) - - if accession not in not_created_accession_dict: - not_created_accession_dict[accession] = [] - not_created_accession_dict[accession].append('collection_date too early') + if collection_date_in_yaml < min_acceptable_collection_date: + if accession not in not_created_accession_dict: + not_created_accession_dict[accession] = [] + not_created_accession_dict[accession].append('collection_date too early') if 'sample_sequencing_technology' not in info_for_yaml_dict['technology']: # print(accession_version, ' - technology not found') 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 1352027..442a9a5 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 @@ -409,7 +409,6 @@ for path_metadata_xxx_xml in [os.path.join(dir_metadata, name_metadata_xxx_xml) year, month, day = [int(x) for x in info_for_yaml_dict['sample']['collection_date'].split('-')] collection_date_in_yaml = datetime(year, month, day) - if collection_date_in_yaml < min_acceptable_collection_date: if accession_version not in not_created_accession_dict: not_created_accession_dict[accession_version] = [] -- cgit v1.2.3