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

New qfit ligand #426

Merged
merged 35 commits into from May 15, 2024
Merged

New qfit ligand #426

merged 35 commits into from May 15, 2024

Conversation

jessicaflowers
Copy link
Collaborator

@jessicaflowers jessicaflowers commented Apr 29, 2024

Pull Request Checklist

  • Will your PR merge into the dev branch?
    Exceptions will be made for urgent bugfixes.
  • Have you forked from dev?
    If not, please rebase your PR onto the most recent dev tip.
  • Does your PR title succinctly describe the changes?
    Explain to a new user by completing the sentence: 'This PR will: ...'
  • Fill out the template below.

Description of the Change

The updated ligand sampling in qFit replaces the previous local_search() and internal_dof() methods with multiple conformer generation functions using RDKit. Now, users must provide a SMILES string (--smiles) along with the model, map, labels, and selection to run qFit. There is an option to specify the number of conformers to generate (--numConf), defaulting to 10,000. Additionally, there's an optional flag to enable MIQP solvers with BIC (--ligand_bic), which is set to false by default.

Our algorithm processes the input ligand through 3 to 6 conformer generation functions, depending on the ligand's structure. These include unconstrained, terminal atom constrained, and spherically constrained conformer generation. If the ligand features a side chain, a branching search is also conducted. For side chains longer than 30 atoms, a long chain search is performed. Conformers from these processes are pooled together, QP scored, and then subjected to further sampling through rotation and translation. The total number of conformers generated is distributed equally among the utilized functions. For example, if no side chains are present and only three functions are used prior to rotation and translation, each function would generate approximately 3,333 conformers out of a total of 10,000.

Release Notes

Replace the existing ligand sampling strategy with several conformer generation functions using RDKit.


add rdkit and biopython to requirements.txt
add rdkit and biopython
add rdkit and biopython
add smiles and num conf arguments
@stephaniewankowicz
Copy link
Collaborator

Things to add:

  1. README- provide instructions on how to run. Also suggest how user should generate SMILES.
  2. Examples folder - provide instructions on how to run.
  3. please provide a default for --numConf.
  4. Put in a fail message if qFit ligand input argument does not contain SMILES string.
  5. Delete old qFit ligand code (a lot of this is only commented out).

jessicaflowers and others added 17 commits April 29, 2024 12:06
write ligand to pdb file
read in ligand pdb file
add default --numconf
fix innit
we are now generating the ligand pdb file using qFit, so biopython is no longer a dependency
we are now generating the ligand pdb file using qFit, so biopython is no longer a dependency
we are now generating the ligand pdb file using qFit, so biopython is no longer a dependency
remove biopython from the import statement, since we are no longer using it to generate the ligand pdb file
…d.py

qfit started to fail the Build & run tests (3.9, macos-latest) check after I added the block of code in prepare_qfit_ligand() to save a ligand pdb file to the working directory. I added a try/except OSError to hopefully resolve this problem
Add the post-qfit ligand refinement script to this branch
PR is failing tests after I added qfit_final_refine_ligand.sh to the branch. Try adding the path here in scripts=[ ]
Add basic instructions for how to run qfit-ligand to the README
move ligand stuff below cryo EM
Update the description of how to use qfit-ligand to add the new arguments (smiles, numconfs)
remove old qfit ligand code in __init__
merge conflicts not working well.
@stephaniewankowicz
Copy link
Collaborator

refinement script:

  1. why do we need ligand only file?
  2. Let's output: The output can be found at ${pdb_name}_qFit_ligand.(pdb|mtz|log).
  3. remove: redistribute_cull_low_occupancies -occ 0.09 "${pdb_name}_002.pdb"
    mv -v "${pdb_name}_002_norm.pdb" "${pdb_name}_002.pdb"
  4. rename final refinement -> Refinement (as this is the only refinement we are doing)
  5. Make sure all of this goes to the appropriate params (you are refining with final_refine.params)

"refinement.input.xray_data.r_free_flags.label=${field}" >> ${pdb_name}_refine.params
echo "refinement.input.xray_data.r_free_flags.generate=${gen_Rfree}" >> ${pdb_name}_refine.params

  1. remove or put in params file (but this will duplicate lines if 5 is worked out):
    "refinement.input.xray_data.r_free_flags.generate=True"
    "refinement.input.xray_data.labels=${xray_data_labels}" \

jessicaflowers and others added 2 commits May 1, 2024 10:17
remove redistribute_cull_low_occupancies after refinement, rename final_refine.params to refine.params, make sure all information is written to this file
@stephaniewankowicz
Copy link
Collaborator

In qFit.py:

This looks like it is hardcoded. If people need to have ligand.pdb specify that, but I think it should be able to read in any PDB as long as it is labeled correctly with args.

Read in ligand pdb file

self.ligand_pdb_file = "ligand.pdb"

put this print into logger info with details over which search it is.
if mol.GetNumConformers() == 0:
print("NO CONF GENERATED")

jessicaflowers and others added 7 commits May 2, 2024 08:12
Add optional fags for rotation/translation range and step size
add rot/trans optional flags
remove arguments that were used in the old ligand code
add logger errors if conformer generation functions fail to generate conformers
mol.GetNumConformers fixed to mol_copy.GetNumConformers
@stephaniewankowicz stephaniewankowicz merged commit 2216f61 into dev May 15, 2024
6 checks passed
@stephaniewankowicz stephaniewankowicz deleted the new_qfit_ligand branch May 15, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants