Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Error when altering stop_at_score parameter in Alphafold2_batch in Google Colab #634

Open
bry250 opened this issue Jul 11, 2024 · 0 comments

Comments

@bry250
Copy link

bry250 commented Jul 11, 2024

I have been using the AlphaFold2_batch.ipynb notebook within Google Colab to model protein complexes. It runs perfectly when I use it with the default settings or changing only the num_recycles parameter. Today I altered the stop_at_score parameter from 100 (the default) to 40 . The expected behaviour is that as soon as one of the recycles or models reaches this specified score, the job should terminate and move onto modelling the next complex. I have two issues:

  1. I get an error (see below). I think it might pertain to the fact that the stop_at_score parameter is read in as a string and not subsequently converted to a numeric datatype.
  2. It is unclear to me whether the correct metric is being compared to determine whether the stopping threshold has been reached (the notebook says it uses "ptmscore" for modelling complexes, but it isn't clear to me whether this is pTM, ipTM or 0.8 ipTM+0.2 pTM). It would be great if there was an option to specify which metric is being used. I'm particularly confused because it says here (https://github.com/sokrypton/ColabFold/wiki/v1.5.0) that stop_at_score operates on a scale of 0-100, whereas the pTM values are on a scale of 0 to 1. I assume some conversion must take place but it wasn't clear to me how/ where this was happening.

Regarding point (1), I get the following output and error:

2024-07-11 14:27:15,800 Running on GPU
2024-07-11 14:27:16,012 Found 5 citations for tools or databases
2024-07-11 14:27:16,013 Query 1/2: AT2G41110.1-IQD26 (length 538)
COMPLETE: 100%|██████████| 300/300 [elapsed: 00:01 remaining: 00:00]
COMPLETE: 100%|██████████| 300/300 [elapsed: 00:00 remaining: 00:00]
2024-07-11 14:28:52,090 alphafold2_multimer_v3_model_1_seed_000 recycle=0 pLDDT=36.5 pTM=0.284 ipTM=0.196
... (output of recycles 1-23) .....
2024-07-11 14:32:41,616 alphafold2_multimer_v3_model_1_seed_000 recycle=24 pLDDT=38.7 pTM=0.298 ipTM=0.202 tol=9.58
2024-07-11 14:32:41,617 alphafold2_multimer_v3_model_1_seed_000 took 312.6s (24 recycles)

UFuncTypeError Traceback (most recent call last)
in <cell line: 17>()
15
16 queries, is_complex = get_queries(input_dir)
---> 17 run(
18 queries=queries,
19 result_dir=result_dir,

1 frames
/content/colabfold/batch.py in run(queries, result_dir, num_models, is_complex, num_recycles, recycle_early_stop_tolerance, model_order, num_ensemble, model_type, msa_mode, use_templates, custom_template_path, num_relax, relax_max_iterations, relax_tolerance, relax_stiffness, relax_max_outer_iterations, keep_existing_results, rank_by, pair_mode, pairing_strategy, data_dir, host_url, user_agent, random_seed, num_seeds, recompile_padding, zip_results, prediction_callback, save_single_representations, save_pair_representations, jobname_prefix, save_all, save_recycles, use_dropout, use_gpu_relax, stop_at_score, dpi, max_seq, max_extra_seq, pdb_hit_file, local_pdb_path, use_cluster_profile, feature_dict_callback, **kwargs)
1579 first_job = False
1580
-> 1581 results = predict_structure(
1582 prefix=jobname,
1583 result_dir=result_dir,

/content/colabfold/batch.py in predict_structure(prefix, result_dir, feature_dict, is_complex, use_templates, sequences_lengths, pad_len, model_type, model_runner_and_params, num_relax, relax_max_iterations, relax_tolerance, relax_stiffness, relax_max_outer_iterations, rank_by, random_seed, num_seeds, stop_at_score, prediction_callback, use_gpu_relax, save_all, save_single_representations, save_pair_representations, save_recycles)
495
496 # early stop criteria fulfilled
--> 497 if mean_scores[-1] > stop_at_score: break
498
499 # early stop criteria fulfilled

UFuncTypeError: ufunc 'greater' did not contain a loop with signature matching types (<class 'numpy.dtypes.Float16DType'>, <class 'numpy.dtypes.StrDType'>) -> None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant