{"id":350,"date":"2019-07-12T17:10:38","date_gmt":"2019-07-12T17:10:38","guid":{"rendered":"https:\/\/ccsb.scripps.edu\/mgltools\/?page_id=350"},"modified":"2019-07-12T17:51:32","modified_gmt":"2019-07-12T17:51:32","slug":"doc-156-selection-strings","status":"publish","type":"page","link":"https:\/\/ccsb.scripps.edu\/mgltools\/doc-156-selection-strings\/","title":{"rendered":"doc 156 selection strings"},"content":{"rendered":"<h2>Selection Strings<\/h2>\n<p>Among the various ways molecular fragments can be selected in Pmv, selection strings are one of the most powerful selection mechanisms.<\/p>\n<p>Pmv stores molecules in a hierarchical data structure with 4 levels: Molecules contains Chains, made of Residues, containing Atoms. A Pmv selection string is a \u201c:\u201d separated set of 1 to 4 expressions where the first expression will select one of more molecules, the second expression if present will select chains among these molecules, the 3<sup>rd<\/sup> expression will select residues in these chains, and finally the 4<sup>th<\/sup> expression if present will select atoms in the previously selected residues. The result of such a selection will be a set of Molecules, Chains, Residues, or Atoms depending on the number of expressions.<\/p>\n<p>Mol selector [: [Chain selector] [: [Residue selector] [: [Atom selector]]]]<\/p>\n<p>Multiple selection strings can be used when separated by a \u2018;\u2019.<\/p>\n<h3>Expressions syntax<\/h3>\n<p>Expressions can be strings, sometime numbers or ranges of numbers, or lambda expressions (i.e. a Python function with no name).<\/p>\n<p>An <strong>empty string selects everything<\/strong>. For example:<\/p>\n<p>\u201c:::\u201d will select all Atoms in all Residues in all Chains in all Molecules in Pmv<\/p>\n<p>\u201cMol1::\u201d will select all Residues in all Chains in molecule Mol1<\/p>\n<p>\u201cMol2:B::\u201d will select all atoms in Chain B in molecule Mol2<\/p>\n<p>A <strong>comma-separated list<\/strong> of items can be used in an expression. For instance:<\/p>\n<p>\u201cMol1, Mol2:::C,N,CA,O\u201d selects backbone heavy atoms in molecules Mol1 and Mol2<\/p>\n<p>A <strong>Range<\/strong> can be specified using the \u2018-\u2018 character.<\/p>\n<p>\u201c::ALA35-THR45\u201d selects a range of residues<\/p>\n<p>\u201c1CRN-2PLV\u201d selects all molecules in the list of molecules loaded in Pmv starting at and including 1CRN and ending and including 2PLV. This will only work if 1CRN was loaded before 2PLV. Else an empty is returned.<\/p>\n<p>Expressions can contain <strong>common regular expressions<\/strong> such as \u2018.\u2019 to match any single character, \u2018*\u2019 to match any number of any character, and [1235] to match the numbers 1 through five in a single position.<\/p>\n<p>\u201c::..N*\u201d selects all Residues with the third letter in its name being an N followed by any string<\/p>\n<p>\u201c::\u2026[23].\u201d Selects all Residues with names made of exactly 5 characters and where the 4<sup>th<\/sup> character is either 2 or 3<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Relative positions<\/strong> in a list can be indicated by using the \u201c#\u201d symbol in front of a number.<\/p>\n<p>\u201c#2,#5\u201d selects the 2<sup>rd<\/sup> and 5<sup>th<\/sup> molecule<\/p>\n<p>\u201cMol1:C:#1-#5\u201d selects the first 5 Residues in Chain C or molecule Mol1<\/p>\n<p>Names of <strong>predefined sets<\/strong> can also be used in expressions. Names will be matched at the level of the elements they contain. A list of standard predefined set names is available <a href=\"https:\/\/ccsb.scripps.edu\/mgltools\/doc-156-predefined-sets\/\">here<\/a>. Sets defined by the user will be matched as well.<\/p>\n<h3>Molecule selectors:<\/h3>\n<p>Molecular selectors match the expression against the molecule names. They support regular expressions, relative indices, lists and ranges.<\/p>\n<h3>Chain selectors:<\/h3>\n<p>Chain selectors match the expression against the chain\u2019s id. They support regular expressions, relative indices, lists and ranges.<\/p>\n<h3>Residue selectors:<\/h3>\n<p>Residue selectors usually match the expression against the Residue name, which is a concatenation of the 3-letter Residue type (e.g. ALA, TYR, etc) and the Residue number from the PDB file (e.g. 3, 4A, etc.). One letter amino acid code can also be used (available <a href=\"https:\/\/ccsb.scripps.edu\/mgltools\/doc-156-predefined-sets\/\">here<\/a>). Regular expressions, relative indices, lists, and ranges are supported.<\/p>\n<h3>Atom selectors:<\/h3>\n<p>Atom selectors match the expression against the atom name. Regular expressions, relative indices, lists, and ranges are supported.<\/p>\n<h3>Where to use selection strings:<\/h3>\n<p>Selection strings can be used in the select from String command, which is accessible through the select menu.<\/p>\n<p><img decoding=\"async\" width=\"249\" height=\"217\" class=\"wp-image-427\" src=\"https:\/\/ccsb.scripps.edu\/mgltools\/wp-content\/uploads\/sites\/42\/2019\/07\/screen-shot-2011-03-17-at-10-12-21-am-png.png\" alt=\"Screen shot 2011-03-17 at 10.12.21 AM.png\" srcset=\"https:\/\/ccsb.scripps.edu\/mgltools\/wp-content\/uploads\/sites\/42\/2019\/07\/screen-shot-2011-03-17-at-10-12-21-am-png-200x174.png 200w, https:\/\/ccsb.scripps.edu\/mgltools\/wp-content\/uploads\/sites\/42\/2019\/07\/screen-shot-2011-03-17-at-10-12-21-am-png.png 249w\" sizes=\"(max-width: 249px) 100vw, 249px\" \/><\/p>\n<p><img decoding=\"async\" class=\"wp-image-428\" src=\"https:\/\/ccsb.scripps.edu\/mgltools\/wp-content\/uploads\/sites\/42\/2019\/07\/macintosh-hdusersmicheldesktopscreen-shot-2011-58.png\" alt=\"Macintosh HD:Users:michel:Desktop:Screen shot 2011-03-17 at 10.14.11 AM.png\" width=\"348\" height=\"223\" srcset=\"https:\/\/ccsb.scripps.edu\/mgltools\/wp-content\/uploads\/sites\/42\/2019\/07\/macintosh-hdusersmicheldesktopscreen-shot-2011-58-200x128.png 200w, https:\/\/ccsb.scripps.edu\/mgltools\/wp-content\/uploads\/sites\/42\/2019\/07\/macintosh-hdusersmicheldesktopscreen-shot-2011-58-300x192.png 300w, https:\/\/ccsb.scripps.edu\/mgltools\/wp-content\/uploads\/sites\/42\/2019\/07\/macintosh-hdusersmicheldesktopscreen-shot-2011-58-400x256.png 400w, https:\/\/ccsb.scripps.edu\/mgltools\/wp-content\/uploads\/sites\/42\/2019\/07\/macintosh-hdusersmicheldesktopscreen-shot-2011-58-460x295.png 460w, https:\/\/ccsb.scripps.edu\/mgltools\/wp-content\/uploads\/sites\/42\/2019\/07\/macintosh-hdusersmicheldesktopscreen-shot-2011-58.png 491w\" sizes=\"(max-width: 348px) 100vw, 348px\" \/><\/p>\n<p>or through the <a href=\"https:\/\/ccsb.scripps.edu\/mgltools\/doc-156-dashboard\/\">dashboard<\/a> using the Sel. Entry field:<\/p>\n<p><img decoding=\"async\" width=\"304\" height=\"83\" class=\"wp-image-429\" src=\"https:\/\/ccsb.scripps.edu\/mgltools\/wp-content\/uploads\/sites\/42\/2019\/07\/macintosh-hdusersmicheldesktopscreen-shot-2011-59.png\" alt=\"Macintosh HD:Users:michel:Desktop:Screen shot 2011-03-17 at 10.15.38 AM.png\" srcset=\"https:\/\/ccsb.scripps.edu\/mgltools\/wp-content\/uploads\/sites\/42\/2019\/07\/macintosh-hdusersmicheldesktopscreen-shot-2011-59-200x55.png 200w, https:\/\/ccsb.scripps.edu\/mgltools\/wp-content\/uploads\/sites\/42\/2019\/07\/macintosh-hdusersmicheldesktopscreen-shot-2011-59-300x83.png 300w, https:\/\/ccsb.scripps.edu\/mgltools\/wp-content\/uploads\/sites\/42\/2019\/07\/macintosh-hdusersmicheldesktopscreen-shot-2011-59.png 304w\" sizes=\"(max-width: 304px) 100vw, 304px\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Selection Strings Among the various ways molecular fragments can be  [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-350","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ccsb.scripps.edu\/mgltools\/wp-json\/wp\/v2\/pages\/350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ccsb.scripps.edu\/mgltools\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ccsb.scripps.edu\/mgltools\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ccsb.scripps.edu\/mgltools\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ccsb.scripps.edu\/mgltools\/wp-json\/wp\/v2\/comments?post=350"}],"version-history":[{"count":4,"href":"https:\/\/ccsb.scripps.edu\/mgltools\/wp-json\/wp\/v2\/pages\/350\/revisions"}],"predecessor-version":[{"id":432,"href":"https:\/\/ccsb.scripps.edu\/mgltools\/wp-json\/wp\/v2\/pages\/350\/revisions\/432"}],"wp:attachment":[{"href":"https:\/\/ccsb.scripps.edu\/mgltools\/wp-json\/wp\/v2\/media?parent=350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}