Skip to content

Commit 5f42027

Browse files
committed
benchmarking and number of tempaltes
1 parent 75aab93 commit 5f42027

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

AFfine/predict_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def create_single_template_features(
398398
num_res_tmp = len(crs_tmp)
399399
template_full_sequence = ''.join(all_name1s_tmp[c][r] for c,r in crs_tmp)
400400
if expected_template_len:
401-
print(expected_template_len, template_full_sequence, num_res)
401+
#print(expected_template_len, template_full_sequence, num_res)
402402
assert len(template_full_sequence) == expected_template_len, (f'template name or row: {template_name} | '
403403
f'template_full_sequence: {template_full_sequence} |'
404404
f'expected_template_len: {expected_template_len}')

AFfine/run_prediction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@
106106
targets.shape[0], 'max_len=', crop_size)
107107

108108
sys.stdout.flush()
109-
print('###########DEBUG', args.model_names)
110109
model_runners = predict_utils.load_model_runners(
111110
args.model_names,
112111
crop_size,
@@ -161,6 +160,7 @@
161160
except:
162161
data = data.sample(frac=1).reset_index(drop=True)
163162
data = data.iloc[:int(num_templates)]
163+
print(f"AlphaFold long: Using {len(data)} templates")
164164

165165

166166
cols = ('template_pdbfile target_to_template_alignstring identities '

run_PMGen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def main():
140140

141141
#benchamark flags
142142
parser.add_argument('--benchmark', action='store_true', help='Enable benchmarking')
143-
parser.add_argument('--benchmark_similarity_threshold', type=float, default=1.0,
143+
parser.add_argument('--benchmark_similarity_threshold', type=float, default=100.0,
144144
help='When --benchmark is set, exclude templates with peptide-MHC (pMHC) sequence '
145145
'similarity above this fraction (0-1). pMHC similarity is the length-weighted '
146146
'average of MHC G-domain identity and peptide identity. Default: 1.0.') # added after review --> similarity benchmark

run_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,8 @@ def run_alphafold(self, input_file, output_prefix):
326326
"--model_names", *model_names.split(),
327327
"--model_params_files", *model_params_files.split(),
328328
"--ignore_identities",
329-
"--num_recycles", f"{self.num_recycles}"
329+
"--num_recycles", f"{self.num_recycles}",
330+
"--num_templates", f"{self.num_templates}"
330331
]
331332
if self.sampling_mode:
332333
command += ['--sampling_mode',
@@ -623,7 +624,8 @@ def run_wrapper_parallel(self, max_ram=3, max_cores=4, run_alphafold=True):
623624
runner = run_PMGen_modeling(peptide=row['peptide'], mhc_seq=row['mhc_seq'],
624625
mhc_type=row['mhc_type'], id=f"{row['id']}", output_dir=self.output_dir,
625626
anchors=anchors, mhc_allele=mhc_allele, predict_anchor=predict_anchor,
626-
num_templates=self.num_templates, num_recycles=self.num_recycles,
627+
num_templates=self.num_templates, best_n_templates=self.best_n_templates,
628+
num_recycles=self.num_recycles,
627629
models=self.models, alphafold_param_folder=self.alphafold_param_folder,
628630
fine_tuned_model_path=self.fine_tuned_model_path, no_modelling=self.no_modelling,
629631
return_all_outputs=self.return_all_outputs,

0 commit comments

Comments
 (0)