-
Notifications
You must be signed in to change notification settings - Fork 119
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
Questions about using reduce2 as a standalone program #1011
Comments
|
Thanks so much for your prompt reply. This is very helpful. The example structure I was having issue with ion handling is PDB 1IEP: The other one was PDB 3KGD: I have changed my workflow, such that the models were desalted first. I wanted to do it with from pathlib import Path
from iotbx.data_manager import DataManager
dm = DataManager()
filename_pdb = "1iep.pdb"
dm.process_model_file(filename_pdb)
model = dm.get_model(filename=filename_pdb)
hierarchy = model.get_hierarchy()
print(hierarchy.composition()) will give
Then: # Manipulate the Model: Desalt and Keep Chain A by Default
def cleanup_model(model_in, keep_chains = ["A"], exclude_residues = [" NA", " CL"]):
model_out = model_in.deep_copy()
for m in model_out.get_hierarchy().models():
for chain in m.chains():
if chain.id in keep_chains:
for rg in chain.residue_groups():
for ag in rg.atom_groups():
if ag.resname in exclude_residues:
ag.parent().remove_atom_group(ag)
else:
chain.parent().remove_chain(chain)
return model_out
model_desalt = cleanup_model(model)
hierarchy = model_desalt.get_hierarchy()
print(hierarchy.composition()) This prints:
But this: current_path = Path().resolve()
output_filename = f"{current_path}/1iep_chainA_complex.pdb"
dm.write_model_file(model_desalt, filename=output_filename, format="pdb") Gives Segmentation fault. Could you please tell me what I'm doing wrong? Writing an unmodified model dm.write_model_file(model, filename=output_filename, format="pdb") worked fine for me I have a very clumsy way of manipulating the model (always do def cleanup_model(model_in, keep_chains = ["A"], exclude_residues = [" NA", " CL"]):
model_out = model_in.deep_copy()
for m in model_out.get_hierarchy().models():
for chain in m.chains():
if chain.id in keep_chains:
for rg in chain.residue_groups():
for ag in rg.atom_groups():
if ag.resname in exclude_residues:
for atom in ag.atoms():
ag.remove_atom(atom=atom)
else:
for rg in chain.residue_groups():
for ag in rg.atom_groups():
for atom in ag.atoms():
ag.remove_atom(atom=atom)
return model_out |
When I run 1iep.cif and 3kgd.cif using a Phenix build of CCTBX, the files run to completion. My suspicion is that the chem_data folders are not being properly linked in when doing a non-Phenix build. I'll build the system that way and see if I can repair the problem. I'm afraid that I won't be much help debugging iotbx workflows. I've spent almost all my time in the C++/Python linking world while developing Reduce2 and Probe2 and am not familiar with other parts of the system. Hopefully someone else will chime in. |
Okay, I've modified the bootstrap.py script in the master branch and built as follows: Then after running the setup script I can run (On Windows, you need to help it check out geostd by using a command prompt that knows about git and going into modules/chem_data/geostd and then doing: If this gets things working for you, go ahead and close the issue. Otherwise, let me know what went wrong. |
@rwxayheee , the cleanup you are trying to do is easier done with selections: Docs on this: |
As an alternative, you can also use the command line tool phenix.pdbtools (https://phenix-online.org/version_docs/dev-5239/reference/pdbtools.html) for selecting parts of a model. |
Hi @olegsobolev and @dcliebschner Hi @russell-taylor ! I very naively downloaded it from the geostd repository (https://github.com/phenix-project/geostd.git). The recent changes made me think it's up to date, but maybe I shouldn't download it this way. Here's a Colab notebook: In the Colab notebook, I downloaded geostd by: # Download CCP4 Monomer (restraint) Library
monlib_repo = "https://github.com/phenix-project/geostd.git"
! git clone {monlib_repo} Then to run reduce2, I did:
I will try the way you suggested, and let you know how it goes. Thanks again for your kind suggestion |
The mechanisms that the CCTBX setup script uses to configure various environment variables are a mystery to me. I do know that in the past I had to set both the MMTBX_CCP4_MONOMER_LIB (at geostd) and the CLIBD_MON (at mon_lib) environment variables to make things work. I don't have a deep understanding of the process, so I pretty much just follow my same recipe each time to get CCTBX environment:
Then I can run mmtbx.reduce2 in the command window. |
Hello @russell-taylor Thanks so much for your time and kind reply. My initial objective was to gather minimal data and dependencies to run reduce2 as a standalone, but I understand that the only proper way is to install the full assets. I will close the issue. Thanks everyone for your kind replies. If you're interested, I have a little bit more information on the original issue:
Yes, I learned this from some older tutorials of the cctbx project. I thought the two libraries were the only ones needed. But later I realized that for NA, CL (and maybe other monoatomic ions?), the chemical component library is necessary. I was able to pass by pointing the path in mmtbx/chemical_components/init.py to the path where I have a standalone chemical_components.
This is how far I can get at the moment (..but again I don't mind deleting these ions as long as they're not structural ;) |
Hi all,
Thank you for the excellent work. I have been using the original reduce to add hydrogens to protein structures, and I am eager to learn the new version. I have two quick questions about reduce2:
1. Handling of Ions
Is there a simple way to make an exclude list, to suppress the attempts to add hydrogens to ions and specific residues by names?
When ions (NA, CL, etc.) are encountered, the following message will be displayed and the program will exit.
Sorry: Restraints were not found for the following residues: NA
Is there an option to leave them alone, just like waters (HOH) are left unprotonated?
2. Unexpected Translation of Coordinates
Reduce2 moves (or re-centers?) a monomeric protein after hydrogen addition. This was not the default behavior of the original reduce. Here's an example:
Input PDB
1iep_chainA.pdb.txt
This is the chain A of protein extracted from PDB 1IEP. Original structure is a dimer. The input only has the atom coordinates (therefore it's missing certain specifications like CRYST1, SCALE, ...)
The output with original reduce
1iep_chainAH.original.pdb.txt
The output with reduce2
1iep_chainAH.reduce2.pdb.txt
Is there a way to keep the original position? The translation won't happen when the original CRYST1, SCALE cards are present in the input file. If CRYST1, SCALE cards are required but not present in PDB structures that have been manipulated (manually edited, combined, generated by other programs, etc.), how to generate the proper cards to avoid translation of coordinates?
Thank you for your time and kind advice in advance!
The text was updated successfully, but these errors were encountered: