Jump to content

PatternQuery:Use Cases: Difference between revisions

From WebChemistry Wiki
Line 11: Line 11:
===Name of the query()===
===Name of the query()===
*'''[PDB ID]''' Here you find an example PDB ID where you can try out the query with MotiveExplorer and a rough description of the query function.
*'''[PDB ID]''' Here you find an example PDB ID where you can try out the query with MotiveExplorer and a rough description of the query function.
* This is followed by examples of this query with with the explanation such as <code>Residues("HEM")</code>. Copy this query to the command text box in Motive Explorer application and immediately see the results
* This is followed by examples of this query with with the explanation such as <code>Residues("HEM")</code>. Copy this query to the command text box in Motive Explorer application and immediately see the results.
* Type of data query operate on and the expected returned value.
* Type of data query operate on and the expected returned value.
* e.g. ''Type: Atoms(symbols: String*) -> Atoms''. query Atoms() take 0..n strings in parenthesis ("C", "N", etc.) and based on the input returns a list of individual atoms.
* e.g. ''Type: Atoms(symbols: String*) -> Atoms''. query Atoms() take 0..n strings in parenthesis ("C", "N", etc.) and based on the input returns a list of individual atoms.

Revision as of 11:44, 2 June 2014

Statement of purpose

MotiveQuery (MQ) represents a cutting edge and powerful platform for complex, swift and accurate molecular motifs selection and analysis over a vast variety of structural data. In the following text you can find a numerous use cases which will help you to deep dive into the language and the web service itself. Moreover, following text can also serve as a brief language reference. The full language reference is accessible via our wiki pages.

In order to tune up your queries or just to try an interactive work with the language, feel free to use MotiveExplorer (ME) application, where you can upload a PDB molecule of choice and immediately see the result of queries. ME requires an up-to-date web browser and the Silverlight framework installed. It has been tested under Windows and Mac OS operating systems.

How to read following text

The text is separated to three plus one part which differs by data type queries are operated (Atoms, Residues and Motives). The first two categories deal with only basic Atom or Residue selections. Outputs of these two types of queries are Atoms and Residues respectively. Last category is Motives, which contain numerous advanced queries demonstrating versatility and power of MQ. These queries operate on all results provided by both Atom and Residue queries. The additional part represents a few use cases of complex queries demonstrating possible application of MQ language.

Each query looks like this:

Name of the query()

  • [PDB ID] Here you find an example PDB ID where you can try out the query with MotiveExplorer and a rough description of the query function.
  • This is followed by examples of this query with with the explanation such as Residues("HEM"). Copy this query to the command text box in Motive Explorer application and immediately see the results.
  • Type of data query operate on and the expected returned value.
  • e.g. Type: Atoms(symbols: String*) -> Atoms. query Atoms() take 0..n strings in parenthesis ("C", "N", etc.) and based on the input returns a list of individual atoms.

Terminology

By an atom we mean an individual point in Cartesian coordinate system as provided by ATOM or HETATOM records in PDB input files. Residue refers to any component of a biomacromolecule or a biomacromolecular complex. This includes amino acid residues, nucleotides and ligand, which are commonly referred to as residues as they provide building blocks for proteins and nucleic acids. A single residue is defined by its id and name defined in PDB input file. Subsequently, a motive is any sequence of either atoms or residues generated by MQ. Therefore, both atoms and residues can be considered as motives.  

Queries

Atoms

Atoms()

  • [2hhb] Returns a sequence of individual atoms based on element type provided in the argument. More elements can be specified, if separated by a comma. In case no argument is provided a list of all the atoms is returned.
  • Atoms("Fe") - Returns all iron atoms in the given structure.
  • Atoms("Fe", "N") - Returns all iron and nitrogen atoms in the given structure.
  • Type: Atoms(symbols: String*) -> Atoms.


AtomNames()

  • [2hhb] Returns a sequence of atoms with defined name or names.
  • AtomNames("CA") – Returns all CA atoms.
  • AtomNames("CA", "N") –Returns atoms with names CA (Cα carbon) or N (terminal part of amino acids).
  • Type: AtomNames(names: String+) -> Atoms.


AtomIds()

  • [2hhb] Returns a sequence of atoms with given id or ids
  • AtomIds(1) – Returns atom with id=1 from the given structures.
  • AtomIds(1,2,5) - Returns atoms with id=1, 2 and 5 from the given structures.
  • Type: AtomIds(ids: Integer+) -> Atoms.


AtomIdRange()

  • [2hhb] Returns a sequence of atoms with ids from a given range (inclusive specified indices).
  • AtomIdRange(1, 10) – returns 10 atoms with IDs from the interval <1, 10>, as specified in the input file.
  • Type: AtomIdRange(minId: Integer, maxId: ?Integer) -> Atoms

NotAtomNames()

  • [2hhb] Returns a sequence of atoms which are not defined by an argument.
  • NotAtomNames("C", "N", "CA", "O") – returns all the atoms with names other than C, CA, N and O. i.e. only the side chain atoms of the protein .
  • Type: NotAtomNames(names: String+) -> Atom.

NotAtomIds()

  • [2hhb] Returns a sequence of atoms which does not have a defined id
  • NotAtomIds(1) - Returns atom with id other but 1 from the given structures.
  • NotAtomIds(1,2,5) - Returns atoms with id other but 1,2 and 5 from the given structures.
  • Type: NotAtomIds(ids: Integer+) -> Atoms.


NotAtoms()

  • [2hhb] Returns all the atoms not specified in the argument. More elements can be specified, if separated by a comma.
  • Atoms("Fe") – returns all the atoms of the structure, but iron.
  • Atoms("Fe", "N") returns all the atoms of the structure, but iron and nitrogen.
  • Type: NotAtoms(symbols: String+) -> Atoms.

RingAtoms()

  • [2hhb] Returns specified atoms found on detected rings .
  • RingAtoms(Atoms("N"), Rings(2 * ["C"] + ["N"] + ["C"] + ["N"])) – Returns all the nitrogen atoms on the histidine sidechain.
  • Type: RingAtoms(atom: Atoms, ring: ?Rings) -> Atoms.

Residues

Motives

Selected Use Cases

Find all post-translational modified aminoacids

  • i.e. Those incodporated in the protein backbone and not hetero atoms
NotAminoAcids().Filter(lambda m: m.Count(HetResidues()) == 0) 

This query queries all the non-standard amino acids for their presence among Hetatom entries. Equivalently:**

NotAminoAcids().Filter(lambda m: m.Contains(HetResidues()).Not())


Find all heteroatoms, which are not covalently bonded to the protein structure

  • Takes all the heteroatoms and queries them for being connected to any amino acid of a given protein
HetResidues().Filter(lambda m: m.IsNotConnectedTo(AminoAcids()))


Identify Zinc fingers

  • There is a variety of different zinc fingers based on the surrounding residues, in our example we will focus on those comprising two zinc and two his residues (Cys2His2).
Atoms("Zn").ConnectedResidues(1).Filter(lambda m: (m.Count(Residues("His")) == 2) & (m.Count(Residues("Cys")) == 2)) 

At first the zinc atoms are selected together with their bonded residues. Additionally, these motives are filtered according to the content of their amino acids.


Identify all the residues, which contain a sugar ring

  • This task can be decomposed to two individual subtasks, since sugars contain either pentose or furanose ring. Pentose ring contains 4 carbon and an oxygen atom. Similarly, furanose ring is composed of 5 carbon atoms and an oxygen atom.
Or(Rings(4 * ["C"] + ["O"]) .ConnectedResidues(0), Rings(5 * ["C"] + ["O"]) .ConnectedResidues(0)) 

By specifying the Ring() queries, we select only the ring part of the molecule. By extending the Ring() query with ConnectedResidues(0) only the residue which includes this ring is selected. Last but not least we can join both queries with Or() in order to merge results.


Identify all binding sites of PA-IIL lectine in different organisms

  • Binding sites of this type of lectine comprise of two calcium atoms close to each other and a binded sugar residue.
Cluster(4, Atoms("Ca")).Filter(lambda m: m.Count(Atoms("Ca")) == 2).ConnectedResidues(1).Filter(lambda m: (m.Count(Rings(5 * ["C"] + ["O"])) > 0) | (m.Count(Rings(4 * ["C"] + ["O"])) > 0)) 

At first we select all the calcium atoms and clusters them, if they are in a vicinity of 4Å and less. Additionally, we check if there are exactly 2 such atoms. Subsequently all the binded residues are found and finally, only the motives containing either pentose (Rings(5 * ["C"] + ["O"])) or furanose (Rings(4 * ["C"] + ["O"])) are returned.

Equivalently:

Cluster(4, Atoms("Ca")).Filter(lambda m: m.Count(Atoms("Ca")) == 2).ConnectedResidues(1).Filter(lambda m: m.Contains(Or((Rings(5 * ["C"] + ["O"])), Rings(4 * ["C"] + ["O"]))))