-
Notifications
You must be signed in to change notification settings - Fork 293
Allow to omit --ligand and --batch when writing maps. #383
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -328,8 +328,8 @@ Thank you!\n"; | |
| exit(EXIT_FAILURE); | ||
| } | ||
|
|
||
| if (!vm.count("ligand") && !vm.count("batch")) { | ||
| std::cerr << desc_simple << "\n\nERROR: Missing ligand(s).\n"; | ||
| if (!vm.count("ligand") && !vm.count("batch") && !vm.count("write_maps")) { | ||
| std::cerr << desc_simple << "\n\nERROR: Missing ligand(s) or --write_maps.\n"; | ||
| exit(EXIT_FAILURE); | ||
| } else if (vm.count("ligand") && vm.count("batch")) { | ||
| std::cerr << desc_simple << "\n\nERROR: Can't use both --ligand and --batch arguments simultaneously.\n"; | ||
|
|
@@ -408,10 +408,6 @@ Thank you!\n"; | |
| v.set_ad4_weights(weight_ad4_vdw, weight_ad4_hb, weight_ad4_elec, | ||
| weight_ad4_dsolv, weight_glue, weight_ad4_rot); | ||
| v.load_maps(maps); | ||
|
|
||
| // It works, but why would you do this?! | ||
| if (vm.count("write_maps")) | ||
| v.write_maps(out_maps); | ||
| } | ||
|
|
||
| if (vm.count("ligand")) { | ||
|
|
@@ -429,9 +425,6 @@ Thank you!\n"; | |
| } else { | ||
| v.compute_vina_maps(center_x, center_y, center_z, size_x, size_y, size_z, grid_spacing, force_even_voxels); | ||
| } | ||
|
|
||
| if (vm.count("write_maps")) | ||
| v.write_maps(out_maps); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -460,11 +453,8 @@ Thank you!\n"; | |
| if (vm.count("maps")) { | ||
| v.load_maps(maps); | ||
| } else { | ||
| // Will compute maps for all Vina atom types | ||
| v.compute_vina_maps(center_x, center_y, center_z, size_x, size_y, size_z, grid_spacing); | ||
|
|
||
| if (vm.count("write_maps")) | ||
| v.write_maps(out_maps); | ||
| // Batch mode is allowed only if not ad4? | ||
| v.compute_vina_maps(center_x, center_y, center_z, size_x, size_y, size_z, grid_spacing, force_even_voxels); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -529,6 +519,19 @@ Thank you!\n"; | |
| std::cout << "Failed to parse " << failed_ligand_parsing << " ligands.\n"; | ||
| } | ||
| } | ||
|
|
||
| if (vm.count("write_maps")) { | ||
| // Will compute maps only for Vina atom types in the ligand(s) | ||
| // In the case users ask for score and local only with the autobox arg, we compute the optimal box size for it/them. | ||
| if (vm.count("ligand") && autobox) { | ||
| v.set_ligand_from_file(ligand_names); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here when people have |
||
| std::vector<double> dim = v.grid_dimensions_from_ligand(buffer_size); | ||
| v.compute_vina_maps(dim[0], dim[1], dim[2], dim[3], dim[4], dim[5], grid_spacing, force_even_voxels); | ||
| } else { | ||
| v.compute_vina_maps(center_x, center_y, center_z, size_x, size_y, size_z, grid_spacing, force_even_voxels); | ||
| } | ||
| v.write_maps(out_maps); | ||
| } | ||
| } | ||
|
|
||
| catch(pdbqt_parse_error& e) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I think batch mode is allowed with ad4. It will go to the
if (vm.count("maps")) { v.load_maps(maps); }condition just a little above this. You can run a test and tell us if it's broken. The only difference is: with ad4, we will provide the maps beforehand, instead of asking it to compute the maps. Since you suggested that theread mapsflag should not coexist withwrite mapsflag, there will be no usage case ofwrite mapsfor ad4. See this tutorial for the expected procedure: https://autodock-vina.readthedocs.io/en/latest/docking_basic.html#a-using-autodock4-forcefield