From: Thomas H. <tho...@sc...> - 2017-06-12 16:10:45
|
Hi Julian, A one-liner to create chain selections looks like this: for c in cmd.get_chains(): cmd.select("chain_" + c, "chain " + c) PyMOL doesn't provide access to the PDB header fields. In principle PyMOL provides a way to access everything inside mmCIF files, see: https://pymolwiki.org/index.php/Cif_keepinmemory However, instead of doing this, I recommend to use the PDBe web API which provides the data in a friendly JSON data structure. I've attached a Python script which creates molecule (or chain) selections for 5n61 as an example. I recommend to load PDB structures from mmCIF or MMTF format, which not only have chain identifiers, but also molecule identifiers ("segi" field in PyMOL). Hope that helps. Cheers, Thomas > On Jun 12, 2017, at 12:21 PM, Julian Reitz <jul...@gm...> wrote: > > Dear all, > > I have a pdb-file with multiple chains (5N61). > > Is there an easy way to create selections for all the chains that are defined in the pdb-header (A to U) without doing it manually for every chain (select A, chain A)? > Is it also possible to use the MOLECULE information from the header to name the selections? > > Thank you in advance, > > Julian -- Thomas Holder PyMOL Principal Developer Schrödinger, Inc. |