From f77e86dbb84baf8add3d7a71f8f06fb44a99507b Mon Sep 17 00:00:00 2001 From: AndreaGuarracino Date: Tue, 7 Jul 2020 23:01:48 +0200 Subject: fix missing authors #91 --- scripts/download_genbank_data/from_genbank_to_fasta_and_yaml.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 44308ed..cb94787 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 @@ -173,7 +173,9 @@ for path_metadata_xxx_xml in [os.path.join(dir_metadata, name_metadata_xxx_xml) # submitter info GBSeq_references = GBSeq.find('GBSeq_references') if GBSeq_references is not None: - info_for_yaml_dict['submitter']['authors'] = ["{}".format(x.text) for x in GBSeq_references.iter('GBAuthor')] + author_list = ["{}".format(x.text) for x in GBSeq_references.iter('GBAuthor')] + if len(author_list) > 0: + info_for_yaml_dict['submitter']['authors'] = author_list GBReference = GBSeq_references.find('GBReference') if GBReference is not None: -- cgit v1.2.3