Get chains: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
(Created page with '= Overview = This command will return a python list of chains for the given selection. Proteins structures often have more than one chain of residues present in a structure file...')
 
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Overview =
 
This command will return a python list of chains for the given selection.
This command will return a python list of chains for the given selection.


Line 23: Line 23:


= See Also =
= See Also =
[[Get_names]]
[[Get_Names]]


[Category:Commands]]
[[Category:Commands|Get chains]]

Latest revision as of 13:36, 17 November 2009

This command will return a python list of chains for the given selection.

Proteins structures often have more than one chain of residues present in a structure file. This command will fetch the names of each chain present. Because of the lack of standards, sometimes chain A will also be blank "". This isn't a problem for PyMOL, but be warned sometimes you may get back, [""].

Syntax

# using get_chains for the object or selection called objSel
get_chains objSel

Examples

# examples
fetch 1cll
print "1CLL has the following chains:", cmd.get_chains("1cll")

# list all chains in all proteins loaded in PyMOL:
for x in cmd.get_names():
  for ch in cmd.get_chains(x):
    print x, " has chain ", ch

See Also

Get_Names