Get Model: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
PedroLacerda (talk | contribs) No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
'''get_model''' returns a model object. | '''get_model''' returns a model object. | ||
Line 15: | Line 15: | ||
atoms = cmd.get_model("chain A") | atoms = cmd.get_model("chain A") | ||
for at in atoms.atom: | for at in atoms.atom: | ||
print "ATOM DEFINITION: "+at.chain+" "\ | print("ATOM DEFINITION: "+at.model+" "\ | ||
+at.chain+" "\ | |||
+at.resn+" "\ | +at.resn+" "\ | ||
+str(at.resi)+" "\ | +str(at.resi)+" "\ | ||
+at.name+" "\ | +at.name+" "\ | ||
+str(at.index)+" "\ | +str(at.index)+" "\ | ||
+at.b | +"%.2f " % (at.b)\ | ||
+str(at.coord[0])+" "\ | +str(at.coord[0])+" "\ | ||
+str(at.coord[1])+" "\ | +str(at.coord[1])+" "\ | ||
+str(at.coord[2]) | +str(at.coord[2])) | ||
</source> | </source> | ||
===SEE ALSO=== | ===SEE ALSO=== | ||
[[Category:Commands|Get Model]] | [[Category:Commands|Get Model]] |
Latest revision as of 13:04, 9 August 2024
get_model returns a model object.
PYMOL API
cmd.get_model(string "selection", integer "state" )
USAGE
cmd.get_model("chain A")
NOTES
It can be useful to loop through all the atoms of a selection (rather than using the iterate command)
atoms = cmd.get_model("chain A")
for at in atoms.atom:
print("ATOM DEFINITION: "+at.model+" "\
+at.chain+" "\
+at.resn+" "\
+str(at.resi)+" "\
+at.name+" "\
+str(at.index)+" "\
+"%.2f " % (at.b)\
+str(at.coord[0])+" "\
+str(at.coord[1])+" "\
+str(at.coord[2]))