diff options
author | lltommy | 2020-04-22 19:41:27 +0200 |
---|---|---|
committer | lltommy | 2020-04-22 19:41:27 +0200 |
commit | a12fe94f174da766be612fbb2712b4db2ba98296 (patch) | |
tree | 0c1a21fcfc638460d91309f7dfac3fdc967ca7c1 /scripts | |
parent | ba8b5d364f0ba96f3fef5214137d30ed00a8079d (diff) | |
download | bh20-seq-resource-a12fe94f174da766be612fbb2712b4db2ba98296.tar.gz bh20-seq-resource-a12fe94f174da766be612fbb2712b4db2ba98296.tar.lz bh20-seq-resource-a12fe94f174da766be612fbb2712b4db2ba98296.zip |
Small changes all around, trying to make the importer/metadata better
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/foreach.sh | 2 | ||||
-rwxr-xr-x | scripts/from_genbank_to_fasta_and_yaml.py | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/scripts/foreach.sh b/scripts/foreach.sh index 35b07b8..ddc9387 100755 --- a/scripts/foreach.sh +++ b/scripts/foreach.sh @@ -2,7 +2,7 @@ rm -rf validated fasta_and_yaml_* mkdir -p validated ./from_genbank_to_fasta_and_yaml.py -fasta_files=$(find fasta_and_yaml_20200421/ -name "*.fasta") +fasta_files=$(find fasta_and_yaml/ -name "*.fasta") for f in $fasta_files ; do yaml=$(echo $f | rev | cut -c7- | rev).yaml echo $f diff --git a/scripts/from_genbank_to_fasta_and_yaml.py b/scripts/from_genbank_to_fasta_and_yaml.py index 00c0012..096a6af 100755 --- a/scripts/from_genbank_to_fasta_and_yaml.py +++ b/scripts/from_genbank_to_fasta_and_yaml.py @@ -8,10 +8,11 @@ import json import os from datetime import date -today = date.today().strftime("%Y%m%d") +#today = date.today().strftime("%Y%m%d") -dir_metadata_today = 'metadata_from_nuccore_{}'.format(today) -dir_fasta_and_yaml_today = 'fasta_and_yaml_{}'.format(today) + +dir_metadata_today = 'metadata_from_nuccore' #_{}'.format(today) +dir_fasta_and_yaml_today = 'fasta_and_yaml' #'.format(today) dir_dict_ontology_standardization = 'dict_ontology_standardization/' @@ -177,7 +178,10 @@ if not os.path.exists(dir_fasta_and_yaml_today): if len(GBQualifier_value_text_list) > 1: if GBQualifier_value_text_list[1] in ['male', 'female']: - info_for_yaml_dict['host']['host_sex'] = GBQualifier_value_text_list[1] + if GBQualifier_value_text_list[1]=='male': + info_for_yaml_dict['host']['host_sex'] = "http://purl.obolibrary.org/obo/PATO_0000384" + elif GBQualifier_value_text_list[1]=='female': + info_for_yaml_dict['host']['host_sex'] = "http://purl.obolibrary.org/obo/PATO_0000383" else: info_for_yaml_dict['host']['host_health_status'] = GBQualifier_value_text_list[1] |