-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCUMAb_pdb_format.py
executable file
·32 lines (25 loc) · 1.35 KB
/
CUMAb_pdb_format.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os
import shutil
import sys
from scripts.modules_args import parse_arguments, write_config_JSON
from scripts.modules_pdb_format import format_pdb_file
from scripts.modules_graft import find_interface_locs
CUMAb_dir = [x for x in sys.path if "CUMAb" in x.split("/")][0]
while CUMAb_dir.split("/")[-1] != "CUMAb":
CUMAb_dir = CUMAb_dir.split("/" + CUMAb_dir.split("/")[-1])[0]
def main():
#check required databases were downloaded and named properly
for family in ["IGHV", "IGKV", "IGHJ", "IGKJ", "IGLV", "IGLJ"]:
assert os.path.isfile(f"{CUMAb_dir}/IMGT_databases/{family}.fasta"), f"{family} database was not downloaded properly"
#parse arguments
pdb_file, mode, antigen_chain, screens, origin_species, res_to_fix = parse_arguments()
#find name of pdb_file, will be used throughout the run
pdb_name = pdb_file.split("/")[-1].split(".pdb")[0]
#write configuration to a JSON file
write_config_JSON(mode, antigen_chain, screens, origin_species, res_to_fix, pdb_file)
#format pdb file: light chain variable as chain A and heavy chain variable as chain B, with antigen chain as C if present
format_pdb_file(pdb_file, antigen_chain)
name = pdb_file.split("/")[-1].split(".")[0]
assert os.path.isfile(f"{name}_CUMAb_format.pdb"), "Pdb was not formatted properly"
if __name__ == '__main__':
main()