diff --git a/README.md b/README.md index 210992d..f4a1d00 100644 --- a/README.md +++ b/README.md @@ -257,24 +257,24 @@ python run.py \ ``` ### 17 --chains_to_design -Specify which chains (e.g. "ABC") need to be redesigned, other chains will be kept fixed. Outputs in seqs/backbones will still have atoms/sequences for the whole input PDB. +Specify which chains (e.g. "A,B,C") need to be redesigned, other chains will be kept fixed. Outputs in seqs/backbones will still have atoms/sequences for the whole input PDB. ``` python run.py \ --model_type "ligand_mpnn" \ --seed 111 \ --pdb_path "./inputs/4GYT.pdb" \ --out_folder "./outputs/chains_to_design" \ - --chains_to_design "B" + --chains_to_design "A,B" ``` ### 18 --parse_these_chains_only -Parse and design only specified chains (e.g. "ABC"). Outputs will have only specified chains. +Parse and design only specified chains (e.g. "A,B,C"). Outputs will have only specified chains. ``` python run.py \ --model_type "ligand_mpnn" \ --seed 111 \ --pdb_path "./inputs/4GYT.pdb" \ --out_folder "./outputs/parse_these_chains_only" \ - --parse_these_chains_only "B" + --parse_these_chains_only "A,B" ``` ### 19 --model_type "ligand_mpnn" diff --git a/run.py b/run.py index 66a7843..badd56c 100644 --- a/run.py +++ b/run.py @@ -180,6 +180,12 @@ def main(args) -> None: device=device, ) + if len(args.parse_these_chains_only) != 0: + parse_these_chains_only_list = args.parse_these_chains_only.split(",") + else: + parse_these_chains_only_list = [] + + # loop over PDB paths for pdb in pdb_paths: if args.verbose: @@ -192,7 +198,7 @@ def main(args) -> None: protein_dict, backbone, other_atoms, icodes, _ = parse_PDB( pdb, device=device, - chains=args.parse_these_chains_only, + chains=parse_these_chains_only_list, parse_all_atoms=parse_all_atoms_flag, parse_atoms_with_zero_occupancy=args.parse_atoms_with_zero_occupancy, ) @@ -269,10 +275,11 @@ def main(args) -> None: protein_dict["membrane_per_residue_labels"] = ( args.global_transmembrane_label + 0 * fixed_positions ) - if type(args.chains_to_design) == str: + if len(args.chains_to_design) != 0: chains_to_design_list = args.chains_to_design.split(",") else: chains_to_design_list = protein_dict["chain_letters"] + chain_mask = torch.tensor( np.array( [ @@ -876,15 +883,15 @@ def main(args) -> None: argparser.add_argument( "--chains_to_design", type=str, - default=None, - help="Specify which chains to redesign, all others will be kept fixed.", + default="", + help="Specify which chains to redesign, all others will be kept fixed, 'A,B,C,F'", ) argparser.add_argument( "--parse_these_chains_only", type=str, default="", - help="Provide chains letters for parsing backbones, 'ABCF'", + help="Provide chains letters for parsing backbones, 'A,B,C,F'", ) argparser.add_argument( diff --git a/run_examples.sh b/run_examples.sh index 3a45db3..b507906 100644 --- a/run_examples.sh +++ b/run_examples.sh @@ -121,7 +121,7 @@ python run.py \ --seed 111 \ --pdb_path "./inputs/4GYT.pdb" \ --out_folder "./outputs/chains_to_design" \ - --chains_to_design "B" + --chains_to_design "A,B" #18 python run.py \ @@ -129,7 +129,7 @@ python run.py \ --seed 111 \ --pdb_path "./inputs/4GYT.pdb" \ --out_folder "./outputs/parse_these_chains_only" \ - --parse_these_chains_only "B" + --parse_these_chains_only "A,B" #19 python run.py \