Skip to content

LigandDiscoverySearch Additional Features - #779

Open
toadlover wants to merge 54 commits into
RosettaCommons:mainfrom
toadlover:main
Open

toadlover wants to merge 54 commits into
RosettaCommons:mainfrom
toadlover:main

Conversation

@toadlover

Copy link
Copy Markdown
Member

Creating update to the REAL-M LigandDiscoverySearch protocol to include the following new features:

  • Dock a ligand with 2 motifs (dock with 1 motif and then force the original dock to have at least one motif with another pocket residue before screening)
  • New MotifCloud object to effectively create clouds of motifs around desired residues that provide a 3D heatmap of atom type density. Possible new usage for a new docking method
  • Creation of an "on-ramp" into the LigandDiscoverySearch discover() function for systems with a ligand docked against it so that the scoring, motif collection/determination, and highresdock can be applied to an existing system.

This first post is preliminary so that I can start to confirm that this build passes integration tests as I work on it.

 list. Adding supporting functions to get, set, and add positions to the
 vector list. Setting up code block in discover() to iterate over all
 secondary positions with logic to kill placement if we do not identify
 a secondary motif
in a library into its own function so it can be more naturally used in
future functionality
the gate on hashing the motif library map, as now we will also hash it
if we do the double motifs method.
method. Also adding functionality to print out the empty input PDB with
Rosetta indexing for anchor/secondary anchor residue recognition
written to write both the native pdb indexing and the rosetta indexing
without reference was really bad for runtime
avoids scoring. New function is: placed_ligand_forms_library_motif_fast.
Adjusting code in LDS to use this new function, where now we iterate
over all potential secondary residues.
that it can still be treated as constant with no means to try to change
the map
the placement ligand is within estimated interaction range of any
secondary residue
handle the case where the minipose has no residues
proteingrid so we don't segfauly. Extremely relevant for if we project a
grid around a part of a protein (i.e. secondary residue minipose from
liganddiscoverysearch) and see if a placed ligand is within the residue
set's interaction range
toadlover and others added 7 commits May 12, 2026 12:57
lj atom projections would otherwise project beyond the grid (very
possible in cases where there is only like 1 secondary motif residue in
the grid, and the grid is defined by the single residue atom centers)
space fill and secondary motif docking, since the scoring should be a
little faster and more likely to kill bad placements
into motif_utils, where it probably should have been living this whole
time. Code from LDS for this is commented out, not deleted (at least for
now)
motifs.cc/hh to project atoms and get the atom coordinates themselves
…ng protein ligand systems to be run through the LigandDiscoverySearch docking evaluation part of the discover() protocol
@toadlover toadlover added 01 unit 02 integration 00 build Queue related test set on RosettaCommons Benchmark system labels Oct 22, 2026

@roccomoretti roccomoretti left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the tests are running well, it looks fine. There's some stylistic issues I made comments on, but not necessarily anything critical.

ms_tr.Error << "input_ligand_start_step requires input_ligand_residue." << std::endl;
return -1;
}
if ( !use_input_ligand && option[ OptionKeys::motifs::input_ligand_skip_highresdock ].user() ) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For bools, just check the value() instead of checking for user() -- You can explicitly pass -input_ligand_skip_highresdock false on the command line, and that would result in user() returning true but value() (or implicit conversion) returning false.

user() should be reserved for complex use cases where you're varying the behavior on whether or not the user specified the option (regardless of value), not simply to determine if the value is the default one or not. (This applies even for non-bool options. If the no-option behavior can be represented by a value passed to the option, just rely on the default value of the option vs. using user())

}

//function to define the vector of residue indices that we will use for docking with a second motif. If the vector has contents, we will use it.
void LigandDiscoverySearch::set_secondary_working_positions(utility::vector1<core::Size> secondary_working_position)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: Probably good practice to pass the vector by const &, otherwise you're (potentially) making a pointless copy for the pass-by-value.


// @brief function used to make a minipose (focused pose around placed ligand to get quicker scoring of metrics like fa_atr and fa_rep)
//if returns true, a minipose was successfully made; if returns false, minipose is still empty because no other residues were recruited to it
void LigandDiscoverySearch::make_secondary_minipose(core::pose::PoseOP & minipose, const core::Size exclude_working_residue)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: If you're just accessing the underlying object (versus storing a copy of the OP), it's probably best to pass the object itself by reference, rather than passing an OP.

{
ms_tr.Debug << "Building Secondary Minipose made of residue indices: ";

for ( core::Size resi_pos = 1; resi_pos <= secondary_working_positions_.size(); ++resi_pos ) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: If the only thing you're using the index for is to access the corresponding value, you're probably better off just using the range-for syntax.


//function to get a sub-library of motifs from the main library, based on the residue being used (only get for select residue)
//function may have use outside discover, so public can use it
/*

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend cleaning up commented-out code prior to merging. (It will be available in the git history.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

00 build Queue related test set on RosettaCommons Benchmark system 01 unit 02 integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants