On 04/12/2024 15:01, Joel Meyerson wrote:
CAUTION: This email originated from outside of the LMB:
[email protected].
Do not click links or open attachments unless you recognize the sender and know
the content is safe.
If you think this is a phishing email, please forward it to
[email protected]
--
Hi,
I would like to use the Coot Python interface to refine a model to a cryoEM
map. I'm able to view all of the functions available in the coot module, and I
see that a model and map can be loaded, and output written, as follows:
#script.py
import coot
coot.read_pdb(filename="model.pdb")
coot.read_ccp4_map(filename="map.mrc", is_diff_map_flag=False)
# Refinement steps here
coot.write_pdb_file(imol=0, file_name="out.pdb")
exit()
# Running the script:
coot --no-graphics --script ./script.py
However, I'm unsure of which functions should be called to do refinements. For
example, it would be helpful to know how to refine individual residues, residue
ranges, full chains, or full molecules. Can you assist?
There are two options
(i) Using Coot as you are doing and (ii) using Python with chapi:
https://www.mrc-lmb.cam.ac.uk/lucrezia/libcootapi-documentation/
For the former
import coot
imol = coot.read_pdb("tutorial-modern-coot-0.pdb")
imol_map = coot.read_mtz("rnasa-1.8-all_refmac1.mtz", "FWT", "PHWT",
"W", 0, 0)
residues = []
for i in range(20, 31):
residues.append(["A", i, ""])
coot.set_imol_refinement_map(imol_map)
coot.set_refinement_immediate_replacement(1)
coot.refine_residues_py(imol, residues)
coot.accept_regularizement()
coot.write_pdb_file("refined.pdb")
For the latter - maybe more useful if you are also hooking up some other
python module beasties:
import chapi
coot = chapi.molecules_container_t(True)
coot.set_max_number_of_threads(8)
imol = coot.read_pdb('tutorial-modern.pdb')
imol_map = coot.read_mtz('rnasa-1.8-all_refmac1.mtz', 'FWT', 'PHWT',
'W', False, False)
coot.set_imol_refinement_map(imol_map)
coot.refine_residue_range(imol, 'A', 20, 30, 1000)
coot.write_coordinates(imol, "refined.pdb")
########################################################################
To unsubscribe from the COOT list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=COOT&A=1
This message was issued to members of www.jiscmail.ac.uk/COOT, a mailing list
hosted by www.jiscmail.ac.uk, terms & conditions are available at
https://www.jiscmail.ac.uk/policyandsecurity/