RoseTTAFold-All-Atom/rf2aa/data/preprocessing.py

36 lines
1.1 KiB
Python
Raw Normal View History

2024-03-05 06:38:17 +00:00
import os
from hydra import initialize, compose
from pathlib import Path
import subprocess
#from rf2aa.run_inference import ModelRunner
def make_msa(
fasta_file,
2024-03-06 00:45:27 +00:00
chain,
2024-03-05 06:38:17 +00:00
model_runner
):
out_dir_base = Path(model_runner.config.output_path)
hash = model_runner.config.job_name
2024-03-06 00:45:27 +00:00
out_dir = out_dir_base / hash / chain
2024-03-05 06:38:17 +00:00
out_dir.mkdir(parents=True, exist_ok=True)
command = model_runner.config.database_params.command
search_base = model_runner.config.database_params.sequencedb
num_cpus = model_runner.config.database_params.num_cpus
ram_gb = model_runner.config.database_params.mem
template_database = model_runner.config.database_params.hhdb
out_a3m = out_dir / "t000_.msa0.a3m"
out_atab = out_dir / "t000_.atab"
out_hhr = out_dir / "t000_.hhr"
if out_a3m.exists() and out_atab.exists() and out_hhr.exists():
return out_a3m, out_hhr, out_atab
search_command = f"./{command} {fasta_file} {out_dir} {num_cpus} {ram_gb} {search_base} {template_database}"
print(search_command)
_ = subprocess.run(search_command, shell=True)
return out_a3m, out_hhr, out_atab