Jump to content

How to's: Difference between revisions

From WebChemistry Wiki
No edit summary
No edit summary
 
Line 1: Line 1:
== Introduction ==
== SiteBinder ==


MotiveQuery is a subset of the Python programming language. Therefore, if you have experience with it, it should not be a problem to use MQ as well.
=== Select all structures that have exactly one C<sub>5</sub>O ring ===


* The language is case sensitive - "filter" is NOT the same as "FiLtEr".
Enter <code>Current().Count(Rings(5 * ["C"] + ["O"])) == 1</code> into the Structure Selection panel.


Some of the functions return '''<code>Motives</code>''' while other only '''<code>Motive</code>'''.
Explanation:
* '''<code>Motive</code>''' is a set of atoms.
* '''<code>Motives</code>''' is a sequence of '''<code>Motive</code>''' (the sets of atoms).


When a molecule is queried, say using the expression <code>Rings(5 * ["C"] + ["O"])</code> a sequences of motives each containing 6 atoms (5 C and 1 O) is returned. However, some functions such as <code>Filter</code> need to operate on a single motive (the set of atoms) - not the whole sequences. The query <code>Filter(Residues(), lambda r: r.Count(Atoms()) > 10)</code> first finds all residue '''<code>Motives</code>''' (sequence) and then passes every single '''<code>Motive</code>''' (set of atoms) to a function that counts the atoms in the motive and returns True if there is at least 11 of them. This is the reasoning behind these two types.
# <code>Current()</code> returns the structure being tested.
# <code>Count()</code> function counts occurrences of a specific motif.
# <code>Rings(5 * ["C"] + ["O"])</code> is a "Python" shortcut for <code>Rings(["C", "C", "C", "C", "C", "O"])</code> which represents a ring with 5 C and 1 O atoms.
# <code> == 1</code> checks for equality. Other relation operators can be used as well ( &gt;, &gt;=, &lt;, &lt;=, !=).


== Using MotiveQuery in Silverlight applications ==
=== Select all structures that satisfy multiple conditions ===


MotiveQuery can be used in SiteBinder, EEM Charges, and MotiveExplorer from the the corresponding UI elements. Moreover, it is possible to use MQ from the Scripting window. This is achieved using the <code>MQ.Execute</code> function. The function takes two parameters: the query and an optional target structure list.
In the Structure Selection panel use the expression <code>(c1) & (c2)</code>. For example, all structures that contain more than one C<sub>5</sub>O ring and no more than 3 ASP residues is represented by the expression <code>(Current().Count(Rings(5 * ["C"] + ["O"])) > 1) & (Current().Count(Residues("HIS")) <= 3)</code>. Due to the associativity rules of the operator &, each condition must be enclosed in the ( ). Or condition is represented by using | operator instead of &.


=== Examples ===
=== Select all backbone C atoms that are within 6 angstroms of MAN residue ===


These examples can be executed from the Scripting window of SiteBinder, MotiveExplorer, or other Silverlight applications.
Enter <code>AtomNames("CA", "CB").Inside(Residues("MAN").AmbientAtoms(6))</code> into the Atom Selection panel.


<pre>q = Atoms("Zn").ConnectedAtoms(2)
Explanation:
MQ.Execute(q)</pre>
: ''This command finds all motifs specified by the query q in all loaded structures.''


<pre>MQ.Execute(Residues("HEM"), [ Session.StructureMap["1tqn"], Session.StructureMap["2wer"] ])</pre>
# <code>AtomNames("CA", "CB")</code> represents all atoms names "CA" or "CB".
: ''This command finds all HEM residues in structures 1tqn and 2wer (provided structures with these names are loaded).''
# <code>.Inside(...)</code> function says that the motive on the left should be looked for inside another one.
# <code>Residues("MAN").AmbientAtoms(6)</code> represents all atoms on a MAN residue and all atoms within 6 angstroms around it.


<pre>q = AtomSimilarity(Motive("model"), Motive("1gtz_0"))
=== Cluster loaded structures by their common residues ===
MQ.Execute(q)</pre>
: ''This command computes the atom similarity (Jaccard coefficient) for structures model and 1gtz_0.''


<pre>q = ResidueSimilarity(Motive("model"), Current())
Enter <code>Utils.ResidueHierarchialClustering("name")</code> to the script panel. This will create several descriptors for the loaded structures with these properties:
MQ.Execute(q, Session.Structures)</pre>
 
: ''This command computes the residue similarity (Jaccard coefficient) for the structure with id 'model' (which is loaded using the Motive function) and all other loaded structures (computed one by one using the function Current()). The result is returned in CSV format.''
* For each cluster, two descriptors are added:
== Basic Query Functions ==
** <code>name</code>_<code>N</code> all motifs that share at least N residues. If a motif has less than N residues, large cluster index will be displayed (2^31).
''Basic building blocks of the language - i.e. atoms, residues, and the like.''
** <code>name</code>_<code>N</code>FP – a list of the common residues. If a motif has less than N residues, “n/a” is displayed.
=== AminoAcids ===
* Descriptors can be changed using the Structure Descriptors panel.  
<code>AminoAcids() -&gt; Residues</code><br/>
* There is also an export button in the Structure Descriptors panel.
''Sequence of all amino acids in a given protein.''<br/>
* Use Group by Descriptor and Sort by Descriptor functions for added effect.
;Options
 
: ChargeType&#58; String = "" - ''Specify type of the charge. Allowed values: Positive, Negative, Aromatic, Polar, NonPolar.''
=== Create a descriptor with residue count ===
;Examples
 
: <code>AminoAcids()</code>
Enter <code>Current().Count(Residues())</code> and select an appropriate name (say "resCount") in the Descpriptors panel.  
:: ''All amino acids.''
 
: <code>AminoAcids(ChargeType = "Polar")</code>
Explanation:
:: ''Amino acids with polar charge.''
 
----
# <code>Current()</code> returns the structure we are computing the descriptor for.
=== AtomIdRange ===
# <code>.Count(Residues())</code> counts the residues.
<code>AtomIdRange(minId&#58; Integer, maxId&#58; ?Integer) -&gt; Atoms</code><br/>
 
''Sequence of atoms with minId <= atomId <= maxId.''<br/>
It is possible to count all sorts of things:  
;Arguments
 
: minId&#58; Integer - ''Minimum id.''
* <code>Atoms("C", "N")</code> counts C and N atoms.
: maxId&#58; ?Integer - ''Maximum id. If not specified, maxId = minId.''
* <code>AtomNames("CA", "CB")</code> counts atoms named CA and CB.
;Examples
* <code>Residues("HIS", "ASP")</code> counts HIS and ASP residues.
: <code>AtomIdRange(152, 161)</code>
* <code>Rings(5 * ["C"] + ["O"])</code> counts C<sub>5</sub>O rings.
:: ''Returns all atoms with id between 152 and 161 inclusive.''
 
----
This descriptor can also be expanded and further analyzed for example in Excel using the Export menu in the Descriptors panel.
=== AtomNames ===
 
<code>AtomNames(names&#58; String+) -&gt; Atoms</code><br/>
== MotiveExplorer ==
''Sequence of atoms with specified names.''<br/>
 
;Arguments
Seems there is nothing here.
: names&#58; String+ - ''Allowed names.''
 
;Examples
== EEM Charges ==
: <code>AtomNames("O1","NH1")</code>
 
:: ''Returns all atoms with names O1 or NH1.''
Seems there is nothing here.
----
=== Atoms ===
<code>Atoms(symbols&#58; String*) -&gt; Atoms</code><br/>
''Sequence of atoms with specified element symbols. If no symbols are specified, yields all atoms one by one. A single atom can be entered using the '@' operator.''<br/>
;Arguments
: symbols&#58; String* - ''Allowed element symbols.''
;Examples
: <code>Atoms("Zn","Ca")</code>
:: ''Returns all atoms with element symbol Zn or Ca''
----
=== Named ===
<code>Named(motives&#58; Motives) -&gt; Motives</code><br/>
'''Names' the motive by its lowest atom id.''<br/>
;Arguments
: motives&#58; Motives - ''Motives to name.''
;Examples
: <code>Atoms("Zn").Named().AmbientAtoms(7)</code>
:: ''When exported, the result files will have names in the format '[parent id]_[pseudorandom numner]_[zn atomid]'. If the Named function was not used, the name would be just '[parent id]_[pseudorandom numner]'.''
----
=== NotAminoAcids ===
<code>NotAminoAcids() -&gt; Residues</code><br/>
''Sequence of all residues resudies that are not amino acids.''<br/>
;Options
: NoWaters&#58; Bool = True - ''Ignore water residues such as HOH.''
;Examples
: <code>NotAminoAcids()</code>
:: ''Returns all residues that are not amino acids.''
----
=== NotAtomNames ===
<code>NotAtomNames(names&#58; String+) -&gt; Atoms</code><br/>
''Sequence of atoms that do not have a specified name.''<br/>
;Arguments
: names&#58; String+ - ''Forbidden names.''
;Examples
: <code>NotAtomNames("O4")</code>
:: ''Returns all atoms that are not called O4.''
----
=== NotAtoms ===
<code>NotAtoms(symbols&#58; String+) -&gt; Atoms</code><br/>
''Sequence of atoms that are not particular elements.''<br/>
;Arguments
: symbols&#58; String+ - ''Forbidden element symbols.''
;Examples
: <code>NotAtoms("O")</code>
:: ''Returns all atoms that are not O.''
----
=== NotResidues ===
<code>NotResidues(names&#58; Value+) -&gt; Residues</code><br/>
''Sequence of residues that are not called by the specified names.''<br/>
;Arguments
: names&#58; Value+ - ''Forbidden residue names.''
;Examples
: <code>NotResidues("THR","CYS")</code>
:: ''Returns all residues that are not THR or CYS.''
----
=== RegularMotives ===
<code>RegularMotives(regex&#58; String) -&gt; Motives</code><br/>
''Regular motives. The protein is split into individual chains before the motives are identified.''<br/>
;Arguments
: regex&#58; String - ''Regular expression on one letter abbreviations of amino acids.''
;Examples
: <code>RegularMotives("RGD")</code>
:: ''Finds all RGD motives.''
----
=== ResidueIdRange ===
<code>ResidueIdRange(chain&#58; String, min&#58; Integer, max&#58; ?Integer) -&gt; Residues</code><br/>
''Sequence of residues with specific chain and min <= sequence number <= max.''<br/>
;Arguments
: chain&#58; String - ''Chain idetifier. Case sensitive (a != A).''
: min&#58; Integer - ''Minimum sequence number.''
: max&#58; ?Integer - ''Maximum sequence number. If not specified, max = min.''
;Examples
: <code>ResidueIdRange("A", 161, 165)</code>
:: ''Returns all residues on chain A with seq. number between 161 and 165 inclusive.''
----
=== Residues ===
<code>Residues(names&#58; Value*) -&gt; Residues</code><br/>
''Sequence of residues with specified names. If no names are specified, yields all residues one by one. A single residue can be entered using the '#' operator.''<br/>
;Arguments
: names&#58; Value* - ''Allowed residue names.''
;Examples
: <code>Residues("HIS", "CYS")</code>
:: ''Returns all HIS or CYS residues.''
----
=== RingAtoms ===
<code>RingAtoms(atom&#58; Atoms, ring&#58; ?Rings) -&gt; Atoms</code><br/>
''Returns all rings atoms.''<br/>
;Arguments
: atom&#58; Atoms - ''Atom types.''
: ring&#58; ?Rings - ''Specific ring.''
;Examples
: <code>RingAtoms(Atoms("C"), Rings(4 * ["C"] + ["O"]))</code>
:: ''Returns all C atoms on a ring with 4C and O.''
----
=== Rings ===
<code>Rings(atoms&#58; Value*) -&gt; Rings</code><br/>
''Sequence of rings with particular atoms. If no atoms are specified, yields all rings (cycles) one by one.''<br/>
;Arguments
: atoms&#58; Value* - ''Ring atoms.''
;Examples
: <code>Rings(5 * ["C"] + ["O"])</code>
:: ''Returns all rings with 5C and 1O atoms.''
<br/>
== Advanced Query Functions ==
''Advanced building blocks of the language.''
=== Inside ===
<code>Inside(motives&#58; Motives, where&#58; Motives) -&gt; Motives</code><br/>
''Finds motives within another motive. Equivalent to where.SelectMany(lambda m: m.Find(motives))''<br/>
;Arguments
: motives&#58; Motives - ''Motives to find.''
: where&#58; Motives - ''Where to find them.''
;Examples
: <code>Atoms("C").Inside(Residues("HIS"))</code>
:: ''Returns all C atoms on HIS residues.''
----
=== Or ===
<code>Or(motives&#58; Motives+) -&gt; Motives</code><br/>
''Merges several motive sequences into one.''<br/>
;Arguments
: motives&#58; Motives+ - ''Motives to merge.''
;Examples
: <code>Or(Atoms("Zn").ConnectedResidues(1), Rings())</code>
:: ''Finds all zincs and their connected residues or rings.''
----
=== SelectMany ===
<code>SelectMany(motives&#58; Motives, selector&#58; Motive->Motives) -&gt; Motives</code><br/>
''Projects a sequence of motives to another.''<br/>
;Arguments
: motives&#58; Motives - ''Motives to project.''
: selector&#58; Motive->Motives - ''The selector.''
;Examples
: <code>Residues("HIS").SelectMany(lambda m: m.Find(Atoms("C")))</code>
:: ''Returns all C atoms on HIS residues.''
----
=== ToAtoms ===
<code>ToAtoms(motives&#58; Motives) -&gt; Motives</code><br/>
''Collects all 'inner' motives and yields all unique atoms one by one.''<br/>
;Arguments
: motives&#58; Motives - ''Motives to split.''
;Examples
: <code>Residues("HIS").ToAtoms()</code>
:: ''Returns all atoms on HIS residues one by one.''
----
=== ToResidues ===
<code>ToResidues(motives&#58; Motives) -&gt; Motives</code><br/>
''Collects all 'inner' motives and yields all unique residues one by one. The residues contain only the atoms that have been yielded by the inner query.''<br/>
;Arguments
: motives&#58; Motives - ''Motives to split.''
;Examples
: <code>ToResidues(Atoms("C"))</code>
:: ''Returns all C atoms grouped by residues.''
----
=== Union ===
<code>Union(motives&#58; Motives) -&gt; Motives</code><br/>
''Collects all 'inner' motives and yields one created from their unique atoms.''<br/>
;Arguments
: motives&#58; Motives - ''Motives to merge.''
;Examples
: <code>Rings().Union()</code>
:: ''Creates a single motive that contains all rings.''
<br/>
== Filter Functions ==
''Functions useful for filtering motifs.''
=== Count ===
<code>Count(where&#58; Motive, what&#58; Motives) -&gt; Integer</code><br/>
''Counts all occurences of motive 'what' in motive 'where'.''<br/>
;Arguments
: where&#58; Motive - ''Where to count it.''
: what&#58; Motives - ''What motive to count.''
;Examples
: <code>m.Count(Residues("HIS"))</code>
:: ''Returns the count of HIS residues in the motive m. Where m is a Motive (for example when using the Filter function or returned by the ToMotive() function). This example will not work directly and is here to illustrate a concept.''
: <code>Atoms("Zn").ConnectedResidues(1).Filter(lambda m: m.Count(Residues("HIS")) == 2)</code>
:: ''Motifs with Zn atoms and its connected residues with exactly 2 HIS residues.''
----
=== Filter ===
<code>Filter(motives&#58; Motives, filter&#58; Motive->Bool) -&gt; Motives</code><br/>
''Filters a sequence of motives with a given predicate.''<br/>
;Arguments
: motives&#58; Motives - ''Motives to filter.''
: filter&#58; Motive->Bool - ''Filter predicate.''
;Examples
: <code>Residues().Filter(lambda m: m.Count(Atoms("C")) >= 3)</code>
:: ''Returns all residues that contain at least 3 C atoms.''
----
=== IsConnectedTo ===
<code>IsConnectedTo(current&#58; Motive, motive&#58; Motives) -&gt; Bool</code><br/>
''Checks if a particular motive is connected to any other specified motive. The motives must have empty intersection for this function to return true.''<br/>
;Arguments
: current&#58; Motive - ''A motive to test.''
: motive&#58; Motives - ''Motive sequence to test against.''
;Examples
: <code>Atoms().Filter(lambda a: a.IsConnectedTo(Rings()))</code>
:: ''Finds all atoms that are connected to a ring they do not belong to.''
----
=== IsNotConnectedTo ===
<code>IsNotConnectedTo(current&#58; Motive, motive&#58; Motives) -&gt; Bool</code><br/>
''Checks if a particular motive is not connected to any other specified motive. The motives must have empty intersection for this function to return true.''<br/>
;Arguments
: current&#58; Motive - ''A motive to test.''
: motive&#58; Motives - ''Motive sequence to test against.''
;Examples
: <code>Residues().Filter(lambda r: r.IsNotConnectedTo(Atoms("Ca")))</code>
:: ''Finds all residues that are not connected to Ca atoms. The residue itself can still contain Ca atoms.''
----
=== NearestDistanceTo ===
<code>NearestDistanceTo(current&#58; Motive, motive&#58; Motives) -&gt; Real</code><br/>
''Finds the distance to a particular motive.''<br/>
;Arguments
: current&#58; Motive - ''A motive to test.''
: motive&#58; Motives - ''Motive sequence to test against.''
;Examples
: <code>Atoms().Filter(lambda m: m.NearestDistanceTo(Residues("ASP")) >= 5)</code>
:: ''Finds all atoms that are at least 5 (angstroms) away from any ASP residue.''
<br/>
== Topology Functions ==
''Functions that rely on the topology of motifs.''
=== ConnectedAtoms ===
<code>ConnectedAtoms(motive&#58; Motives, n&#58; Integer) -&gt; Motives</code><br/>
''Surrounds the inner motive by n layers of atoms.''<br/>
;Arguments
: motive&#58; Motives - ''Basic motive.''
: n&#58; Integer - ''Number of atom layers to connect.''
;Options
: YieldNamedDuplicates&#58; Bool = False - ''Yield duplicate motifs if they have a different name.''
;Examples
: <code>Residues("MAN").ConnectedAtoms(2)</code>
:: ''Finds all MAN residues and then adds two connected levels of atoms to them.''
----
=== ConnectedResidues ===
<code>ConnectedResidues(motive&#58; Motives, n&#58; Integer) -&gt; Motives</code><br/>
''Surrounds the inner motive by n layers of residues.''<br/>
;Arguments
: motive&#58; Motives - ''Basic motive.''
: n&#58; Integer - ''Number of residue layers to connect.''
;Options
: YieldNamedDuplicates&#58; Bool = False - ''Yield duplicate motifs if they have a different name.''
;Examples
: <code>Atoms("Zn").ConnectedResidues(1)</code>
:: ''Finds all Zn atoms and adds all residues that are connected to them.''
<br/>
== Geometry Functions ==
''Functions that rely on the geometry of motifs.''
=== AmbientAtoms ===
<code>AmbientAtoms(motive&#58; Motives, r&#58; Number) -&gt; Motives</code><br/>
''Surrounds the inner motive by atoms that within the given radius from the inner motive.''<br/>
;Arguments
: motive&#58; Motives - ''Basic motive.''
: r&#58; Number - ''Radius.''
;Options
: ExcludeBase&#58; Bool = False - ''Exclude the central original motif.''
: NoWaters&#58; Bool = True - ''Ignore water residues such as HOH.''
: YieldNamedDuplicates&#58; Bool = False - ''Yield duplicate motifs if they have a different name.''
;Examples
: <code>Atoms("Fe").AmbientAtoms(4)</code>
:: ''Finds Fe atoms and all atoms within 4 (angstroms) from each of them.''
----
=== AmbientResidues ===
<code>AmbientResidues(motive&#58; Motives, r&#58; Number) -&gt; Motives</code><br/>
''Surrounds the inner motive by residues that have at least one atom within the given radius from the inner motive.''<br/>
;Arguments
: motive&#58; Motives - ''Basic motive.''
: r&#58; Number - ''Radius.''
;Options
: ExcludeBase&#58; Bool = False - ''Exclude the central original motif.''
: NoWaters&#58; Bool = True - ''Ignore water residues such as HOH.''
: YieldNamedDuplicates&#58; Bool = False - ''Yield duplicate motifs if they have a different name.''
;Examples
: <code>Rings(6 * ["C"]).AmbientResidues(4)</code>
:: ''Finds rings with 6C atoms and all residues within 4 (angstroms) from each of them.''
----
=== Cluster ===
<code>Cluster(r&#58; Number, motives&#58; Motives+) -&gt; Motives</code><br/>
''Clusters all motives that are pairwise closer than r (angstroms).''<br/>
;Arguments
: r&#58; Number - ''Maximum distance between two motives in the cluster.''
: motives&#58; Motives+ - ''Motives to cluster.''
;Examples
: <code>Cluster(4, Atoms("Ca"), Rings(5 * ["C"] + ["O"]))</code>
:: ''Finds all instance of one or more rings with 5C and O atoms and one or more Ca atoms that are closer than 4 (angstroms).''
----
=== Filled ===
<code>Filled(motive&#58; Motives) -&gt; Motives</code><br/>
''Adds all atoms that fall within the circumsphere (with radius multiplied by the factor) of the basic motive.''<br/>
;Arguments
: motive&#58; Motives - ''Basic motive.''
;Options
: NoWaters&#58; Bool = True - ''Ignore water residues such as HOH.''
: RadiusFactor&#58; Number = 0.75 - ''Circumsphere radius factor.''
;Examples
: <code>Cluster(4, Residues("HIS")).Filled(RadiusFactor = 0.75)</code>
:: ''Finds clusters of HIS residues and all atoms within the circumsphere.''
----
=== Near ===
<code>Near(r&#58; Number, motives&#58; Motives+) -&gt; Motives</code><br/>
''Clusters all motives that are pairwise closer than r (angstroms) and checks if the "counts" match.''<br/>
;Arguments
: r&#58; Number - ''Maximum distance between two sub-motives in the motive.''
: motives&#58; Motives+ - ''Motives to 'cluster'.''
;Examples
: <code>Near(4, Many(Atoms("Ca"), 2),  Rings(5 * ["C"] + ["O"]))</code>
:: ''Finds all instance of a single ring with 5C and O atoms and two Ca atoms that are closer than 4 (angstroms).''
<br/>
== Miscellaneous Functions ==
''Various useful functions. These function often require a special setup (i.e. only useful in Scripting window or in specific applications).''
=== AtomProperty ===
<code>AtomProperty(atomMotive&#58; Motive, name&#58; String) -&gt; ?</code><br/>
''If the property exists and the motive consits of a single atom, returns the property. Otherwise, returns Nothing.''<br/>
<small>''Note:'' This function cannot be used directly to query motifs from MotiveExplorer or MotiveQuery service.</small><br/>
;Arguments
: atomMotive&#58; Motive - ''Single atom motive.''
: name&#58; String - ''Property name.''
;Examples
: <code>a.Property("charge")</code>
:: ''Gets the 'charge' property of the atom a. Where a is a single atom Motive. This example will not work directly.''
: <code>Atoms().Filter(lambda a: a.Property("charge") >= 2)</code>
:: ''All atoms with the charge property greater or equal to 2. This example will only work in cases where a suitable property is defined. For example in Scripting window in the Charges app.''
----
=== AtomSimilarity ===
<code>AtomSimilarity(a&#58; Motive, b&#58; Motive) -&gt; Real</code><br/>
''Computes Jaccard/Tanimoto coefficient on atoms (element symbols) of both structures.''<br/>
<small>''Note:'' This function cannot be used directly to query motifs from MotiveExplorer or MotiveQuery service.</small><br/>
;Arguments
: a&#58; Motive - ''First motive.''
: b&#58; Motive - ''Second motive.''
;Examples
: <code>AtomSimilarity(Current(),Motive("1tqn_12"))</code>
:: ''Computes the atom similarity between the current motif and 1tqn_12. This example can be used in SiteBinder to create a descriptor (assuming a structure with id '1tqn_12' is loaded).''
----
=== CSA ===
<code>CSA() -&gt; Motives</code><br/>
''Entries from Catalytic Site Atlas represented as motifs. Works only if used from the command line version of MotiveQuery and property configured.''<br/>
<small>''Note:'' This function cannot be used directly to query motifs from MotiveExplorer or MotiveQuery service.</small><br/>
;Examples
: <code>CSA()</code>
:: ''All CSA sites for the given structure. This example will only work if used from the command line version of MotiveQuery and property configured.''
----
=== Current ===
<code>Current() -&gt; Motive</code><br/>
''A variable that is assigned by the application environment.''<br/>
<small>''Note:'' This function cannot be used directly to query motifs from MotiveExplorer or MotiveQuery service.</small><br/>
;Examples
: <code>AtomSimilarity(Current(), Motive("model"))</code>
:: ''Returns the atom similarity of the current motive and the model. This example will work for example when defining a structure descriptor in SiteBinder and there is a structure with id 'model' loaded.''
----
=== Descriptor ===
<code>Descriptor(motive&#58; Motive, name&#58; String) -&gt; ?</code><br/>
''Returns the descriptor. If the descriptor does not exist, 'null' is returned.''<br/>
<small>''Note:'' This function cannot be used directly to query motifs from MotiveExplorer or MotiveQuery service.</small><br/>
;Arguments
: motive&#58; Motive - ''Motive that represents entire structure.''
: name&#58; String - ''Descriptor name.''
;Examples
: <code>Current().Descriptor("similarity") >= 0.75</code>
:: ''Returns True if 'similarity' descriptor of the current motif is at least 0.75. This example will work for example in SiteBinder's structure selection if the 'similarity' descriptor has been previously defined.''
----
=== Find ===
<code>Find(source&#58; Motive, motives&#58; Motives) -&gt; Motives</code><br/>
''Converts the source motive to a structure and finds motives within it.''<br/>
<small>''Note:'' This function cannot be used directly to query motifs from MotiveExplorer or MotiveQuery service.</small><br/>
;Arguments
: source&#58; Motive - ''Where to look.''
: motives&#58; Motives - ''Motives to find.''
;Examples
: <code>AtomSimilarity(Current().Find(NotAtoms("N")).ToMotive(), Motive("model").Find(NotAtoms("N")).ToMotive())</code>
:: ''Computes the atom similarity of the 'current' and 'model' motives, but ignores N atoms. This example can be used in SiteBinder to create a descriptor (assuming a structure with id 'model' is loaded).''
----
=== Motive ===
<code>Motive(structureName&#58; String) -&gt; Motive</code><br/>
''Returns a structure represented a motive.''<br/>
<small>''Note:'' This function cannot be used directly to query motifs from MotiveExplorer or MotiveQuery service.</small><br/>
;Arguments
: structureName&#58; String - ''Name of a structure.''
;Examples
: <code>Motive("1tqn_12")</code>
:: ''Returns the structure '1tqn_12' represented as a motive. Usable in defining descriptors or in Scripting window (using MQ.Execute).''
----
=== ResidueSimilarity ===
<code>ResidueSimilarity(a&#58; Motive, b&#58; Motive) -&gt; Real</code><br/>
''Computes Jaccard/Tanimoto coefficient on residue names of both structures.''<br/>
<small>''Note:'' This function cannot be used directly to query motifs from MotiveExplorer or MotiveQuery service.</small><br/>
;Arguments
: a&#58; Motive - ''First motive.''
: b&#58; Motive - ''Second motive.''
;Examples
: <code>ResidueSimilarity(Current(), Motive("1tqn_12"))</code>
:: ''Computes the residue similarity between the current motif and 1tqn_12. This example can be used in SiteBinder to create a descriptor (assuming a structure with id '1tqn_12' is loaded).''
----
=== ToMotive ===
<code>ToMotive(motives&#58; Motives) -&gt; Motive</code><br/>
''Converts a sequence of Motives to a single motive. The Motive type is required by some function such as AtomSimilarity.''<br/>
<small>''Note:'' This function cannot be used directly to query motifs from MotiveExplorer or MotiveQuery service.</small><br/>
;Arguments
: motives&#58; Motives - ''Motives to convert.''
;Examples
: <code>Residues("HIS").ToMotive()</code>
:: ''Converts a sequence of HIS residue Motives to a single Motive.''
: <code>AtomSimilarity(Current().Find(NotAtoms("N")).ToMotive(), Motive("model").Find(NotAtoms("N")).ToMotive())</code>
:: ''Computes the atom similarity of the 'current' and 'model' motives, but ignores N atoms.''
<br/>
== Value Functions ==
''Functions such as addition or comparison of numbers.''
=== Abs ===
<code>Abs(x&#58; Number) -&gt; Number</code><br/>
''Computes the 'Abs' function of the argument.''<br/>
;Arguments
: x&#58; Number - ''Argument.''
;Examples
: <code>Abs(x)</code>
:: ''Evaluates the expression.''
----
=== Divide (/) ===
<code>Divide(x&#58; Number, y&#58; Number) -&gt; Number</code><br/>
''Computes the 'Divide' function of the values.''<br/>
;Arguments
: x&#58; Number - ''Left argument.''
: y&#58; Number - ''Right argument.''
;Examples
: <code>x / y</code>
:: ''Evaluates the expression.''
----
=== Equal (==) ===
<code>Equal(x&#58; Value, y&#58; Value) -&gt; Bool</code><br/>
''Determines the 'Equal' relation between two values.''<br/>
;Arguments
: x&#58; Value - ''Left argument.''
: y&#58; Value - ''Right argument.''
;Examples
: <code>x == y</code>
:: ''Evaluates to True or False based on the value of x and y.''
----
=== Greater (&gt;) ===
<code>Greater(x&#58; Number, y&#58; Number) -&gt; Bool</code><br/>
''Determines the 'Greater' relation between two values.''<br/>
;Arguments
: x&#58; Number - ''Left argument.''
: y&#58; Number - ''Right argument.''
;Examples
: <code>x > y</code>
:: ''Evaluates to True or False based on the value of x and y.''
----
=== GreaterEqual (&gt;=) ===
<code>GreaterEqual(x&#58; Number, y&#58; Number) -&gt; Bool</code><br/>
''Determines the 'GreaterEqual' relation between two values.''<br/>
;Arguments
: x&#58; Number - ''Left argument.''
: y&#58; Number - ''Right argument.''
;Examples
: <code>x >= y</code>
:: ''Evaluates to True or False based on the value of x and y.''
----
=== Less (&lt;) ===
<code>Less(x&#58; Number, y&#58; Number) -&gt; Bool</code><br/>
''Determines the 'Less' relation between two values.''<br/>
;Arguments
: x&#58; Number - ''Left argument.''
: y&#58; Number - ''Right argument.''
;Examples
: <code>x < y</code>
:: ''Evaluates to True or False based on the value of x and y.''
----
=== LessEqual (&lt;=) ===
<code>LessEqual(x&#58; Number, y&#58; Number) -&gt; Bool</code><br/>
''Determines the 'LessEqual' relation between two values.''<br/>
;Arguments
: x&#58; Number - ''Left argument.''
: y&#58; Number - ''Right argument.''
;Examples
: <code>x <= y</code>
:: ''Evaluates to True or False based on the value of x and y.''
----
=== LogicalAnd (&) ===
<code>LogicalAnd(xs&#58; Bool+) -&gt; Bool</code><br/>
''Computes 'LogicalAnd' of the input values.''<br/>
;Arguments
: xs&#58; Bool+ - ''Arguments.''
;Examples
: <code>x & y</code>
:: ''Evaluates to True or False based on the values of x and y.''
----
=== LogicalNot ===
<code>LogicalNot(x&#58; Bool) -&gt; Bool</code><br/>
''Computes 'LogicalNot' of the input value.''<br/>
;Arguments
: x&#58; Bool - ''Argument.''
;Examples
: <code>Not(x)</code>
:: ''Evaluates to True or False based on the value of x.''
: <code>x.Not()</code>
:: ''Evaluates to True or False based on the value of x.''
----
=== LogicalOr (|) ===
<code>LogicalOr(xs&#58; Bool+) -&gt; Bool</code><br/>
''Computes 'LogicalOr' of the input values.''<br/>
;Arguments
: xs&#58; Bool+ - ''Arguments.''
;Examples
: <code>x | y</code>
:: ''Evaluates to True or False based on the values of x and y.''
----
=== LogicalXor ===
<code>LogicalXor(xs&#58; Bool+) -&gt; Bool</code><br/>
''Computes 'LogicalXor' of the input values.''<br/>
;Arguments
: xs&#58; Bool+ - ''Arguments.''
;Examples
: <code>LogicalXor(x, y)</code>
:: ''Evaluates to True or False based on the values of x and y.''
----
=== Minus (-) ===
<code>Minus(x&#58; Number) -&gt; Number</code><br/>
''Computes the arithmetic negation of the argument.''<br/>
;Arguments
: x&#58; Number - ''Argument.''
;Examples
: <code>-x</code>
:: ''Arithmetic negation of x.''
----
=== NotEqual (!=) ===
<code>NotEqual(x&#58; Value, y&#58; Value) -&gt; Bool</code><br/>
''Determines the 'NotEqual' relation between two values.''<br/>
;Arguments
: x&#58; Value - ''Left argument.''
: y&#58; Value - ''Right argument.''
;Examples
: <code>x != y</code>
:: ''Evaluates to True or False based on the value of x and y.''
----
=== Plus (+) ===
<code>Plus(x&#58; Number, y&#58; Number) -&gt; Number</code><br/>
''Computes the 'Plus' function of the values.''<br/>
;Arguments
: x&#58; Number - ''Left argument.''
: y&#58; Number - ''Right argument.''
;Examples
: <code>x + y</code>
:: ''Evaluates the expression.''
----
=== Power (^) ===
<code>Power(x&#58; Number, y&#58; Number) -&gt; Number</code><br/>
''Computes the 'Power' function of the values.''<br/>
;Arguments
: x&#58; Number - ''Left argument.''
: y&#58; Number - ''Right argument.''
;Examples
: <code>x ^ y</code>
:: ''Evaluates the expression.''
----
=== Subtract (-) ===
<code>Subtract(x&#58; Number, y&#58; Number) -&gt; Number</code><br/>
''Computes the 'Subtract' function of the values.''<br/>
;Arguments
: x&#58; Number - ''Left argument.''
: y&#58; Number - ''Right argument.''
;Examples
: <code>x - y</code>
:: ''Evaluates the expression.''
----
=== Times (*) ===
<code>Times(x&#58; Number, y&#58; Number) -&gt; Number</code><br/>
''Computes the 'Times' function of the values.''<br/>
;Arguments
: x&#58; Number - ''Left argument.''
: y&#58; Number - ''Right argument.''
;Examples
: <code>x * y</code>
:: ''Evaluates the expression.''
<br/>

Latest revision as of 16:02, 6 June 2014

SiteBinder

[edit]

Select all structures that have exactly one C5O ring

[edit]

Enter Current().Count(Rings(5 * ["C"] + ["O"])) == 1 into the Structure Selection panel.

Explanation:

  1. Current() returns the structure being tested.
  2. Count() function counts occurrences of a specific motif.
  3. Rings(5 * ["C"] + ["O"]) is a "Python" shortcut for Rings(["C", "C", "C", "C", "C", "O"]) which represents a ring with 5 C and 1 O atoms.
  4. == 1 checks for equality. Other relation operators can be used as well ( >, >=, <, <=, !=).

Select all structures that satisfy multiple conditions

[edit]

In the Structure Selection panel use the expression (c1) & (c2). For example, all structures that contain more than one C5O ring and no more than 3 ASP residues is represented by the expression (Current().Count(Rings(5 * ["C"] + ["O"])) > 1) & (Current().Count(Residues("HIS")) <= 3). Due to the associativity rules of the operator &, each condition must be enclosed in the ( ). Or condition is represented by using | operator instead of &.

Select all backbone C atoms that are within 6 angstroms of MAN residue

[edit]

Enter AtomNames("CA", "CB").Inside(Residues("MAN").AmbientAtoms(6)) into the Atom Selection panel.

Explanation:

  1. AtomNames("CA", "CB") represents all atoms names "CA" or "CB".
  2. .Inside(...) function says that the motive on the left should be looked for inside another one.
  3. Residues("MAN").AmbientAtoms(6) represents all atoms on a MAN residue and all atoms within 6 angstroms around it.

Cluster loaded structures by their common residues

[edit]

Enter Utils.ResidueHierarchialClustering("name") to the script panel. This will create several descriptors for the loaded structures with these properties:

  • For each cluster, two descriptors are added:
    • name_N – all motifs that share at least N residues. If a motif has less than N residues, large cluster index will be displayed (2^31).
    • name_NFP – a list of the common residues. If a motif has less than N residues, “n/a” is displayed.
  • Descriptors can be changed using the Structure Descriptors panel.
  • There is also an export button in the Structure Descriptors panel.
  • Use Group by Descriptor and Sort by Descriptor functions for added effect.

Create a descriptor with residue count

[edit]

Enter Current().Count(Residues()) and select an appropriate name (say "resCount") in the Descpriptors panel.

Explanation:

  1. Current() returns the structure we are computing the descriptor for.
  2. .Count(Residues()) counts the residues.

It is possible to count all sorts of things:

  • Atoms("C", "N") counts C and N atoms.
  • AtomNames("CA", "CB") counts atoms named CA and CB.
  • Residues("HIS", "ASP") counts HIS and ASP residues.
  • Rings(5 * ["C"] + ["O"]) counts C5O rings.

This descriptor can also be expanded and further analyzed for example in Excel using the Export menu in the Descriptors panel.

MotiveExplorer

[edit]

Seems there is nothing here.

EEM Charges

[edit]

Seems there is nothing here.