From d5bf17e594999fa5e96ea9d5c0e5657264895c8c Mon Sep 17 00:00:00 2001 From: Waikit Chan <37867949+BaozCWJ@users.noreply.github.com> Date: Wed, 7 Sep 2022 17:34:16 +0800 Subject: [PATCH] change the definition of target name, which will directly depends on fasta file (#42) --- run_unifold.sh | 6 +++--- unifold/homo_search.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/run_unifold.sh b/run_unifold.sh index 5ac736f..c9a6ef3 100644 --- a/run_unifold.sh +++ b/run_unifold.sh @@ -14,15 +14,15 @@ python unifold/homo_search.py \ --mgnify_database_path=$database_dir/mgnify/mgy_clusters_2018_12.fa \ --bfd_database_path=$database_dir/bfd/bfd_metaclust_clu_complete_id30_c90_final_seq.sorted_opt \ --uniclust30_database_path=$database_dir/uniclust30/uniclust30_2018_08/uniclust30_2018_08 \ - --uniprot_database_path=$database_dir/uniprot_db/uniprot_220501/uniprot_trembl.fasta \ + --uniprot_database_path=$database_dir/uniprot/uniprot.fasta \ --pdb_seqres_database_path=$database_dir/pdb_seqres/pdb_seqres.txt \ --template_mmcif_dir=$database_dir/pdb_mmcif/mmcif_files \ --obsolete_pdbs_path=$database_dir/pdb_mmcif/obsolete.dat \ --use_precomputed_msas=True echo "Starting prediction..." -fasta_dir=$(dirname $fasta_path) -target_name=${fasta_dir##*/} +fasta_file=$(basename $fasta_path) +target_name=${fasta_file%.fa*} python unifold/inference.py \ --model_name=$model_name \ --param_path=$param_path \ diff --git a/unifold/homo_search.py b/unifold/homo_search.py index 129da86..0c7b499 100644 --- a/unifold/homo_search.py +++ b/unifold/homo_search.py @@ -17,6 +17,7 @@ import json import os import pickle +from pathlib import Path import shutil import time import gzip @@ -261,7 +262,7 @@ def main(argv): ) fasta_path = FLAGS.fasta_path - fasta_name = FLAGS.fasta_path.split("/")[-2] + fasta_name = Path(fasta_path).stem input_fasta_str = open(fasta_path).read() input_seqs, input_descs = parsers.parse_fasta(input_fasta_str) if len(input_seqs) > 1: