Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
WebChemistry Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
PatternQuery:Language Reference
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Filter Functions == ''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 === <code>Count(where: Pattern, what: PatternSeq) -> Integer</code><br/> ''Counts all occurrences of pattern 'what' in pattern 'where'.''<br/> ;Arguments : where: Pattern - ''Where to count it.'' : what: PatternSeq - ''What pattern to count.'' ;Examples : <code>m.Count(Residues("HIS"))</code> :: ''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> :: ''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 === <code>Filter(patterns: PatternSeq, filter: Pattern->Bool) -> PatternSeq</code><br/> ''Filters a sequence of patterns with a given predicate.''<br/> ;Arguments : patterns: PatternSeq - ''Patterns to filter.'' : filter: Pattern->Bool - ''Filter predicate.'' ;Examples : <code>Residues().Filter(lambda m: m.Count(Atoms("C")) >= 3)</code> :: ''Returns all residues that contain at least 3 C atoms.'' ---- === IsConnected === <code>IsConnected(pattern: Pattern) -> Bool</code><br/> ''Checks if a particular pattern is a connected graph.''<br/> ;Arguments : pattern: Pattern - ''A pattern to test.'' ;Examples : <code>Atoms("Zn").AmbientResidues(3).Filter(lambda m: m.IsConnected())</code> :: ''Finds all patterns with a Zn and residues within 3 ang, where all the ambient residues are connected to the central atom.'' ---- === IsConnectedTo === <code>IsConnectedTo(where: Pattern, patterns: PatternSeq) -> Bool</code><br/> ''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 : where: Pattern - ''A pattern to test.'' : patterns: PatternSeq - ''Pattern sequence to test against.'' ;Examples : <code>Atoms().Filter(lambda a: a.IsConnectedTo(Rings()))</code> :: ''Finds all atoms that are connected to a ring they do not belong to.'' ---- === IsNotConnectedTo === <code>IsNotConnectedTo(what: Pattern, patterns: PatternSeq) -> Bool</code><br/> ''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 : what: Pattern - ''A pattern to test.'' : patterns: PatternSeq - ''Pattern sequence to test against.'' ;Examples : <code>Residues().Filter(lambda r: r.IsNotConnectedTo(Atoms("Ca")))</code> :: ''Finds all residues that are not connected to Ca atoms. The residue itself can still contain Ca atoms.'' ---- === NearestDistanceTo === <code>NearestDistanceTo(where: Pattern, patterns: PatternSeq) -> Real</code><br/> ''Finds the distance to a particular pattern.''<br/> ;Arguments : where: Pattern - ''A pattern to test.'' : patterns: PatternSeq - ''Pattern sequence to test against.'' ;Examples : <code>Atoms().Filter(lambda m: m.NearestDistanceTo(Residues("ASP")) >= 5)</code> :: ''Finds all atoms that are at least 5 (angstroms) away from any ASP residue.'' ---- === 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/>
Summary:
Please note that all contributions to WebChemistry Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
WebChemistry Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
PatternQuery:Language Reference
(section)
Add topic