MExtract

MExtract[ hexpr , lev→patt ]
extracts from hexpr the sub-hexpr matching specifications of lev → patt.
MExtract[ hexpr , { lev1→patt1 , lev2→patt2, ... } ]
extracts from hexpr the sub-hexpr that match iteratively each specifications of { lev1 → patt1 , lev2 → patt2, ... }.
MExtract[ {hexpr1, hexpr2, ...} , lev → patt ]
extracts sub-hexpr matching specifications of lev → patt from each expression in {hexpr1, hexpr2, ...}.
MExtract[ {hexpr1, hexpr2, ...} , { lev1→patt1 , lev2→patt2, ... } ]
extracts from each expression in {hexpr1, hexpr2, ...} the sub-hexpr that match iteratively each specifications of { lev1 → patt1 , lev2 → patt2, ... }.
  • {hexpr1, hexpr2, ...} is a list of hierarchical expressions.
  • lev → patt is a level specific pattern.
  • lev can be every sub-level: "Model", "Chain", "Residue", "Atom".
  • patt is a pattern identified to values of the name and/or the index number of every hepxr. Strings will be evaluated as hexpr labels, and integers as hexpr index numbers. Respectively, labels and index numbers are stored in descriptors "Label" and "Id" of each hexpr.
  • Some pattern functions can be used in patt such as Except or Alternatives to build more complex patterns.
  • The type of the returned expressions is determined by the lower sub-level lev.
In[1]:=
Click for copyable input
Loads a sample model:
In[2]:=
Click for copyable input
Out[2]=
 
Extracts all residues "CYS" from model:
In[1]:=
Click for copyable input
 
Extracts all residues:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
 
Extracts the residue with index number 1:
In[1]:=
Click for copyable input
 
Extracts the residues with index number 1 or 143:
In[1]:=
Click for copyable input
 
Extracts the residues with index number 1 or the label "CYS":
In[1]:=
Click for copyable input
 
Extracts the residues with index number in the range [3-5]:
In[1]:=
Click for copyable input
 
Extracts the residues with index number in the range [3-5] or label "CYS" or "TRP":
In[1]:=
Click for copyable input
 
Extracts all the atoms with the label "CA" from all residues with index number 1:
In[1]:=
Click for copyable input
 
Extracts all the atoms with the label "CA" from all residues with label "CYS":
In[1]:=
Click for copyable input
 
Extracts all the atoms with the label "CYS" or "TRP" from all residues with index number in range [1,100]:
In[1]:=
Click for copyable input
 
Extracts all the atoms of the backbone of the fist chain:
In[1]:=
Click for copyable input
 
Extracts all the side-chain atoms of fist chain:
In[1]:=
Click for copyable input