PatternQuery:Language Reference: Difference between revisions
No edit summary |
|||
(16 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== Introduction == | == Introduction == | ||
PatternQuery (PQ) is a user friendly chemical language primarily designed for defining atom patterns in molecules. PQ combines the clarity and brevity of programming languages with the versatility of natural language, aiming for an efficient inclusion of chemical and biochemical knowledge into the definition of patterns. PQ allows definitions based on chemical connectivity and three-dimensional structure at the same time. Additionally, in the case of molecules based on residue chains (such as proteins, nucleic acids, saccharides, etc.), PQ allows the user to include any amount of information regarding the residue level structure directly into the definition of the patternss. | |||
PatternQuery is a subset of the Python programming language. Therefore, if you have experience with it, it should not be a problem to use PQ as well. | |||
* The language is case sensitive - "filter" is NOT the same as "FiLtEr". | * The language is case sensitive - "filter" is NOT the same as "FiLtEr". | ||
Some of the functions return '''<code> | Some of the functions return '''<code>PatternSeq</code>''' while other return '''<code>Pattern</code>'''. | ||
* '''<code> | * '''<code>Pattern</code>''' is a set of atoms. | ||
* '''<code> | * '''<code>PatternSeq</code>''' is a sequence of '''<code>Pattern</code>''' (the sets of atoms). | ||
When a molecule is queried, say using the expression <code>Rings(5 * ["C"] + ["O"])</code> a sequences of patterns 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 pattern (the set of atoms) - not the whole sequences. The query <code>Residues().Filter(lambda r: r.Count(Atoms()) > 10)</code> first finds all residue patterns ('''<code>PatternSeq</code>''') and then passes every single '''<code>Pattern</code>''' (set of atoms) to a function that counts the atoms in the pattern and returns True if there is at least 11 of them. This is the reasoning behind these two types. | |||
== Basic Query Functions == | == Basic Query Functions == | ||
''Basic building blocks of the language - i.e. atoms, residues, and the like.'' | ''Basic building blocks of the language - i.e. atoms, residues, and the like.'' | ||
=== AminoAcids === | === AminoAcids === | ||
<code>AminoAcids() -> Residues</code><br/> | <code>AminoAcids() -> Residues</code><br/> | ||
''Sequence of all amino | ''Sequence of all residues with the 20 basic amino acid names.''<br/> | ||
;Options | ;Options | ||
: ChargeType: String = "" - ''Specify type of the charge. Allowed values: Positive, Negative, Aromatic, Polar, NonPolar.'' | : ChargeType: String = "" - ''Specify type of the charge. Allowed values: Positive, Negative, Aromatic, Polar, NonPolar.'' | ||
Line 55: | Line 35: | ||
: <code>AtomIdRange(152, 161)</code> | : <code>AtomIdRange(152, 161)</code> | ||
:: ''Returns all atoms with id between 152 and 161 inclusive.'' | :: ''Returns all atoms with id between 152 and 161 inclusive.'' | ||
---- | |||
=== AtomIds === | |||
<code>AtomIds(ids: Integer+) -> Atoms</code><br/> | |||
''Sequence of atoms with specified identifiers.''<br/> | |||
;Arguments | |||
: ids: Integer+ - ''Identifiers.'' | |||
;Examples | |||
: <code>AtomIds(1, 2, 3)</code> | |||
:: ''Returns atoms with ids 1, 2, 3.'' | |||
---- | ---- | ||
=== AtomNames === | === AtomNames === | ||
Line 67: | Line 56: | ||
=== Atoms === | === Atoms === | ||
<code>Atoms(symbols: String*) -> Atoms</code><br/> | <code>Atoms(symbols: String*) -> Atoms</code><br/> | ||
''Sequence of atoms with specified element symbols. If no symbols are specified, yields all atoms one by one | ''Sequence of atoms with specified element symbols. If no symbols are specified, yields all atoms one by one.''<br/> | ||
;Arguments | ;Arguments | ||
: symbols: String* - ''Allowed element symbols.'' | : symbols: String* - ''Allowed element symbols.'' | ||
Line 73: | Line 62: | ||
: <code>Atoms("Zn","Ca")</code> | : <code>Atoms("Zn","Ca")</code> | ||
:: ''Returns all atoms with element symbol Zn or Ca'' | :: ''Returns all atoms with element symbol Zn or Ca'' | ||
---- | |||
=== Chains === | |||
<code>Chains(identifiers: Value*) -> PatternSeq</code><br/> | |||
''Splits the structures into chains. If no identifiers are specified, all chains are returned.''<br/> | |||
;Arguments | |||
: identifiers: Value* - ''Chain identifiers.'' | |||
;Examples | |||
: <code>Chains()</code> | |||
:: ''Returns all chains.'' | |||
: <code>Chains("")</code> | |||
:: ''Returns chains without specific identifier.'' | |||
: <code>Chains("A", "B")</code> | |||
:: ''Returns chains A and B.'' | |||
---- | |||
=== Helices === | |||
<code>Helices() -> PatternSeq</code><br/> | |||
''Returns all helices. This assumes the information about helices was present in the input structure.''<br/> | |||
;Examples | |||
: <code>Helices()</code> | |||
:: ''Returns all helices.'' | |||
---- | |||
=== HetResidues === | |||
<code>HetResidues() -> Residues</code><br/> | |||
''Sequence of all residues that contain HET atoms.''<br/> | |||
;Options | |||
: NoWaters: Bool = True - ''Ignore water residues such as HOH.'' | |||
;Examples | |||
: <code>HetResidues()</code> | |||
:: ''Returns all residues that contain HET atoms (ignores water).'' | |||
: <code>HetResidues(NoWaters=False)</code> | |||
:: ''Returns all residues that contain HET atoms (includes water).'' | |||
---- | |||
=== ModifiedResidues === | |||
<code>ModifiedResidues(parentNames: String*) -> Residues</code><br/> | |||
''Sequence of modified residues that originate from the specified name. If no names are specified, yields all modified residues one by one.''<br/> | |||
;Arguments | |||
: parentNames: String* - ''Parent residue names.'' | |||
;Examples | |||
: <code>ModifiedResidues("MET")</code> | |||
:: ''Returns all residues modified from MET (for example MSE).'' | |||
---- | ---- | ||
=== Named === | === Named === | ||
<code>Named( | <code>Named(patterns: PatternSeq) -> PatternSeq</code><br/> | ||
'''Names' the | '''Names' the pattern by its lowest atom id.''<br/> | ||
;Arguments | ;Arguments | ||
: | : patterns: PatternSeq - ''Patterns to name.'' | ||
;Examples | ;Examples | ||
: <code>Atoms("Zn").Named().AmbientAtoms(7)</code> | : <code>Atoms("Zn").Named().AmbientAtoms(7)</code> | ||
:: ''When exported, the result files will have names in the format '[parent id]_[pseudorandom | :: ''When exported, the result files will have names in the format '[parent id]_[pseudorandom number]_[zn atomid]'. If the Named function was not used, the name would be just '[parent id]_[pseudorandom number]'.'' | ||
---- | ---- | ||
=== NotAminoAcids === | === NotAminoAcids === | ||
<code>NotAminoAcids() -> Residues</code><br/> | <code>NotAminoAcids() -> Residues</code><br/> | ||
''Sequence of all residues | ''Sequence of all residues that are not any of the 20 basic amino acids.''<br/> | ||
;Options | ;Options | ||
: NoWaters: Bool = True - ''Ignore water residues such as HOH.'' | : NoWaters: Bool = True - ''Ignore water residues such as HOH.'' | ||
Line 91: | Line 120: | ||
: <code>NotAminoAcids()</code> | : <code>NotAminoAcids()</code> | ||
:: ''Returns all residues that are not amino acids.'' | :: ''Returns all residues that are not amino acids.'' | ||
---- | |||
=== NotAtomIds === | |||
<code>NotAtomIds(ids: Integer+) -> Atoms</code><br/> | |||
''Sequence of atoms that do not have specified identifiers.''<br/> | |||
;Arguments | |||
: ids: Integer+ - ''Identifiers.'' | |||
;Examples | |||
: <code>NotAtomIds(1, 2, 3)</code> | |||
:: ''Returns atoms that do not have id 1, 2, nor 3.'' | |||
---- | ---- | ||
=== NotAtomNames === | === NotAtomNames === | ||
Line 119: | Line 157: | ||
:: ''Returns all residues that are not THR or CYS.'' | :: ''Returns all residues that are not THR or CYS.'' | ||
---- | ---- | ||
=== | === RegularMotifs === | ||
<code> | <code>RegularMotifs(regex: Value) -> PatternSeq</code><br/> | ||
'' | ''Identifies regular motifs. The protein is split into individual chains and the residues are sorted by their Sequence Number before the motifs are identified. The query does not check if adjacent residues have consecutive Sequence Numbers. The query works in two modes: Amino and Nucleotide, on amino acids and nucleotides respectively. In the Amino mode, all the derivatives of standard residues are treated as the standard residues, as long as this information is properly annotated in MODRES or _pdbx_struct_mod_residue field. The default mode is 'Amino'''<br/> | ||
;Arguments | ;Arguments | ||
: regex: Value - ''Regular expression on one letter abbreviations of amino acids.'' | : regex: Value - ''Regular expression on one letter abbreviations of amino acids.'' | ||
;Options | |||
: Type: String = "Amino" - ''Determines the type of the query. Allowed values: Amino, Nucleotide.'' | |||
;Examples | ;Examples | ||
: <code> | : <code>RegularMotifs("RGD")</code> | ||
:: ''Finds all RGD | :: ''Finds all RGD motifs.'' | ||
: <code> | : <code>RegularMotifs("ACGTU", Type = 'Nucleotide')</code> | ||
:: ''Finds all 4 residue | :: ''Finds all consecutive occurrences of the ACGTU nucleotides.'' | ||
: <code>RegularMotifs(".HC.").Filter(lambda m: m.IsConnected())</code> | |||
:: ''Finds all 4 residue motifs with ?-HIS-CYS-? that are connected.'' | |||
---- | ---- | ||
=== ResidueIdRange === | === ResidueIdRange === | ||
Line 134: | Line 176: | ||
''Sequence of residues with specific chain and min <= sequence number <= max.''<br/> | ''Sequence of residues with specific chain and min <= sequence number <= max.''<br/> | ||
;Arguments | ;Arguments | ||
: chain: String - ''Chain | : chain: String - ''Chain identifier. Case sensitive (a != A).'' | ||
: min: Integer - ''Minimum sequence number.'' | : min: Integer - ''Minimum sequence number.'' | ||
: max: ?Integer - ''Maximum sequence number. If not specified, max = min.'' | : max: ?Integer - ''Maximum sequence number. If not specified, max = min.'' | ||
Line 140: | Line 182: | ||
: <code>ResidueIdRange("A", 161, 165)</code> | : <code>ResidueIdRange("A", 161, 165)</code> | ||
:: ''Returns all residues on chain A with seq. number between 161 and 165 inclusive.'' | :: ''Returns all residues on chain A with seq. number between 161 and 165 inclusive.'' | ||
---- | |||
=== ResidueIds === | |||
<code>ResidueIds(ids: String+) -> Residues</code><br/> | |||
''Sequence of residues with specific identifiers. If the structure does not contain a residue with the given identifier, it is skipped.''<br/> | |||
;Arguments | |||
: ids: String+ - ''One or more identifiers in the format 'NUMBER [CHAIN] [i:INSERTIONCODE]' (parameters in [] are optional, for example '175 i:12' or '143 B'). Case sensitive (a != A).'' | |||
;Examples | |||
: <code>ResidueIds("132 A", "178 A")</code> | |||
:: ''Returns residues A 123 and A 178 (provided the input structure contains them).'' | |||
---- | ---- | ||
=== Residues === | === Residues === | ||
<code>Residues(names: | <code>Residues(names: String*) -> Residues</code><br/> | ||
''Sequence of residues with specified names. If no names are specified, yields all residues one by one | ''Sequence of residues with specified names. If no names are specified, yields all residues one by one.''<br/> | ||
;Arguments | ;Arguments | ||
: names: | : names: String* - ''Allowed residue names.'' | ||
;Examples | ;Examples | ||
: <code>Residues("HIS", "CYS")</code> | : <code>Residues("HIS", "CYS")</code> | ||
Line 162: | Line 213: | ||
=== Rings === | === Rings === | ||
<code>Rings(atoms: Value*) -> Rings</code><br/> | <code>Rings(atoms: Value*) -> Rings</code><br/> | ||
''Sequence of rings with particular atoms. If no atoms are specified, yields all rings (cycles) one by one.''<br/> | ''Sequence of rings with particular atoms. If no atoms are specified, yields all rings (cycles) one by one. The order of atoms matters.''<br/> | ||
;Arguments | ;Arguments | ||
: atoms: Value* - ''Ring atoms.'' | : atoms: Value* - ''Ring atoms.'' | ||
;Examples | ;Examples | ||
: <code>Rings()</code> | |||
:: ''Returns all rings.'' | |||
: <code>Rings(5 * ["C"] + ["O"])</code> | : <code>Rings(5 * ["C"] + ["O"])</code> | ||
:: ''Returns all rings with 5C and 1O atoms.'' | :: ''Returns all rings with 5C and 1O atoms.'' | ||
: <code>Rings(["C", "C", "N", "C", "N"])</code> | |||
:: ''Returns all rings with C-C-N-C-N atoms.'' | |||
: <code>Or(Rings(["C", "C", "N", "C", "N"]), Rings(["C", "C", "C", "N", "N"]))</code> | |||
:: ''Returns all rings with C-C-N-C-N or C-C-C-N-N atoms.'' | |||
---- | |||
=== Sheets === | |||
<code>Sheets() -> PatternSeq</code><br/> | |||
''Returns all sheets. This assumes the information about sheets was present in the input structure.''<br/> | |||
;Examples | |||
: <code>Sheets()</code> | |||
:: ''Returns all sheets.'' | |||
<br/> | <br/> | ||
== Advanced Query Functions == | == Advanced Query Functions == | ||
''Advanced building blocks of the language.'' | ''Advanced building blocks of the language.'' | ||
=== Flatten === | |||
<code>Flatten(patterns: PatternSeq, selector: Pattern->PatternSeq) -> PatternSeq</code><br/> | |||
''Converts a sequence of sequence of patterns into a single 'flat' sequence.''<br/> | |||
;Arguments | |||
: patterns: PatternSeq - ''Patterns to project.'' | |||
: selector: Pattern->PatternSeq - ''The selector.'' | |||
;Examples | |||
: <code>Residues("HIS").Flatten(lambda m: m.Find(Atoms("C")))</code> | |||
:: ''Returns all C atoms on HIS residues.'' | |||
---- | |||
=== Inside === | === Inside === | ||
<code>Inside( | <code>Inside(patterns: PatternSeq, where: PatternSeq) -> PatternSeq</code><br/> | ||
''Finds | ''Finds patterns within another pattern. Equivalent to where.Flatten(lambda m: m.Find(patterns))''<br/> | ||
;Arguments | ;Arguments | ||
: | : patterns: PatternSeq - ''Patterns to find.'' | ||
: where: | : where: PatternSeq - ''Where to find them.'' | ||
;Examples | ;Examples | ||
: <code>Atoms("C").Inside(Residues("HIS"))</code> | : <code>Atoms("C").Inside(Residues("HIS"))</code> | ||
Line 182: | Line 256: | ||
---- | ---- | ||
=== Or === | === Or === | ||
<code>Or( | <code>Or(patterns: PatternSeq+) -> PatternSeq</code><br/> | ||
''Merges several | ''Merges several pattern sequences into one.''<br/> | ||
;Arguments | ;Arguments | ||
: | : patterns: PatternSeq+ - ''Patterns to merge.'' | ||
;Examples | ;Examples | ||
: <code>Or(Atoms("Zn").ConnectedResidues(1), Rings())</code> | : <code>Or(Atoms("Zn").ConnectedResidues(1), Rings())</code> | ||
:: ''Finds all zincs and their connected residues or rings.'' | :: ''Finds all zincs and their connected residues or rings.'' | ||
---- | ---- | ||
=== ToAtoms === | === ToAtoms === | ||
<code>ToAtoms( | <code>ToAtoms(patterns: PatternSeq) -> PatternSeq</code><br/> | ||
''Collects all 'inner' | ''Collects all 'inner' patterns and yields all unique atoms one by one.''<br/> | ||
;Arguments | ;Arguments | ||
: | : patterns: PatternSeq - ''Patterns to split.'' | ||
;Examples | ;Examples | ||
: <code>Residues("HIS").ToAtoms()</code> | : <code>Residues("HIS").ToAtoms()</code> | ||
Line 210: | Line 274: | ||
---- | ---- | ||
=== ToResidues === | === ToResidues === | ||
<code>ToResidues( | <code>ToResidues(patterns: PatternSeq) -> PatternSeq</code><br/> | ||
''Collects all 'inner' | ''Collects all 'inner' patterns and yields all unique residues one by one. The residues contain only the atoms that have been yielded by the inner query.''<br/> | ||
;Arguments | ;Arguments | ||
: | : patterns: PatternSeq - ''Patterns to split.'' | ||
;Examples | ;Examples | ||
: <code> | : <code>Atoms("C").ToResidues()</code> | ||
:: ''Returns all C atoms grouped by residues.'' | :: ''Returns all C atoms grouped by residues.'' | ||
---- | ---- | ||
=== Union === | === Union === | ||
<code>Union( | <code>Union(patterns: PatternSeq) -> PatternSeq</code><br/> | ||
''Collects all 'inner' | ''Collects all 'inner' patterns and yields one created from their unique atoms.''<br/> | ||
;Arguments | ;Arguments | ||
: | : patterns: PatternSeq - ''Patterns to merge.'' | ||
;Examples | ;Examples | ||
: <code>Rings().Union()</code> | : <code>Rings().Union()</code> | ||
:: ''Creates a single | :: ''Creates a single pattern that contains all rings.'' | ||
<br/> | <br/> | ||
== Filter Functions == | == Filter Functions == | ||
''Functions useful for filtering | ''Functions useful for filtering patterns.'' | ||
=== Contains === | |||
<code>Contains(where: Pattern, what: PatternSeq) -> Bool</code><br/> | |||
''Checks if a pattern is contained within another one. Equivalent to where.Count(what) > 0.''<br/> | |||
;Arguments | |||
: where: Pattern - ''Where to look.'' | |||
: what: PatternSeq - ''What to find.'' | |||
;Examples | |||
: <code>HetResidues().Filter(lambda m: m.Contains(Rings(5*['C']+['O'])).Not())</code> | |||
:: ''Returns all HET residues that do not contain a 5CO ring.'' | |||
---- | |||
=== Count === | === Count === | ||
<code>Count(where: | <code>Count(where: Pattern, what: PatternSeq) -> Integer</code><br/> | ||
''Counts all | ''Counts all occurrences of pattern 'what' in pattern 'where'.''<br/> | ||
;Arguments | ;Arguments | ||
: where: | : where: Pattern - ''Where to count it.'' | ||
: what: | : what: PatternSeq - ''What pattern to count.'' | ||
;Examples | ;Examples | ||
: <code>m.Count(Residues("HIS"))</code> | : <code>m.Count(Residues("HIS"))</code> | ||
:: ''Returns the count of HIS residues in the | :: ''Returns the count of HIS residues in the pattern m. Where m is a Pattern (for example when using the Filter function or returned by the ToPattern() 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> | : <code>Atoms("Zn").ConnectedResidues(1).Filter(lambda m: m.Count(Residues("HIS")) == 2)</code> | ||
:: '' | :: ''Patterns with Zn atoms and its connected residues with exactly 2 HIS residues.'' | ||
---- | |||
=== ExecuteIf === | |||
<code>ExecuteIf(query: PatternSeq, condition: Pattern->Bool) -> PatternSeq</code><br/> | |||
''Executes a query only if the condition is met. Otherwise, return an empty sequence of patterns.''<br/> | |||
;Arguments | |||
: query: PatternSeq - ''Query to execute.'' | |||
: condition: Pattern->Bool - ''Condition that must be satisfied for the parent structure/pattern.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.Resolution() <= 2.4)</code> | |||
:: ''Returns residues in structures that have resolution lower than 2.4ang.'' | |||
: <code>AminoAcids().ExecuteIf(lambda p: p.Count(Atoms('Fe')) > 3)</code> | |||
:: ''Returns all amino acids in structures that have at least 3 Fe atoms.'' | |||
---- | ---- | ||
=== Filter === | === Filter === | ||
<code>Filter( | <code>Filter(patterns: PatternSeq, filter: Pattern->Bool) -> PatternSeq</code><br/> | ||
''Filters a sequence of | ''Filters a sequence of patterns with a given predicate.''<br/> | ||
;Arguments | ;Arguments | ||
: | : patterns: PatternSeq - ''Patterns to filter.'' | ||
: filter: | : filter: Pattern->Bool - ''Filter predicate.'' | ||
;Examples | ;Examples | ||
: <code>Residues().Filter(lambda m: m.Count(Atoms("C")) >= 3)</code> | : <code>Residues().Filter(lambda m: m.Count(Atoms("C")) >= 3)</code> | ||
Line 252: | Line 338: | ||
---- | ---- | ||
=== IsConnected === | === IsConnected === | ||
<code>IsConnected( | <code>IsConnected(pattern: Pattern) -> Bool</code><br/> | ||
''Checks if a particular | ''Checks if a particular pattern is a connected graph.''<br/> | ||
;Arguments | ;Arguments | ||
: | : pattern: Pattern - ''A pattern to test.'' | ||
;Examples | ;Examples | ||
: <code>Atoms("Zn").AmbientResidues(3).Filter(lambda m: m.IsConnected())</code> | : <code>Atoms("Zn").AmbientResidues(3).Filter(lambda m: m.IsConnected())</code> | ||
:: ''Finds all | :: ''Finds all patterns with a Zn and residues within 3 ang, where all the ambient residues are connected to the central atom.'' | ||
---- | ---- | ||
=== IsConnectedTo === | === IsConnectedTo === | ||
<code>IsConnectedTo( | <code>IsConnectedTo(where: Pattern, patterns: PatternSeq) -> Bool</code><br/> | ||
''Checks if a particular | ''Checks if a particular pattern is connected to any other specified pattern. The patterns must have empty intersection for this function to return true.''<br/> | ||
;Arguments | ;Arguments | ||
: | : where: Pattern - ''A pattern to test.'' | ||
: | : patterns: PatternSeq - ''Pattern sequence to test against.'' | ||
;Examples | ;Examples | ||
: <code>Atoms().Filter(lambda a: a.IsConnectedTo(Rings()))</code> | : <code>Atoms().Filter(lambda a: a.IsConnectedTo(Rings()))</code> | ||
Line 271: | Line 357: | ||
---- | ---- | ||
=== IsNotConnectedTo === | === IsNotConnectedTo === | ||
<code>IsNotConnectedTo( | <code>IsNotConnectedTo(what: Pattern, patterns: PatternSeq) -> Bool</code><br/> | ||
''Checks if a particular | ''Checks if a particular pattern is not connected to any other specified pattern. The patterns must have empty intersection for this function to return true.''<br/> | ||
;Arguments | ;Arguments | ||
: | : what: Pattern - ''A pattern to test.'' | ||
: | : patterns: PatternSeq - ''Pattern sequence to test against.'' | ||
;Examples | ;Examples | ||
: <code>Residues().Filter(lambda r: r.IsNotConnectedTo(Atoms("Ca")))</code> | : <code>Residues().Filter(lambda r: r.IsNotConnectedTo(Atoms("Ca")))</code> | ||
Line 281: | Line 367: | ||
---- | ---- | ||
=== NearestDistanceTo === | === NearestDistanceTo === | ||
<code>NearestDistanceTo( | <code>NearestDistanceTo(where: Pattern, patterns: PatternSeq) -> Real</code><br/> | ||
''Finds the distance to a particular | ''Finds the distance to a particular pattern.''<br/> | ||
;Arguments | ;Arguments | ||
: | : where: Pattern - ''A pattern to test.'' | ||
: | : patterns: PatternSeq - ''Pattern sequence to test against.'' | ||
;Examples | ;Examples | ||
: <code>Atoms().Filter(lambda m: m.NearestDistanceTo(Residues("ASP")) >= 5)</code> | : <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.'' | :: ''Finds all atoms that are at least 5 (angstroms) away from any ASP residue.'' | ||
---- | |||
=== SeqCount === | |||
<code>SeqCount(what: PatternSeq) -> Integer</code><br/> | |||
''Counts the length of a sequence of motifs.''<br/> | |||
;Arguments | |||
: what: PatternSeq - ''What pattern sequence to count.'' | |||
;Examples | |||
: <code>Atoms("Zn").AmbientResidues(3).Filter(lambda m: m.Find(Residues("HIS")).SeqCount() > 1)</code> | |||
:: ''Returns a sequence of patterns with Zn atom and residues within 3ang if the pattern contains at least 2 HIS residues.'' | |||
<br/> | <br/> | ||
== Topology Functions == | == Topology Functions == | ||
''Functions that rely on the topology of | ''Functions that rely on the topology of patterns.'' | ||
=== ConnectedAtoms === | === ConnectedAtoms === | ||
<code>ConnectedAtoms( | <code>ConnectedAtoms(pattern: PatternSeq, n: Integer) -> PatternSeq</code><br/> | ||
''Surrounds the inner | ''Surrounds the inner pattern by n layers of atoms.''<br/> | ||
;Arguments | ;Arguments | ||
: | : pattern: PatternSeq - ''Basic pattern.'' | ||
: n: Integer - ''Number of atom layers to connect.'' | : n: Integer - ''Number of atom layers to connect.'' | ||
;Options | ;Options | ||
: YieldNamedDuplicates: Bool = False - ''Yield duplicate | : YieldNamedDuplicates: Bool = False - ''Yield duplicate patterns if they have a different name.'' | ||
;Examples | ;Examples | ||
: <code>Residues("MAN").ConnectedAtoms(2)</code> | : <code>Residues("MAN").ConnectedAtoms(2)</code> | ||
Line 305: | Line 400: | ||
---- | ---- | ||
=== ConnectedResidues === | === ConnectedResidues === | ||
<code>ConnectedResidues( | <code>ConnectedResidues(pattern: PatternSeq, n: Integer) -> PatternSeq</code><br/> | ||
''Surrounds the inner | ''Surrounds the inner pattern by n layers of residues.''<br/> | ||
;Arguments | ;Arguments | ||
: | : pattern: PatternSeq - ''Basic pattern.'' | ||
: n: Integer - ''Number of residue layers to connect.'' | : n: Integer - ''Number of residue layers to connect.'' | ||
;Options | ;Options | ||
: YieldNamedDuplicates: Bool = False - ''Yield duplicate | : YieldNamedDuplicates: Bool = False - ''Yield duplicate patterns if they have a different name.'' | ||
;Examples | ;Examples | ||
: <code>Atoms("Zn").ConnectedResidues(1)</code> | : <code>Atoms("Zn").ConnectedResidues(1)</code> | ||
Line 317: | Line 412: | ||
---- | ---- | ||
=== Path === | === Path === | ||
<code>Path( | <code>Path(patterns: PatternSeq+) -> PatternSeq</code><br/> | ||
''Creates a new | ''Creates a new pattern from 'connected' parts.''<br/> | ||
;Arguments | ;Arguments | ||
: | : patterns: PatternSeq+ - ''Patterns to path.'' | ||
;Examples | ;Examples | ||
: <code>Path(Atoms("O"), Atoms("C"), Atoms("O"))</code> | : <code>Path(Atoms("O"), Atoms("C"), Atoms("O"))</code> | ||
:: ''Finds | :: ''Finds patterns with two O and one C atoms where the C atoms is connected to the O ones.'' | ||
---- | ---- | ||
=== Star === | === Star === | ||
<code>Star(center: | <code>Star(center: PatternSeq, patterns: PatternSeq+) -> PatternSeq</code><br/> | ||
''Creates a new | ''Creates a new pattern from a central one and connected parts.''<br/> | ||
;Arguments | ;Arguments | ||
: center: | : center: PatternSeq - ''Center pattern.'' | ||
: | : patterns: PatternSeq+ - ''Patterns to chain.'' | ||
;Examples | ;Examples | ||
: <code>Star(Atoms("C"), Atoms("O"), Atoms("O"))</code> | : <code>Star(Atoms("C"), Atoms("O"), Atoms("O"))</code> | ||
:: ''Finds | :: ''Finds patterns with two O atoms and one C atom in the center.'' | ||
: <code>Atoms("C").Star(Atoms("O"), Atoms("O"))</code> | : <code>Atoms("C").Star(Atoms("O"), Atoms("O"))</code> | ||
:: ''Finds | :: ''Finds patterns with two O atoms and one C atom in the center.'' | ||
<br/> | <br/> | ||
== Geometry Functions == | == Geometry Functions == | ||
''Functions that rely on the geometry of | ''Functions that rely on the geometry of patterns.'' | ||
=== AmbientAtoms === | === AmbientAtoms === | ||
<code>AmbientAtoms( | <code>AmbientAtoms(pattern: PatternSeq, r: Number) -> PatternSeq</code><br/> | ||
''Surrounds the inner | ''Surrounds the inner pattern by atoms that within the given radius from the inner pattern.''<br/> | ||
;Arguments | ;Arguments | ||
: | : pattern: PatternSeq - ''Basic pattern.'' | ||
: r: Number - ''Radius.'' | : r: Number - ''Radius.'' | ||
;Options | ;Options | ||
: ExcludeBase: Bool = False - ''Exclude the central original | : ExcludeBase: Bool = False - ''Exclude the central original pattern.'' | ||
: NoWaters: Bool = True - ''Ignore water residues such as HOH.'' | : NoWaters: Bool = True - ''Ignore water residues such as HOH.'' | ||
: YieldNamedDuplicates: Bool = False - ''Yield duplicate | : YieldNamedDuplicates: Bool = False - ''Yield duplicate patterns if they have a different name.'' | ||
;Examples | ;Examples | ||
: <code>Atoms("Fe").AmbientAtoms(4)</code> | : <code>Atoms("Fe").AmbientAtoms(4)</code> | ||
Line 354: | Line 449: | ||
---- | ---- | ||
=== AmbientResidues === | === AmbientResidues === | ||
<code>AmbientResidues( | <code>AmbientResidues(pattern: PatternSeq, r: Number) -> PatternSeq</code><br/> | ||
''Surrounds the inner | ''Surrounds the inner pattern by residues that have at least one atom within the given radius from the inner pattern.''<br/> | ||
;Arguments | ;Arguments | ||
: | : pattern: PatternSeq - ''Basic pattern.'' | ||
: r: Number - ''Radius.'' | : r: Number - ''Radius.'' | ||
;Options | ;Options | ||
: ExcludeBase: Bool = False - ''Exclude the central original | : ExcludeBase: Bool = False - ''Exclude the central original pattern.'' | ||
: NoWaters: Bool = True - ''Ignore water residues such as HOH.'' | : NoWaters: Bool = True - ''Ignore water residues such as HOH.'' | ||
: YieldNamedDuplicates: Bool = False - ''Yield duplicate | : YieldNamedDuplicates: Bool = False - ''Yield duplicate patterns if they have a different name.'' | ||
;Examples | ;Examples | ||
: <code>Rings(6 * ["C"]).AmbientResidues(4)</code> | : <code>Rings(6 * ["C"]).AmbientResidues(4)</code> | ||
Line 368: | Line 463: | ||
---- | ---- | ||
=== Cluster === | === Cluster === | ||
<code>Cluster(r: Number, | <code>Cluster(r: Number, patterns: PatternSeq+) -> PatternSeq</code><br/> | ||
''Clusters all | ''Clusters all patterns that are pairwise closer than r (angstroms).''<br/> | ||
;Arguments | ;Arguments | ||
: r: Number - ''Maximum distance between two | : r: Number - ''Maximum distance between two patterns in the cluster.'' | ||
: | : patterns: PatternSeq+ - ''Patterns to cluster.'' | ||
;Examples | ;Examples | ||
: <code>Cluster(4, Atoms("Ca"), Rings(5 * ["C"] + ["O"]))</code> | : <code>Cluster(4, Atoms("Ca"), Rings(5 * ["C"] + ["O"]))</code> | ||
Line 378: | Line 473: | ||
---- | ---- | ||
=== Filled === | === Filled === | ||
<code>Filled( | <code>Filled(pattern: PatternSeq) -> PatternSeq</code><br/> | ||
''Adds all atoms that fall within the circumsphere (with radius multiplied by the factor) of the basic | ''Adds all atoms that fall within the circumsphere (with radius multiplied by the factor) of the basic pattern.''<br/> | ||
;Arguments | ;Arguments | ||
: | : pattern: PatternSeq - ''Basic pattern.'' | ||
;Options | ;Options | ||
: NoWaters: Bool = True - ''Ignore water residues such as HOH.'' | : NoWaters: Bool = True - ''Ignore water residues such as HOH.'' | ||
Line 390: | Line 485: | ||
---- | ---- | ||
=== Near === | === Near === | ||
<code>Near(r: Number, | <code>Near(r: Number, patterns: PatternSeq+) -> PatternSeq</code><br/> | ||
''Clusters all | ''Clusters all patterns that are pairwise closer than r (angstroms) and checks if the "counts" match.''<br/> | ||
;Arguments | ;Arguments | ||
: r: Number - ''Maximum distance between two sub- | : r: Number - ''Maximum distance between two sub-patterns in the pattern.'' | ||
: | : patterns: PatternSeq+ - ''Patterns to 'cluster'.'' | ||
;Examples | ;Examples | ||
: <code>Near(4, | : <code>Near(4, Atoms("Ca"), Atoms("Ca"), 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).'' | :: ''Finds all instance of a single ring with 5C and O atoms and two Ca atoms that are closer than 4 (angstroms).'' | ||
---- | |||
=== Spherify === | |||
<code>Spherify(pattern: PatternSeq, r: Number) -> PatternSeq</code><br/> | |||
''Identifies the geometrical center of the base pattern and then includes all atoms within the specified radius.'' | |||
;Arguments | |||
: pattern: PatternSeq - ''Basic pattern.'' | |||
: r: Number - ''Radius.'' | |||
;Options | |||
: ExcludeBase: Bool = False - ''Exclude the central original pattern.'' | |||
: NoWaters: Bool = True - ''Ignore water residues such as HOH.'' | |||
: YieldNamedDuplicates: Bool = False - ''Yield duplicate patterns if they have a different name.'' | |||
;Examples | |||
<code>Rings(6 * ["C"]).Spherify(5)</code><br/> | |||
''Finds benzene moiety, computes centroid of each pattern, and includes all atoms within 5 angstroms from it. | |||
<br/> | |||
== Meta-data Functions == | |||
''Functions dealing with meta-data about structures such as release date or authors.'' | |||
=== Authors === | |||
<code>Authors(pattern: Pattern) -> String</code><br/> | |||
''Returns authors of the parent structure separated by a semicolon. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
---- | |||
=== ECNumbers === | |||
<code>ECNumbers(pattern: Pattern) -> String</code><br/> | |||
''Returns Enzymatic Commission numbers assigned to enzymes in the parent structure separated by a semicolon. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
---- | |||
=== EntitySources === | |||
<code>EntitySources(pattern: Pattern) -> String</code><br/> | |||
''Returns entity sources of the parent structure separated by a semicolon. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
---- | |||
=== ExperimentMethod === | |||
<code>ExperimentMethod(pattern: Pattern) -> String</code><br/> | |||
''Get the experiment method. The value is always an upper-case string. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.ExperimentMethod() == "INFRARED SPECTROSCOPY")</code> | |||
:: ''Returns residues in structures that satisfy the property.'' | |||
---- | |||
=== HasAllAuthors === | |||
<code>HasAllAuthors(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains all given authors. The comparison is case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAllAuthors("Holmes", "Watson"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAllECNumbers === | |||
<code>HasAllECNumbers(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains all given Enzymatic Commission numbers. It is possible to enter just a number prefix without the '.'. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAllECNumbers("3.2.1.18", "3.3"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAllEntitySources === | |||
<code>HasAllEntitySources(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains all given entity sources. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAllEntitySources("GMO", "Natural", "Synthetic"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAllHostOrganismGenus === | |||
<code>HasAllHostOrganismGenus(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains all given host organism identifiers. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAllHostOrganismGenus("X", "Y"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAllHostOrganismIds === | |||
<code>HasAllHostOrganismIds(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains all given host organism identifiers. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAllHostOrganismIds("7108", "11244"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAllHostOrganisms === | |||
<code>HasAllHostOrganisms(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains all given host organism names. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAllHostOrganisms("Spodoptera frugiperda", "Mus musculus"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAllKeywords === | |||
<code>HasAllKeywords(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains all given keywords. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAllKeywords("membrane", "glycoprotein"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAllOriginOrganismGenus === | |||
<code>HasAllOriginOrganismGenus(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains all given origin organism identifiers. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAllOriginOrganismGenus("X", "Y"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAllOriginOrganismIds === | |||
<code>HasAllOriginOrganismIds(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains all given origin organism identifiers. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAllOriginOrganismIds("121791", "10090"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAllOriginOrganisms === | |||
<code>HasAllOriginOrganisms(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains all given origin organism names. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAllOriginOrganisms("Nipah virus", "Mus musculus"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAnyAuthor === | |||
<code>HasAnyAuthor(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains any of the given authors. The comparison is case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAnyAuthor("Holmes", "Watson"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAnyECNumber === | |||
<code>HasAnyECNumber(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains any of the given Enzymatic Commission number. It is possible to enter just a number prefix without the '.'s. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAnyECNumber("3.2.1.19", "3.3"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAnyEntitySources === | |||
<code>HasAnyEntitySources(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains any of the given entity sources. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAnyEntitySources("GMO", "Natural", "Synthetic"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAnyHostOrganism === | |||
<code>HasAnyHostOrganism(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains any of the given host organism names. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAnyHostOrganism("Spodoptera frugiperda", "Mus musculus"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAnyHostOrganismGenus === | |||
<code>HasAnyHostOrganismGenus(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains any of the given host organism identifierss. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAnyHostOrganismGenus("X", "Y"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAnyHostOrganismId === | |||
<code>HasAnyHostOrganismId(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains any of the given host organism identifierss. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAnyHostOrganismId("7108", "11244"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAnyKeyword === | |||
<code>HasAnyKeyword(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains any of the given keywords. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAnyKeyword("membrane", "glycoprotein"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAnyOriginOrganism === | |||
<code>HasAnyOriginOrganism(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains any of the given origin organism names. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAnyOriginOrganism("Nipah virus", "Mus musculus"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAnyOriginOrganismGenus === | |||
<code>HasAnyOriginOrganismGenus(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains any of the given origin organism identifierss. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAnyOriginOrganismGenus("X", "Y"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HasAnyOriginOrganismId === | |||
<code>HasAnyOriginOrganismId(pattern: Pattern, properties: String+) -> Bool</code><br/> | |||
''Determines if the parent structure contains any of the given origin organism identifierss. The comparison is not case sensitive.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
: properties: String+ - ''Properties.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.HasAnyOriginOrganismId("121791", "10090"))</code> | |||
:: ''Returns residues in structures that contain all given properties.'' | |||
---- | |||
=== HostOrganismGenus === | |||
<code>HostOrganismGenus(pattern: Pattern) -> String</code><br/> | |||
''Returns host organism identifiers of the parent structure separated by a semicolon. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
---- | |||
=== HostOrganismIds === | |||
<code>HostOrganismIds(pattern: Pattern) -> String</code><br/> | |||
''Returns host organism identifiers of the parent structure separated by a semicolon. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
---- | |||
=== HostOrganisms === | |||
<code>HostOrganisms(pattern: Pattern) -> String</code><br/> | |||
''Returns host organism names of the parent structure separated by a semicolon. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
---- | |||
=== Keywords === | |||
<code>Keywords(pattern: Pattern) -> String</code><br/> | |||
''Returns keywords of the parent structure separated by a semicolon. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
---- | |||
=== LatestRevisionDate === | |||
<code>LatestRevisionDate(pattern: Pattern) -> Value</code><br/> | |||
''Get the latest revision date of the parent structure. The value has to be compared to the DateTime(year, month, day) object. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.LatestRevisionDate() >= DateTime(2008, 1, 1))</code> | |||
:: ''Returns residues in structures that satisfy the property.'' | |||
---- | |||
=== LatestRevisionYear === | |||
<code>LatestRevisionYear(pattern: Pattern) -> Integer</code><br/> | |||
''Get the latest revision year of the parent structure. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.LatestRevisionYear() == 2006)</code> | |||
:: ''Returns residues in structures that satisfy the property.'' | |||
---- | |||
=== OriginOrganismGenus === | |||
<code>OriginOrganismGenus(pattern: Pattern) -> String</code><br/> | |||
''Returns origin organism identifiers of the parent structure separated by a semicolon. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
---- | |||
=== OriginOrganismIds === | |||
<code>OriginOrganismIds(pattern: Pattern) -> String</code><br/> | |||
''Returns origin organism identifiers of the parent structure separated by a semicolon. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
---- | |||
=== OriginOrganisms === | |||
<code>OriginOrganisms(pattern: Pattern) -> String</code><br/> | |||
''Returns origin organism names of the parent structure separated by a semicolon. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
---- | |||
=== PolymerType === | |||
<code>PolymerType(pattern: Pattern) -> String</code><br/> | |||
''Get the polymer type of the structure. Possible values are: NotAssigned, Protein, DNA, RNA, ProteinDNA, ProteinRNA, NucleicAcids, Mixture, Sugar, Other. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.PolymerType() == "ProteinDNA")</code> | |||
:: ''Returns residues in structures that satisfy the property.'' | |||
---- | |||
=== ProteinStoichiometry === | |||
<code>ProteinStoichiometry(pattern: Pattern) -> String</code><br/> | |||
''Get the protein stoichiometry of the parent structure. Possible values are: NotAssigned, Monomer, Homomer, Heteromer. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.ProteinStoichiometry() == "Heteromer")</code> | |||
:: ''Returns residues in structures that satisfy the property.'' | |||
---- | |||
=== ProteinStoichiometryString === | |||
<code>ProteinStoichiometryString(pattern: Pattern) -> String</code><br/> | |||
''Get the protein stoichiometry string of the parent structure. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
---- | |||
=== ReleaseDate === | |||
<code>ReleaseDate(pattern: Pattern) -> Value</code><br/> | |||
''Get the release date of the parent structure. The value has to be compared to the DateTime(year, month, day) object. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.ReleaseDate() >= DateTime(2008, 1, 1))</code> | |||
:: ''Returns residues in structures that satisfy the property.'' | |||
---- | |||
=== ReleaseYear === | |||
<code>ReleaseYear(pattern: Pattern) -> Integer</code><br/> | |||
''Get the release year of the parent structure. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.ReleaseYear() == 2006)</code> | |||
:: ''Returns residues in structures that satisfy the property.'' | |||
---- | |||
=== Resolution === | |||
<code>Resolution(pattern: Pattern) -> Real</code><br/> | |||
''Get the resolution in angstroms of the parent structure. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.Resolution() <= 2.4)</code> | |||
:: ''Returns residues in structures that satisfy the property.'' | |||
---- | |||
=== Weight === | |||
<code>Weight(pattern: Pattern) -> Real</code><br/> | |||
''Get the weight of the molecule in kDa. If the value is not available, null is returned.''<br/> | |||
;Arguments | |||
: pattern: Pattern - ''Pattern.'' | |||
;Examples | |||
: <code>Residues().ExecuteIf(lambda p: p.Weight() > 100000.0)</code> | |||
:: ''Returns residues in structures that satisfy the property.'' | |||
<br/> | <br/> | ||
== Miscellaneous Functions == | == Miscellaneous Functions == | ||
''Various useful functions. These function often require a special setup (i.e. only useful in Scripting window or in specific applications).'' | ''Various useful functions. These function often require a special setup (i.e. only useful in Scripting window or in specific applications).'' | ||
=== AminoSequenceString === | === AminoSequenceString === | ||
<code>AminoSequenceString( | <code>AminoSequenceString(pattern: Pattern) -> String</code><br/> | ||
''Returns a string of single-letter amino acids contained in the | ''Returns a string of single-letter amino acids contained in the pattern.''<br/> | ||
<small>''Note:'' This function cannot be used directly to query | <small>''Note:'' This function cannot be used directly to query patterns from MotiveExplorer or Queries service.</small><br/> | ||
;Arguments | ;Arguments | ||
: | : pattern: Pattern - ''Pattern to convert.'' | ||
;Examples | ;Examples | ||
: <code> | : <code>Pattern("1tqn_12").AminoSequenceString()</code> | ||
:: ''Returns a string representing amino acids in the | :: ''Returns a string representing amino acids in the pattern '1tqn_12'.'' | ||
: <code> | : <code>RegularMotifs(Pattern("1tqn_12").AminoSequenceString())</code> | ||
:: ''Returns all regular | :: ''Returns all regular patterns that correspond to the AMK sequence in 1tqn_12.'' | ||
---- | ---- | ||
=== AtomProperty === | === AtomProperty === | ||
<code>AtomProperty( | <code>AtomProperty(atomPattern: Pattern, name: String) -> ?</code><br/> | ||
''If the property exists and the | ''If the property exists and the pattern consists of a single atom, returns the property. Otherwise, returns Nothing.''<br/> | ||
<small>''Note:'' This function cannot be used directly to query | <small>''Note:'' This function cannot be used directly to query patterns from MotiveExplorer or Queries service.</small><br/> | ||
;Arguments | ;Arguments | ||
: | : atomPattern: Pattern - ''Single atom pattern.'' | ||
: name: String - ''Property name.'' | : name: String - ''Property name.'' | ||
;Examples | ;Examples | ||
: <code>a. | : <code>a.AtomProperty("charge")</code> | ||
:: ''Gets the 'charge' property of the atom a. Where a is a single atom | :: ''Gets the 'charge' property of the atom a. Where a is a single atom Pattern. This example will not work directly.'' | ||
: <code>Atoms().Filter(lambda a: a. | : <code>Atoms().Filter(lambda a: a.AtomProperty("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.'' | :: ''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 === | === AtomSimilarity === | ||
<code>AtomSimilarity(a: | <code>AtomSimilarity(a: Pattern, b: Pattern) -> Real</code><br/> | ||
''Computes Jaccard/Tanimoto coefficient on atoms (element symbols) of both structures.''<br/> | ''Computes Jaccard/Tanimoto coefficient on atoms (element symbols) of both structures.''<br/> | ||
<small>''Note:'' This function cannot be used directly to query | <small>''Note:'' This function cannot be used directly to query patterns from MotiveExplorer or Queries service.</small><br/> | ||
;Arguments | ;Arguments | ||
: a: | : a: Pattern - ''First pattern.'' | ||
: b: | : b: Pattern - ''Second pattern.'' | ||
;Examples | ;Examples | ||
: <code>AtomSimilarity(Current(), | : <code>AtomSimilarity(Current(),Pattern("1tqn_12"))</code> | ||
:: ''Computes the atom similarity between the current | :: ''Computes the atom similarity between the current pattern and 1tqn_12. This example can be used in SiteBinder to create a descriptor (assuming a structure with id '1tqn_12' is loaded).'' | ||
---- | ---- | ||
=== CommonAtoms === | === CommonAtoms === | ||
<code>CommonAtoms(modelId: String) -> | <code>CommonAtoms(modelId: String) -> PatternSeq</code><br/> | ||
''Returns a single | ''Returns a single pattern with atoms common with the model. Properties checked: atom id, element symbol, chain, residue number. This query is useful for example for atom selection in SiteBinder.''<br/> | ||
<small>''Note:'' This function cannot be used directly to query | <small>''Note:'' This function cannot be used directly to query patterns from MotiveExplorer or Queries service.</small><br/> | ||
;Arguments | ;Arguments | ||
: modelId: String - ''Id of the model.'' | : modelId: String - ''Id of the model.'' | ||
;Examples | ;Examples | ||
: <code>CommonAtoms("1tqn_12")</code> | : <code>CommonAtoms("1tqn_12")</code> | ||
:: ''Returns a | :: ''Returns a pattern formed by atoms common with the '1tqn_12' structure.'' | ||
---- | ---- | ||
=== CSA === | === CSA === | ||
<code>CSA() -> | <code>CSA() -> PatternSeq</code><br/> | ||
''Entries from Catalytic Site Atlas represented as | ''Entries from Catalytic Site Atlas represented as patterns. Works only if used from the command line version of Queries and property configured.''<br/> | ||
<small>''Note:'' This function cannot be used directly to query | <small>''Note:'' This function cannot be used directly to query patterns from MotiveExplorer or Queries service.</small><br/> | ||
;Examples | ;Examples | ||
: <code>CSA()</code> | : <code>CSA()</code> | ||
:: ''All CSA sites for the given structure. This example will only work if used from the command line version of | :: ''All CSA sites for the given structure. This example will only work if used from the command line version of Queries and property configured.'' | ||
---- | ---- | ||
=== Current === | === Current === | ||
<code>Current() -> | <code>Current() -> Pattern</code><br/> | ||
''A variable that is assigned by the application environment.''<br/> | ''A variable that is assigned by the application environment.''<br/> | ||
<small>''Note:'' This function cannot be used directly to query | <small>''Note:'' This function cannot be used directly to query patterns from MotiveExplorer or Queries service.</small><br/> | ||
;Examples | ;Examples | ||
: <code>AtomSimilarity(Current(), | : <code>AtomSimilarity(Current(), Pattern("model"))</code> | ||
:: ''Returns the atom similarity of the current | :: ''Returns the atom similarity of the current pattern 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 === | === Descriptor === | ||
<code>Descriptor( | <code>Descriptor(pattern: Pattern, name: String) -> ?</code><br/> | ||
''Returns the descriptor. If the descriptor does not exist, 'null' is returned.''<br/> | ''Returns the descriptor. If the descriptor does not exist, 'null' is returned.''<br/> | ||
<small>''Note:'' This function cannot be used directly to query | <small>''Note:'' This function cannot be used directly to query patterns from MotiveExplorer or Queries service.</small><br/> | ||
;Arguments | ;Arguments | ||
: | : pattern: Pattern - ''Pattern that represents entire structure.'' | ||
: name: String - ''Descriptor name.'' | : name: String - ''Descriptor name.'' | ||
;Examples | ;Examples | ||
: <code>Current().Descriptor("similarity") >= 0.75</code> | : <code>Current().Descriptor("similarity") >= 0.75</code> | ||
:: ''Returns True if 'similarity' descriptor of the current | :: ''Returns True if 'similarity' descriptor of the current pattern is at least 0.75. This example will work for example in SiteBinder's structure selection if the 'similarity' descriptor has been previously defined.'' | ||
---- | |||
=== DynamicInvoke === | |||
<code>DynamicInvoke(value: Value, name: String, isProperty: Bool, args: Value) -> Value</code><br/> | |||
''Dynamically invoke a member. (internal)''<br/> | |||
<small>''Note:'' This function cannot be used directly to query patterns from MotiveExplorer or Queries service.</small><br/> | |||
;Arguments | |||
: value: Value - ''InnerQuery.'' | |||
: name: String - ''Member name.'' | |||
: isProperty: Bool - ''Is this a property.'' | |||
: args: Value - ''Array of arguments.'' | |||
---- | ---- | ||
=== Find === | === Find === | ||
<code>Find(source: | <code>Find(source: Pattern, patterns: PatternSeq) -> PatternSeq</code><br/> | ||
''Converts the source | ''Converts the source pattern to a structure and finds patterns within it.''<br/> | ||
<small>''Note:'' This function cannot be used directly to query | <small>''Note:'' This function cannot be used directly to query patterns from MotiveExplorer or Queries service.</small><br/> | ||
;Arguments | ;Arguments | ||
: source: | : source: Pattern - ''Where to look.'' | ||
: | : patterns: PatternSeq - ''Patterns to find.'' | ||
;Examples | |||
: <code>AtomSimilarity(Current().Find(NotAtoms("N")).ToPattern(), Pattern("model").Find(NotAtoms("N")).ToPattern())</code> | |||
:: ''Computes the atom similarity of the 'current' and 'model' patterns, but ignores N atoms. This example can be used in SiteBinder to create a descriptor (assuming a structure with id 'model' is loaded).'' | |||
---- | |||
=== GroupedAtoms === | |||
<code>GroupedAtoms(symbols: String*) -> PatternSeq</code><br/> | |||
''Groups atoms using the element symbol and then returns each group as a single pattern.''<br/> | |||
<small>''Note:'' This function cannot be used directly to query patterns from MotiveExplorer or Queries service.</small><br/> | |||
;Arguments | |||
: symbols: String* - ''Allowed element symbols.'' | |||
;Examples | ;Examples | ||
: <code> | : <code>GroupedAtoms()</code> | ||
:: '' | :: ''Returns groups of all atom types. For example if the input has atoms 5xC-1xO, patterns with 5xC and 1xO atoms are returned.'' | ||
: <code>GroupedAtoms('C', 'O')</code> | |||
:: ''Returns groups of all atom types. For example if the input has atoms 5xC-1xO-6xH, patterns with 5xC and 1xO atoms are returned (but the H atoms are ignored).'' | |||
---- | ---- | ||
=== | === Pattern === | ||
<code> | <code>Pattern(structureName: String) -> Pattern</code><br/> | ||
''Returns a structure represented a | ''Returns a structure represented as a pattern.''<br/> | ||
<small>''Note:'' This function cannot be used directly to query | <small>''Note:'' This function cannot be used directly to query patterns from MotiveExplorer or Queries service.</small><br/> | ||
;Arguments | ;Arguments | ||
: structureName: String - ''Name of a structure.'' | : structureName: String - ''Name of a structure.'' | ||
;Examples | ;Examples | ||
: <code> | : <code>Pattern("1tqn_12")</code> | ||
:: ''Returns the structure '1tqn_12' represented as a | :: ''Returns the structure '1tqn_12' represented as a pattern. Usable in defining descriptors or in Scripting window (using MQ.Execute).'' | ||
---- | ---- | ||
=== ResidueSimilarity === | === ResidueSimilarity === | ||
<code>ResidueSimilarity(a: | <code>ResidueSimilarity(a: Pattern, b: Pattern) -> Real</code><br/> | ||
''Computes Jaccard/Tanimoto coefficient on residue names of both structures.''<br/> | ''Computes Jaccard/Tanimoto coefficient on residue names of both structures.''<br/> | ||
<small>''Note:'' This function cannot be used directly to query | <small>''Note:'' This function cannot be used directly to query patterns from MotiveExplorer or Queries service.</small><br/> | ||
;Arguments | ;Arguments | ||
: a: | : a: Pattern - ''First pattern.'' | ||
: b: | : b: Pattern - ''Second pattern.'' | ||
;Examples | ;Examples | ||
: <code>ResidueSimilarity(Current(), | : <code>ResidueSimilarity(Current(), Pattern("1tqn_12"))</code> | ||
:: ''Computes the residue similarity between the current | :: ''Computes the residue similarity between the current pattern and '1tqn_12'. This example can be used in SiteBinder to create a descriptor (assuming a structure with id '1tqn_12' is loaded).'' | ||
---- | ---- | ||
=== | === ToPattern === | ||
<code> | <code>ToPattern(patterns: PatternSeq) -> Pattern</code><br/> | ||
''Converts a sequence of | ''Converts a sequence of Patterns (AtomSetSeq) to a single Pattern by merging all atoms into a single atom set. The Pattern type is required by some function such as AtomSimilarity.''<br/> | ||
<small>''Note:'' This function cannot be used directly to query | <small>''Note:'' This function cannot be used directly to query patterns from MotiveExplorer or Queries service.</small><br/> | ||
;Arguments | ;Arguments | ||
: | : patterns: PatternSeq - ''Patterns to convert.'' | ||
;Examples | ;Examples | ||
: <code>Residues("HIS"). | : <code>Residues("HIS").ToPattern()</code> | ||
:: ''Converts a sequence of HIS residue | :: ''Converts a sequence of HIS residue Patterns to a single Pattern.'' | ||
: <code>AtomSimilarity(Current().Find(NotAtoms("N")). | : <code>AtomSimilarity(Current().Find(NotAtoms("N")).ToPattern(), Pattern("model").Find(NotAtoms("N")).ToPattern())</code> | ||
:: ''Computes the atom similarity of the 'current' and 'model' | :: ''Computes the atom similarity of the 'current' and 'model' patterns, but ignores N atoms.'' | ||
<br/> | <br/> | ||
== Value Functions == | == Value Functions == | ||
Line 604: | Line 1,085: | ||
: x: Bool - ''Argument.'' | : x: Bool - ''Argument.'' | ||
;Examples | ;Examples | ||
: <code> | : <code>LogicalNot(x)</code> | ||
:: ''Evaluates to True or False based on the value of x.'' | :: ''Evaluates to True or False based on the value of x.'' | ||
: <code>x.Not()</code> | : <code>x.Not()</code> |
Latest revision as of 12:38, 11 July 2016
Introduction
[edit]PatternQuery (PQ) is a user friendly chemical language primarily designed for defining atom patterns in molecules. PQ combines the clarity and brevity of programming languages with the versatility of natural language, aiming for an efficient inclusion of chemical and biochemical knowledge into the definition of patterns. PQ allows definitions based on chemical connectivity and three-dimensional structure at the same time. Additionally, in the case of molecules based on residue chains (such as proteins, nucleic acids, saccharides, etc.), PQ allows the user to include any amount of information regarding the residue level structure directly into the definition of the patternss.
PatternQuery is a subset of the Python programming language. Therefore, if you have experience with it, it should not be a problem to use PQ as well.
- The language is case sensitive - "filter" is NOT the same as "FiLtEr".
Some of the functions return PatternSeq
while other return Pattern
.
Pattern
is a set of atoms.PatternSeq
is a sequence ofPattern
(the sets of atoms).
When a molecule is queried, say using the expression Rings(5 * ["C"] + ["O"])
a sequences of patterns each containing 6 atoms (5 C and 1 O) is returned. However, some functions such as Filter
need to operate on a single pattern (the set of atoms) - not the whole sequences. The query Residues().Filter(lambda r: r.Count(Atoms()) > 10)
first finds all residue patterns (PatternSeq
) and then passes every single Pattern
(set of atoms) to a function that counts the atoms in the pattern and returns True if there is at least 11 of them. This is the reasoning behind these two types.
Basic Query Functions
[edit]Basic building blocks of the language - i.e. atoms, residues, and the like.
AminoAcids
[edit]AminoAcids() -> Residues
Sequence of all residues with the 20 basic amino acid names.
- Options
- ChargeType: String = "" - Specify type of the charge. Allowed values: Positive, Negative, Aromatic, Polar, NonPolar.
- Examples
AminoAcids()
- All amino acids.
AminoAcids(ChargeType = "Polar")
- Amino acids with polar charge.
AtomIdRange
[edit]AtomIdRange(minId: Integer, maxId: ?Integer) -> Atoms
Sequence of atoms with minId <= atomId <= maxId.
- Arguments
- minId: Integer - Minimum id.
- maxId: ?Integer - Maximum id. If not specified, maxId = minId.
- Examples
AtomIdRange(152, 161)
- Returns all atoms with id between 152 and 161 inclusive.
AtomIds
[edit]AtomIds(ids: Integer+) -> Atoms
Sequence of atoms with specified identifiers.
- Arguments
- ids: Integer+ - Identifiers.
- Examples
AtomIds(1, 2, 3)
- Returns atoms with ids 1, 2, 3.
AtomNames
[edit]AtomNames(names: String+) -> Atoms
Sequence of atoms with specified names.
- Arguments
- names: String+ - Allowed names.
- Examples
AtomNames("O1","NH1")
- Returns all atoms with names O1 or NH1.
Atoms
[edit]Atoms(symbols: String*) -> Atoms
Sequence of atoms with specified element symbols. If no symbols are specified, yields all atoms one by one.
- Arguments
- symbols: String* - Allowed element symbols.
- Examples
Atoms("Zn","Ca")
- Returns all atoms with element symbol Zn or Ca
Chains
[edit]Chains(identifiers: Value*) -> PatternSeq
Splits the structures into chains. If no identifiers are specified, all chains are returned.
- Arguments
- identifiers: Value* - Chain identifiers.
- Examples
Chains()
- Returns all chains.
Chains("")
- Returns chains without specific identifier.
Chains("A", "B")
- Returns chains A and B.
Helices
[edit]Helices() -> PatternSeq
Returns all helices. This assumes the information about helices was present in the input structure.
- Examples
Helices()
- Returns all helices.
HetResidues
[edit]HetResidues() -> Residues
Sequence of all residues that contain HET atoms.
- Options
- NoWaters: Bool = True - Ignore water residues such as HOH.
- Examples
HetResidues()
- Returns all residues that contain HET atoms (ignores water).
HetResidues(NoWaters=False)
- Returns all residues that contain HET atoms (includes water).
ModifiedResidues
[edit]ModifiedResidues(parentNames: String*) -> Residues
Sequence of modified residues that originate from the specified name. If no names are specified, yields all modified residues one by one.
- Arguments
- parentNames: String* - Parent residue names.
- Examples
ModifiedResidues("MET")
- Returns all residues modified from MET (for example MSE).
Named
[edit]Named(patterns: PatternSeq) -> PatternSeq
'Names' the pattern by its lowest atom id.
- Arguments
- patterns: PatternSeq - Patterns to name.
- Examples
Atoms("Zn").Named().AmbientAtoms(7)
- When exported, the result files will have names in the format '[parent id]_[pseudorandom number]_[zn atomid]'. If the Named function was not used, the name would be just '[parent id]_[pseudorandom number]'.
NotAminoAcids
[edit]NotAminoAcids() -> Residues
Sequence of all residues that are not any of the 20 basic amino acids.
- Options
- NoWaters: Bool = True - Ignore water residues such as HOH.
- Examples
NotAminoAcids()
- Returns all residues that are not amino acids.
NotAtomIds
[edit]NotAtomIds(ids: Integer+) -> Atoms
Sequence of atoms that do not have specified identifiers.
- Arguments
- ids: Integer+ - Identifiers.
- Examples
NotAtomIds(1, 2, 3)
- Returns atoms that do not have id 1, 2, nor 3.
NotAtomNames
[edit]NotAtomNames(names: String+) -> Atoms
Sequence of atoms that do not have a specified name.
- Arguments
- names: String+ - Forbidden names.
- Examples
NotAtomNames("O4")
- Returns all atoms that are not called O4.
NotAtoms
[edit]NotAtoms(symbols: String+) -> Atoms
Sequence of atoms that are not particular elements.
- Arguments
- symbols: String+ - Forbidden element symbols.
- Examples
NotAtoms("O")
- Returns all atoms that are not O.
NotResidues
[edit]NotResidues(names: Value+) -> Residues
Sequence of residues that are not called by the specified names.
- Arguments
- names: Value+ - Forbidden residue names.
- Examples
NotResidues("THR","CYS")
- Returns all residues that are not THR or CYS.
RegularMotifs
[edit]RegularMotifs(regex: Value) -> PatternSeq
Identifies regular motifs. The protein is split into individual chains and the residues are sorted by their Sequence Number before the motifs are identified. The query does not check if adjacent residues have consecutive Sequence Numbers. The query works in two modes: Amino and Nucleotide, on amino acids and nucleotides respectively. In the Amino mode, all the derivatives of standard residues are treated as the standard residues, as long as this information is properly annotated in MODRES or _pdbx_struct_mod_residue field. The default mode is 'Amino'
- Arguments
- regex: Value - Regular expression on one letter abbreviations of amino acids.
- Options
- Type: String = "Amino" - Determines the type of the query. Allowed values: Amino, Nucleotide.
- Examples
RegularMotifs("RGD")
- Finds all RGD motifs.
RegularMotifs("ACGTU", Type = 'Nucleotide')
- Finds all consecutive occurrences of the ACGTU nucleotides.
RegularMotifs(".HC.").Filter(lambda m: m.IsConnected())
- Finds all 4 residue motifs with ?-HIS-CYS-? that are connected.
ResidueIdRange
[edit]ResidueIdRange(chain: String, min: Integer, max: ?Integer) -> Residues
Sequence of residues with specific chain and min <= sequence number <= max.
- Arguments
- chain: String - Chain identifier. Case sensitive (a != A).
- min: Integer - Minimum sequence number.
- max: ?Integer - Maximum sequence number. If not specified, max = min.
- Examples
ResidueIdRange("A", 161, 165)
- Returns all residues on chain A with seq. number between 161 and 165 inclusive.
ResidueIds
[edit]ResidueIds(ids: String+) -> Residues
Sequence of residues with specific identifiers. If the structure does not contain a residue with the given identifier, it is skipped.
- Arguments
- ids: String+ - One or more identifiers in the format 'NUMBER [CHAIN] [i:INSERTIONCODE]' (parameters in [] are optional, for example '175 i:12' or '143 B'). Case sensitive (a != A).
- Examples
ResidueIds("132 A", "178 A")
- Returns residues A 123 and A 178 (provided the input structure contains them).
Residues
[edit]Residues(names: String*) -> Residues
Sequence of residues with specified names. If no names are specified, yields all residues one by one.
- Arguments
- names: String* - Allowed residue names.
- Examples
Residues("HIS", "CYS")
- Returns all HIS or CYS residues.
RingAtoms
[edit]RingAtoms(atom: Atoms, ring: ?Rings) -> Atoms
Returns all rings atoms.
- Arguments
- atom: Atoms - Atom types.
- ring: ?Rings - Specific ring.
- Examples
RingAtoms(Atoms("C"), Rings(4 * ["C"] + ["O"]))
- Returns all C atoms on a ring with 4C and O.
Rings
[edit]Rings(atoms: Value*) -> Rings
Sequence of rings with particular atoms. If no atoms are specified, yields all rings (cycles) one by one. The order of atoms matters.
- Arguments
- atoms: Value* - Ring atoms.
- Examples
Rings()
- Returns all rings.
Rings(5 * ["C"] + ["O"])
- Returns all rings with 5C and 1O atoms.
Rings(["C", "C", "N", "C", "N"])
- Returns all rings with C-C-N-C-N atoms.
Or(Rings(["C", "C", "N", "C", "N"]), Rings(["C", "C", "C", "N", "N"]))
- Returns all rings with C-C-N-C-N or C-C-C-N-N atoms.
Sheets
[edit]Sheets() -> PatternSeq
Returns all sheets. This assumes the information about sheets was present in the input structure.
- Examples
Sheets()
- Returns all sheets.
Advanced Query Functions
[edit]Advanced building blocks of the language.
Flatten
[edit]Flatten(patterns: PatternSeq, selector: Pattern->PatternSeq) -> PatternSeq
Converts a sequence of sequence of patterns into a single 'flat' sequence.
- Arguments
- patterns: PatternSeq - Patterns to project.
- selector: Pattern->PatternSeq - The selector.
- Examples
Residues("HIS").Flatten(lambda m: m.Find(Atoms("C")))
- Returns all C atoms on HIS residues.
Inside
[edit]Inside(patterns: PatternSeq, where: PatternSeq) -> PatternSeq
Finds patterns within another pattern. Equivalent to where.Flatten(lambda m: m.Find(patterns))
- Arguments
- patterns: PatternSeq - Patterns to find.
- where: PatternSeq - Where to find them.
- Examples
Atoms("C").Inside(Residues("HIS"))
- Returns all C atoms on HIS residues.
Or
[edit]Or(patterns: PatternSeq+) -> PatternSeq
Merges several pattern sequences into one.
- Arguments
- patterns: PatternSeq+ - Patterns to merge.
- Examples
Or(Atoms("Zn").ConnectedResidues(1), Rings())
- Finds all zincs and their connected residues or rings.
ToAtoms
[edit]ToAtoms(patterns: PatternSeq) -> PatternSeq
Collects all 'inner' patterns and yields all unique atoms one by one.
- Arguments
- patterns: PatternSeq - Patterns to split.
- Examples
Residues("HIS").ToAtoms()
- Returns all atoms on HIS residues one by one.
ToResidues
[edit]ToResidues(patterns: PatternSeq) -> PatternSeq
Collects all 'inner' patterns and yields all unique residues one by one. The residues contain only the atoms that have been yielded by the inner query.
- Arguments
- patterns: PatternSeq - Patterns to split.
- Examples
Atoms("C").ToResidues()
- Returns all C atoms grouped by residues.
Union
[edit]Union(patterns: PatternSeq) -> PatternSeq
Collects all 'inner' patterns and yields one created from their unique atoms.
- Arguments
- patterns: PatternSeq - Patterns to merge.
- Examples
Rings().Union()
- Creates a single pattern that contains all rings.
Filter Functions
[edit]Functions useful for filtering patterns.
Contains
[edit]Contains(where: Pattern, what: PatternSeq) -> Bool
Checks if a pattern is contained within another one. Equivalent to where.Count(what) > 0.
- Arguments
- where: Pattern - Where to look.
- what: PatternSeq - What to find.
- Examples
HetResidues().Filter(lambda m: m.Contains(Rings(5*['C']+['O'])).Not())
- Returns all HET residues that do not contain a 5CO ring.
Count
[edit]Count(where: Pattern, what: PatternSeq) -> Integer
Counts all occurrences of pattern 'what' in pattern 'where'.
- Arguments
- where: Pattern - Where to count it.
- what: PatternSeq - What pattern to count.
- Examples
m.Count(Residues("HIS"))
- Returns the count of HIS residues in the pattern m. Where m is a Pattern (for example when using the Filter function or returned by the ToPattern() function). This example will not work directly and is here to illustrate a concept.
Atoms("Zn").ConnectedResidues(1).Filter(lambda m: m.Count(Residues("HIS")) == 2)
- Patterns with Zn atoms and its connected residues with exactly 2 HIS residues.
ExecuteIf
[edit]ExecuteIf(query: PatternSeq, condition: Pattern->Bool) -> PatternSeq
Executes a query only if the condition is met. Otherwise, return an empty sequence of patterns.
- Arguments
- query: PatternSeq - Query to execute.
- condition: Pattern->Bool - Condition that must be satisfied for the parent structure/pattern.
- Examples
Residues().ExecuteIf(lambda p: p.Resolution() <= 2.4)
- Returns residues in structures that have resolution lower than 2.4ang.
AminoAcids().ExecuteIf(lambda p: p.Count(Atoms('Fe')) > 3)
- Returns all amino acids in structures that have at least 3 Fe atoms.
Filter
[edit]Filter(patterns: PatternSeq, filter: Pattern->Bool) -> PatternSeq
Filters a sequence of patterns with a given predicate.
- Arguments
- patterns: PatternSeq - Patterns to filter.
- filter: Pattern->Bool - Filter predicate.
- Examples
Residues().Filter(lambda m: m.Count(Atoms("C")) >= 3)
- Returns all residues that contain at least 3 C atoms.
IsConnected
[edit]IsConnected(pattern: Pattern) -> Bool
Checks if a particular pattern is a connected graph.
- Arguments
- pattern: Pattern - A pattern to test.
- Examples
Atoms("Zn").AmbientResidues(3).Filter(lambda m: m.IsConnected())
- Finds all patterns with a Zn and residues within 3 ang, where all the ambient residues are connected to the central atom.
IsConnectedTo
[edit]IsConnectedTo(where: Pattern, patterns: PatternSeq) -> Bool
Checks if a particular pattern is connected to any other specified pattern. The patterns must have empty intersection for this function to return true.
- Arguments
- where: Pattern - A pattern to test.
- patterns: PatternSeq - Pattern sequence to test against.
- Examples
Atoms().Filter(lambda a: a.IsConnectedTo(Rings()))
- Finds all atoms that are connected to a ring they do not belong to.
IsNotConnectedTo
[edit]IsNotConnectedTo(what: Pattern, patterns: PatternSeq) -> Bool
Checks if a particular pattern is not connected to any other specified pattern. The patterns must have empty intersection for this function to return true.
- Arguments
- what: Pattern - A pattern to test.
- patterns: PatternSeq - Pattern sequence to test against.
- Examples
Residues().Filter(lambda r: r.IsNotConnectedTo(Atoms("Ca")))
- Finds all residues that are not connected to Ca atoms. The residue itself can still contain Ca atoms.
NearestDistanceTo
[edit]NearestDistanceTo(where: Pattern, patterns: PatternSeq) -> Real
Finds the distance to a particular pattern.
- Arguments
- where: Pattern - A pattern to test.
- patterns: PatternSeq - Pattern sequence to test against.
- Examples
Atoms().Filter(lambda m: m.NearestDistanceTo(Residues("ASP")) >= 5)
- Finds all atoms that are at least 5 (angstroms) away from any ASP residue.
SeqCount
[edit]SeqCount(what: PatternSeq) -> Integer
Counts the length of a sequence of motifs.
- Arguments
- what: PatternSeq - What pattern sequence to count.
- Examples
Atoms("Zn").AmbientResidues(3).Filter(lambda m: m.Find(Residues("HIS")).SeqCount() > 1)
- Returns a sequence of patterns with Zn atom and residues within 3ang if the pattern contains at least 2 HIS residues.
Topology Functions
[edit]Functions that rely on the topology of patterns.
ConnectedAtoms
[edit]ConnectedAtoms(pattern: PatternSeq, n: Integer) -> PatternSeq
Surrounds the inner pattern by n layers of atoms.
- Arguments
- pattern: PatternSeq - Basic pattern.
- n: Integer - Number of atom layers to connect.
- Options
- YieldNamedDuplicates: Bool = False - Yield duplicate patterns if they have a different name.
- Examples
Residues("MAN").ConnectedAtoms(2)
- Finds all MAN residues and then adds two connected levels of atoms to them.
ConnectedResidues
[edit]ConnectedResidues(pattern: PatternSeq, n: Integer) -> PatternSeq
Surrounds the inner pattern by n layers of residues.
- Arguments
- pattern: PatternSeq - Basic pattern.
- n: Integer - Number of residue layers to connect.
- Options
- YieldNamedDuplicates: Bool = False - Yield duplicate patterns if they have a different name.
- Examples
Atoms("Zn").ConnectedResidues(1)
- Finds all Zn atoms and adds all residues that are connected to them.
Path
[edit]Path(patterns: PatternSeq+) -> PatternSeq
Creates a new pattern from 'connected' parts.
- Arguments
- patterns: PatternSeq+ - Patterns to path.
- Examples
Path(Atoms("O"), Atoms("C"), Atoms("O"))
- Finds patterns with two O and one C atoms where the C atoms is connected to the O ones.
Star
[edit]Star(center: PatternSeq, patterns: PatternSeq+) -> PatternSeq
Creates a new pattern from a central one and connected parts.
- Arguments
- center: PatternSeq - Center pattern.
- patterns: PatternSeq+ - Patterns to chain.
- Examples
Star(Atoms("C"), Atoms("O"), Atoms("O"))
- Finds patterns with two O atoms and one C atom in the center.
Atoms("C").Star(Atoms("O"), Atoms("O"))
- Finds patterns with two O atoms and one C atom in the center.
Geometry Functions
[edit]Functions that rely on the geometry of patterns.
AmbientAtoms
[edit]AmbientAtoms(pattern: PatternSeq, r: Number) -> PatternSeq
Surrounds the inner pattern by atoms that within the given radius from the inner pattern.
- Arguments
- pattern: PatternSeq - Basic pattern.
- r: Number - Radius.
- Options
- ExcludeBase: Bool = False - Exclude the central original pattern.
- NoWaters: Bool = True - Ignore water residues such as HOH.
- YieldNamedDuplicates: Bool = False - Yield duplicate patterns if they have a different name.
- Examples
Atoms("Fe").AmbientAtoms(4)
- Finds Fe atoms and all atoms within 4 (angstroms) from each of them.
AmbientResidues
[edit]AmbientResidues(pattern: PatternSeq, r: Number) -> PatternSeq
Surrounds the inner pattern by residues that have at least one atom within the given radius from the inner pattern.
- Arguments
- pattern: PatternSeq - Basic pattern.
- r: Number - Radius.
- Options
- ExcludeBase: Bool = False - Exclude the central original pattern.
- NoWaters: Bool = True - Ignore water residues such as HOH.
- YieldNamedDuplicates: Bool = False - Yield duplicate patterns if they have a different name.
- Examples
Rings(6 * ["C"]).AmbientResidues(4)
- Finds rings with 6C atoms and all residues within 4 (angstroms) from each of them.
Cluster
[edit]Cluster(r: Number, patterns: PatternSeq+) -> PatternSeq
Clusters all patterns that are pairwise closer than r (angstroms).
- Arguments
- r: Number - Maximum distance between two patterns in the cluster.
- patterns: PatternSeq+ - Patterns to cluster.
- Examples
Cluster(4, Atoms("Ca"), Rings(5 * ["C"] + ["O"]))
- 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
[edit]Filled(pattern: PatternSeq) -> PatternSeq
Adds all atoms that fall within the circumsphere (with radius multiplied by the factor) of the basic pattern.
- Arguments
- pattern: PatternSeq - Basic pattern.
- Options
- NoWaters: Bool = True - Ignore water residues such as HOH.
- RadiusFactor: Number = 0.75 - Circumsphere radius factor.
- Examples
Cluster(4, Residues("HIS")).Filled(RadiusFactor = 0.75)
- Finds clusters of HIS residues and all atoms within the circumsphere.
Near
[edit]Near(r: Number, patterns: PatternSeq+) -> PatternSeq
Clusters all patterns that are pairwise closer than r (angstroms) and checks if the "counts" match.
- Arguments
- r: Number - Maximum distance between two sub-patterns in the pattern.
- patterns: PatternSeq+ - Patterns to 'cluster'.
- Examples
Near(4, Atoms("Ca"), Atoms("Ca"), Rings(5 * ["C"] + ["O"]))
- Finds all instance of a single ring with 5C and O atoms and two Ca atoms that are closer than 4 (angstroms).
Spherify
[edit]Spherify(pattern: PatternSeq, r: Number) -> PatternSeq
Identifies the geometrical center of the base pattern and then includes all atoms within the specified radius.
- Arguments
- pattern: PatternSeq - Basic pattern.
- r: Number - Radius.
- Options
- ExcludeBase: Bool = False - Exclude the central original pattern.
- NoWaters: Bool = True - Ignore water residues such as HOH.
- YieldNamedDuplicates: Bool = False - Yield duplicate patterns if they have a different name.
- Examples
Rings(6 * ["C"]).Spherify(5)
Finds benzene moiety, computes centroid of each pattern, and includes all atoms within 5 angstroms from it.
Meta-data Functions
[edit]Functions dealing with meta-data about structures such as release date or authors.
Authors
[edit]Authors(pattern: Pattern) -> String
Returns authors of the parent structure separated by a semicolon. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
ECNumbers
[edit]ECNumbers(pattern: Pattern) -> String
Returns Enzymatic Commission numbers assigned to enzymes in the parent structure separated by a semicolon. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
EntitySources
[edit]EntitySources(pattern: Pattern) -> String
Returns entity sources of the parent structure separated by a semicolon. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
ExperimentMethod
[edit]ExperimentMethod(pattern: Pattern) -> String
Get the experiment method. The value is always an upper-case string. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
- Examples
Residues().ExecuteIf(lambda p: p.ExperimentMethod() == "INFRARED SPECTROSCOPY")
- Returns residues in structures that satisfy the property.
HasAllAuthors
[edit]HasAllAuthors(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains all given authors. The comparison is case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAllAuthors("Holmes", "Watson"))
- Returns residues in structures that contain all given properties.
HasAllECNumbers
[edit]HasAllECNumbers(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains all given Enzymatic Commission numbers. It is possible to enter just a number prefix without the '.'. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAllECNumbers("3.2.1.18", "3.3"))
- Returns residues in structures that contain all given properties.
HasAllEntitySources
[edit]HasAllEntitySources(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains all given entity sources. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAllEntitySources("GMO", "Natural", "Synthetic"))
- Returns residues in structures that contain all given properties.
HasAllHostOrganismGenus
[edit]HasAllHostOrganismGenus(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains all given host organism identifiers. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAllHostOrganismGenus("X", "Y"))
- Returns residues in structures that contain all given properties.
HasAllHostOrganismIds
[edit]HasAllHostOrganismIds(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains all given host organism identifiers. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAllHostOrganismIds("7108", "11244"))
- Returns residues in structures that contain all given properties.
HasAllHostOrganisms
[edit]HasAllHostOrganisms(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains all given host organism names. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAllHostOrganisms("Spodoptera frugiperda", "Mus musculus"))
- Returns residues in structures that contain all given properties.
HasAllKeywords
[edit]HasAllKeywords(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains all given keywords. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAllKeywords("membrane", "glycoprotein"))
- Returns residues in structures that contain all given properties.
HasAllOriginOrganismGenus
[edit]HasAllOriginOrganismGenus(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains all given origin organism identifiers. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAllOriginOrganismGenus("X", "Y"))
- Returns residues in structures that contain all given properties.
HasAllOriginOrganismIds
[edit]HasAllOriginOrganismIds(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains all given origin organism identifiers. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAllOriginOrganismIds("121791", "10090"))
- Returns residues in structures that contain all given properties.
HasAllOriginOrganisms
[edit]HasAllOriginOrganisms(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains all given origin organism names. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAllOriginOrganisms("Nipah virus", "Mus musculus"))
- Returns residues in structures that contain all given properties.
HasAnyAuthor
[edit]HasAnyAuthor(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains any of the given authors. The comparison is case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAnyAuthor("Holmes", "Watson"))
- Returns residues in structures that contain all given properties.
HasAnyECNumber
[edit]HasAnyECNumber(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains any of the given Enzymatic Commission number. It is possible to enter just a number prefix without the '.'s. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAnyECNumber("3.2.1.19", "3.3"))
- Returns residues in structures that contain all given properties.
HasAnyEntitySources
[edit]HasAnyEntitySources(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains any of the given entity sources. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAnyEntitySources("GMO", "Natural", "Synthetic"))
- Returns residues in structures that contain all given properties.
HasAnyHostOrganism
[edit]HasAnyHostOrganism(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains any of the given host organism names. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAnyHostOrganism("Spodoptera frugiperda", "Mus musculus"))
- Returns residues in structures that contain all given properties.
HasAnyHostOrganismGenus
[edit]HasAnyHostOrganismGenus(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains any of the given host organism identifierss. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAnyHostOrganismGenus("X", "Y"))
- Returns residues in structures that contain all given properties.
HasAnyHostOrganismId
[edit]HasAnyHostOrganismId(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains any of the given host organism identifierss. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAnyHostOrganismId("7108", "11244"))
- Returns residues in structures that contain all given properties.
HasAnyKeyword
[edit]HasAnyKeyword(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains any of the given keywords. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAnyKeyword("membrane", "glycoprotein"))
- Returns residues in structures that contain all given properties.
HasAnyOriginOrganism
[edit]HasAnyOriginOrganism(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains any of the given origin organism names. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAnyOriginOrganism("Nipah virus", "Mus musculus"))
- Returns residues in structures that contain all given properties.
HasAnyOriginOrganismGenus
[edit]HasAnyOriginOrganismGenus(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains any of the given origin organism identifierss. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAnyOriginOrganismGenus("X", "Y"))
- Returns residues in structures that contain all given properties.
HasAnyOriginOrganismId
[edit]HasAnyOriginOrganismId(pattern: Pattern, properties: String+) -> Bool
Determines if the parent structure contains any of the given origin organism identifierss. The comparison is not case sensitive.
- Arguments
- pattern: Pattern - Pattern.
- properties: String+ - Properties.
- Examples
Residues().ExecuteIf(lambda p: p.HasAnyOriginOrganismId("121791", "10090"))
- Returns residues in structures that contain all given properties.
HostOrganismGenus
[edit]HostOrganismGenus(pattern: Pattern) -> String
Returns host organism identifiers of the parent structure separated by a semicolon. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
HostOrganismIds
[edit]HostOrganismIds(pattern: Pattern) -> String
Returns host organism identifiers of the parent structure separated by a semicolon. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
HostOrganisms
[edit]HostOrganisms(pattern: Pattern) -> String
Returns host organism names of the parent structure separated by a semicolon. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
Keywords
[edit]Keywords(pattern: Pattern) -> String
Returns keywords of the parent structure separated by a semicolon. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
LatestRevisionDate
[edit]LatestRevisionDate(pattern: Pattern) -> Value
Get the latest revision date of the parent structure. The value has to be compared to the DateTime(year, month, day) object. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
- Examples
Residues().ExecuteIf(lambda p: p.LatestRevisionDate() >= DateTime(2008, 1, 1))
- Returns residues in structures that satisfy the property.
LatestRevisionYear
[edit]LatestRevisionYear(pattern: Pattern) -> Integer
Get the latest revision year of the parent structure. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
- Examples
Residues().ExecuteIf(lambda p: p.LatestRevisionYear() == 2006)
- Returns residues in structures that satisfy the property.
OriginOrganismGenus
[edit]OriginOrganismGenus(pattern: Pattern) -> String
Returns origin organism identifiers of the parent structure separated by a semicolon. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
OriginOrganismIds
[edit]OriginOrganismIds(pattern: Pattern) -> String
Returns origin organism identifiers of the parent structure separated by a semicolon. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
OriginOrganisms
[edit]OriginOrganisms(pattern: Pattern) -> String
Returns origin organism names of the parent structure separated by a semicolon. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
PolymerType
[edit]PolymerType(pattern: Pattern) -> String
Get the polymer type of the structure. Possible values are: NotAssigned, Protein, DNA, RNA, ProteinDNA, ProteinRNA, NucleicAcids, Mixture, Sugar, Other. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
- Examples
Residues().ExecuteIf(lambda p: p.PolymerType() == "ProteinDNA")
- Returns residues in structures that satisfy the property.
ProteinStoichiometry
[edit]ProteinStoichiometry(pattern: Pattern) -> String
Get the protein stoichiometry of the parent structure. Possible values are: NotAssigned, Monomer, Homomer, Heteromer. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
- Examples
Residues().ExecuteIf(lambda p: p.ProteinStoichiometry() == "Heteromer")
- Returns residues in structures that satisfy the property.
ProteinStoichiometryString
[edit]ProteinStoichiometryString(pattern: Pattern) -> String
Get the protein stoichiometry string of the parent structure. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
ReleaseDate
[edit]ReleaseDate(pattern: Pattern) -> Value
Get the release date of the parent structure. The value has to be compared to the DateTime(year, month, day) object. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
- Examples
Residues().ExecuteIf(lambda p: p.ReleaseDate() >= DateTime(2008, 1, 1))
- Returns residues in structures that satisfy the property.
ReleaseYear
[edit]ReleaseYear(pattern: Pattern) -> Integer
Get the release year of the parent structure. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
- Examples
Residues().ExecuteIf(lambda p: p.ReleaseYear() == 2006)
- Returns residues in structures that satisfy the property.
Resolution
[edit]Resolution(pattern: Pattern) -> Real
Get the resolution in angstroms of the parent structure. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
- Examples
Residues().ExecuteIf(lambda p: p.Resolution() <= 2.4)
- Returns residues in structures that satisfy the property.
Weight
[edit]Weight(pattern: Pattern) -> Real
Get the weight of the molecule in kDa. If the value is not available, null is returned.
- Arguments
- pattern: Pattern - Pattern.
- Examples
Residues().ExecuteIf(lambda p: p.Weight() > 100000.0)
- Returns residues in structures that satisfy the property.
Miscellaneous Functions
[edit]Various useful functions. These function often require a special setup (i.e. only useful in Scripting window or in specific applications).
AminoSequenceString
[edit]AminoSequenceString(pattern: Pattern) -> String
Returns a string of single-letter amino acids contained in the pattern.
Note: This function cannot be used directly to query patterns from MotiveExplorer or Queries service.
- Arguments
- pattern: Pattern - Pattern to convert.
- Examples
Pattern("1tqn_12").AminoSequenceString()
- Returns a string representing amino acids in the pattern '1tqn_12'.
RegularMotifs(Pattern("1tqn_12").AminoSequenceString())
- Returns all regular patterns that correspond to the AMK sequence in 1tqn_12.
AtomProperty
[edit]AtomProperty(atomPattern: Pattern, name: String) -> ?
If the property exists and the pattern consists of a single atom, returns the property. Otherwise, returns Nothing.
Note: This function cannot be used directly to query patterns from MotiveExplorer or Queries service.
- Arguments
- atomPattern: Pattern - Single atom pattern.
- name: String - Property name.
- Examples
a.AtomProperty("charge")
- Gets the 'charge' property of the atom a. Where a is a single atom Pattern. This example will not work directly.
Atoms().Filter(lambda a: a.AtomProperty("charge") >= 2)
- 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
[edit]AtomSimilarity(a: Pattern, b: Pattern) -> Real
Computes Jaccard/Tanimoto coefficient on atoms (element symbols) of both structures.
Note: This function cannot be used directly to query patterns from MotiveExplorer or Queries service.
- Arguments
- a: Pattern - First pattern.
- b: Pattern - Second pattern.
- Examples
AtomSimilarity(Current(),Pattern("1tqn_12"))
- Computes the atom similarity between the current pattern and 1tqn_12. This example can be used in SiteBinder to create a descriptor (assuming a structure with id '1tqn_12' is loaded).
CommonAtoms
[edit]CommonAtoms(modelId: String) -> PatternSeq
Returns a single pattern with atoms common with the model. Properties checked: atom id, element symbol, chain, residue number. This query is useful for example for atom selection in SiteBinder.
Note: This function cannot be used directly to query patterns from MotiveExplorer or Queries service.
- Arguments
- modelId: String - Id of the model.
- Examples
CommonAtoms("1tqn_12")
- Returns a pattern formed by atoms common with the '1tqn_12' structure.
CSA
[edit]CSA() -> PatternSeq
Entries from Catalytic Site Atlas represented as patterns. Works only if used from the command line version of Queries and property configured.
Note: This function cannot be used directly to query patterns from MotiveExplorer or Queries service.
- Examples
CSA()
- All CSA sites for the given structure. This example will only work if used from the command line version of Queries and property configured.
Current
[edit]Current() -> Pattern
A variable that is assigned by the application environment.
Note: This function cannot be used directly to query patterns from MotiveExplorer or Queries service.
- Examples
AtomSimilarity(Current(), Pattern("model"))
- Returns the atom similarity of the current pattern 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
[edit]Descriptor(pattern: Pattern, name: String) -> ?
Returns the descriptor. If the descriptor does not exist, 'null' is returned.
Note: This function cannot be used directly to query patterns from MotiveExplorer or Queries service.
- Arguments
- pattern: Pattern - Pattern that represents entire structure.
- name: String - Descriptor name.
- Examples
Current().Descriptor("similarity") >= 0.75
- Returns True if 'similarity' descriptor of the current pattern is at least 0.75. This example will work for example in SiteBinder's structure selection if the 'similarity' descriptor has been previously defined.
DynamicInvoke
[edit]DynamicInvoke(value: Value, name: String, isProperty: Bool, args: Value) -> Value
Dynamically invoke a member. (internal)
Note: This function cannot be used directly to query patterns from MotiveExplorer or Queries service.
- Arguments
- value: Value - InnerQuery.
- name: String - Member name.
- isProperty: Bool - Is this a property.
- args: Value - Array of arguments.
Find
[edit]Find(source: Pattern, patterns: PatternSeq) -> PatternSeq
Converts the source pattern to a structure and finds patterns within it.
Note: This function cannot be used directly to query patterns from MotiveExplorer or Queries service.
- Arguments
- source: Pattern - Where to look.
- patterns: PatternSeq - Patterns to find.
- Examples
AtomSimilarity(Current().Find(NotAtoms("N")).ToPattern(), Pattern("model").Find(NotAtoms("N")).ToPattern())
- Computes the atom similarity of the 'current' and 'model' patterns, but ignores N atoms. This example can be used in SiteBinder to create a descriptor (assuming a structure with id 'model' is loaded).
GroupedAtoms
[edit]GroupedAtoms(symbols: String*) -> PatternSeq
Groups atoms using the element symbol and then returns each group as a single pattern.
Note: This function cannot be used directly to query patterns from MotiveExplorer or Queries service.
- Arguments
- symbols: String* - Allowed element symbols.
- Examples
GroupedAtoms()
- Returns groups of all atom types. For example if the input has atoms 5xC-1xO, patterns with 5xC and 1xO atoms are returned.
GroupedAtoms('C', 'O')
- Returns groups of all atom types. For example if the input has atoms 5xC-1xO-6xH, patterns with 5xC and 1xO atoms are returned (but the H atoms are ignored).
Pattern
[edit]Pattern(structureName: String) -> Pattern
Returns a structure represented as a pattern.
Note: This function cannot be used directly to query patterns from MotiveExplorer or Queries service.
- Arguments
- structureName: String - Name of a structure.
- Examples
Pattern("1tqn_12")
- Returns the structure '1tqn_12' represented as a pattern. Usable in defining descriptors or in Scripting window (using MQ.Execute).
ResidueSimilarity
[edit]ResidueSimilarity(a: Pattern, b: Pattern) -> Real
Computes Jaccard/Tanimoto coefficient on residue names of both structures.
Note: This function cannot be used directly to query patterns from MotiveExplorer or Queries service.
- Arguments
- a: Pattern - First pattern.
- b: Pattern - Second pattern.
- Examples
ResidueSimilarity(Current(), Pattern("1tqn_12"))
- Computes the residue similarity between the current pattern and '1tqn_12'. This example can be used in SiteBinder to create a descriptor (assuming a structure with id '1tqn_12' is loaded).
ToPattern
[edit]ToPattern(patterns: PatternSeq) -> Pattern
Converts a sequence of Patterns (AtomSetSeq) to a single Pattern by merging all atoms into a single atom set. The Pattern type is required by some function such as AtomSimilarity.
Note: This function cannot be used directly to query patterns from MotiveExplorer or Queries service.
- Arguments
- patterns: PatternSeq - Patterns to convert.
- Examples
Residues("HIS").ToPattern()
- Converts a sequence of HIS residue Patterns to a single Pattern.
AtomSimilarity(Current().Find(NotAtoms("N")).ToPattern(), Pattern("model").Find(NotAtoms("N")).ToPattern())
- Computes the atom similarity of the 'current' and 'model' patterns, but ignores N atoms.
Value Functions
[edit]Functions such as addition or comparison of numbers.
Abs
[edit]Abs(x: Number) -> Number
Computes the 'Abs' function of the argument.
- Arguments
- x: Number - Argument.
- Examples
Abs(x)
- Evaluates the expression.
Divide (/)
[edit]Divide(x: Number, y: Number) -> Number
Computes the 'Divide' function of the values.
- Arguments
- x: Number - Left argument.
- y: Number - Right argument.
- Examples
x / y
- Evaluates the expression.
Equal (==)
[edit]Equal(x: Value, y: Value) -> Bool
Determines the 'Equal' relation between two values.
- Arguments
- x: Value - Left argument.
- y: Value - Right argument.
- Examples
x == y
- Evaluates to True or False based on the value of x and y.
Greater (>)
[edit]Greater(x: Number, y: Number) -> Bool
Determines the 'Greater' relation between two values.
- Arguments
- x: Number - Left argument.
- y: Number - Right argument.
- Examples
x > y
- Evaluates to True or False based on the value of x and y.
GreaterEqual (>=)
[edit]GreaterEqual(x: Number, y: Number) -> Bool
Determines the 'GreaterEqual' relation between two values.
- Arguments
- x: Number - Left argument.
- y: Number - Right argument.
- Examples
x >= y
- Evaluates to True or False based on the value of x and y.
Less (<)
[edit]Less(x: Number, y: Number) -> Bool
Determines the 'Less' relation between two values.
- Arguments
- x: Number - Left argument.
- y: Number - Right argument.
- Examples
x < y
- Evaluates to True or False based on the value of x and y.
LessEqual (<=)
[edit]LessEqual(x: Number, y: Number) -> Bool
Determines the 'LessEqual' relation between two values.
- Arguments
- x: Number - Left argument.
- y: Number - Right argument.
- Examples
x <= y
- Evaluates to True or False based on the value of x and y.
LogicalAnd (&)
[edit]LogicalAnd(xs: Bool+) -> Bool
Computes 'LogicalAnd' of the input values.
- Arguments
- xs: Bool+ - Arguments.
- Examples
x & y
- Evaluates to True or False based on the values of x and y.
LogicalNot (Not)
[edit]LogicalNot(x: Bool) -> Bool
Computes 'LogicalNot' of the input value. This function can be called using the shorthand 'Not'.
- Arguments
- x: Bool - Argument.
- Examples
LogicalNot(x)
- Evaluates to True or False based on the value of x.
x.Not()
- Evaluates to True or False based on the value of x.
LogicalOr (|)
[edit]LogicalOr(xs: Bool+) -> Bool
Computes 'LogicalOr' of the input values.
- Arguments
- xs: Bool+ - Arguments.
- Examples
x | y
- Evaluates to True or False based on the values of x and y.
LogicalXor (Xor)
[edit]LogicalXor(xs: Bool+) -> Bool
Computes 'LogicalXor' of the input values. This function can be called using the shorthand 'Xor'.
- Arguments
- xs: Bool+ - Arguments.
- Examples
LogicalXor(x, y)
- Evaluates to True or False based on the values of x and y.
Xor(x, y)
- Evaluates to True or False based on the values of x and y.
Minus (-)
[edit]Minus(x: Number) -> Number
Computes the arithmetic negation of the argument.
- Arguments
- x: Number - Argument.
- Examples
-x
- Arithmetic negation of x.
NotEqual (!=)
[edit]NotEqual(x: Value, y: Value) -> Bool
Determines the 'NotEqual' relation between two values.
- Arguments
- x: Value - Left argument.
- y: Value - Right argument.
- Examples
x != y
- Evaluates to True or False based on the value of x and y.
Plus (+)
[edit]Plus(x: Number, y: Number) -> Number
Computes the 'Plus' function of the values.
- Arguments
- x: Number - Left argument.
- y: Number - Right argument.
- Examples
x + y
- Evaluates the expression.
Power (^)
[edit]Power(x: Number, y: Number) -> Number
Computes the 'Power' function of the values.
- Arguments
- x: Number - Left argument.
- y: Number - Right argument.
- Examples
x ^ y
- Evaluates the expression.
Subtract (-)
[edit]Subtract(x: Number, y: Number) -> Number
Computes the 'Subtract' function of the values.
- Arguments
- x: Number - Left argument.
- y: Number - Right argument.
- Examples
x - y
- Evaluates the expression.
Times (*)
[edit]Times(x: Number, y: Number) -> Number
Computes the 'Times' function of the values.
- Arguments
- x: Number - Left argument.
- y: Number - Right argument.
- Examples
x * y
- Evaluates the expression.