astex
Class Selection

java.lang.Object
  extended by astex.Selection

public class Selection
extends java.lang.Object

Class for evaluating selection expressions.


Field Summary
static DynamicArray aminoacidNames
          Residue names for aminoacids.
static DynamicArray dnaNames
          Residue names for dna.
static DynamicArray dynamicArrayCache
          Cache for DynamicArray that will return selected atoms.
static int EQ
          Equal attribute.
static int GE
          Greater equal attribute.
static int GT
          Greater than attribute.
static DynamicArray ionNames
          Residue names for ions.
static int LE
          Less equal attribute.
static int LT
          Less than attribute.
static int NE
          Not equal attribute.
static DynamicArray solventNames
          Residue names for solvent.
 
Constructor Summary
Selection()
           
 
Method Summary
static byte[] all(MoleculeRenderer r)
          Select all the atoms.
static byte[] aminoacid(MoleculeRenderer r)
          Aminoacid expression.
static byte[] and(byte[] mask1, byte[] mask2)
          And two selection masks together.
static byte[] arrayToMask(MoleculeRenderer r, DynamicArray selectedAtoms)
          Return a mask from a DynamicArray.
static byte[] atom(MoleculeRenderer r, java.util.Vector ids)
          Select a set of atoms on the basis of atom ids.
static byte[] attribute(MoleculeRenderer r, int attribute, int operator, double value)
          Select on the basis of an attribute.
static byte[] bonded(MoleculeRenderer r, byte[] mask)
          Select a set of atoms on the basis of residue names.
static byte[] builtin(MoleculeRenderer r, DynamicArray names)
          Evaluate a builtin expression against residue names.
static byte[] builtin2(MoleculeRenderer r, DynamicArray names)
          Evaluate a builtin expression atom names.
static byte[] builtin3(MoleculeRenderer r, DynamicArray names)
          Evaluate a builtin expression atom names.
static byte[] byresidue(MoleculeRenderer r, byte[] mask)
          Select a set of atoms on the basis of residue names.
static byte[] chain(MoleculeRenderer r, java.util.Vector ids)
          Select a set of atoms on the basis of residue names.
static byte[] composite(MoleculeRenderer r, java.util.Vector ids)
          Select a set of atoms on the basis of ids.
static byte[] compositeSelection(MoleculeRenderer r, java.util.Vector molecules, java.util.Vector chains, java.util.Vector residues, java.util.Vector atoms)
          Composite specification.
static byte[] contact(MoleculeRenderer r, double rad, byte[] sphereMask)
          Return a set of atoms withinin a tolerance of sum of vdw radii.
static byte[] current(MoleculeRenderer r)
          Return the current selection.
static byte[] defaultSelection(MoleculeRenderer r)
          Return the default selection.
static byte[] displayed(MoleculeRenderer r)
          Return the atoms that are actively displayed.
static byte[] dna(MoleculeRenderer r)
          DNA expression.
static byte[] element(MoleculeRenderer r, java.util.Vector ids)
          Select a set of atoms on the basis of elements.
static byte[] graph(MoleculeRenderer r, byte[] graphMask)
          Return a set of atoms in a connected graph.
static byte[] group(MoleculeRenderer r, java.util.Hashtable group)
          Select a set of atoms in a group.
static byte[] id(MoleculeRenderer r, java.util.Vector ids)
          Select a set of atoms on the basis of ids.
static byte[] insertion(MoleculeRenderer r, java.lang.String insertionCode)
          Select a set of atoms on the basis of insertion code.
static byte[] ions(MoleculeRenderer r)
          Ions expression.
static byte[] labelled(MoleculeRenderer r)
          Return the current selection.
static DynamicArray maskToArray(MoleculeRenderer r, byte[] mask)
          Return a DynamicArray from a selection mask.
static byte[] modulo(MoleculeRenderer r, int n)
          Select a set of atoms on the basis of ids.
static byte[] molecule(MoleculeRenderer r, java.util.Vector ids)
          Select a set of atoms on the basis of molecule name.
static byte[] moleculeExact(MoleculeRenderer r, java.util.Vector ids)
          Select a set of atoms on the basis of molecule name.
static byte[] name(MoleculeRenderer r, java.util.Vector ids)
          Select a set of atoms on the basis of residue names.
static byte[] none(MoleculeRenderer r)
          Select all the atoms.
static byte[] not(byte[] mask1)
          Not a selection mask.
static byte[] or(byte[] mask1, byte[] mask2)
          Or two selection masks together.
static byte[] property(MoleculeRenderer r, int property)
          Return atoms that have the specified property.
static byte[] residue(MoleculeRenderer r, java.util.Vector ids)
          Select a set of atoms on the basis of ids.
static byte[] residue2(MoleculeRenderer r, java.util.Vector ids)
          Select a set of atoms on the basis of ids.
static DynamicArray retrieve()
          Retrieve the result of a selection expression.
static byte[] sequential(MoleculeRenderer r, java.util.Vector ids)
          Select a set of atoms on the basis of ids.
static byte[] solvent(MoleculeRenderer r)
          Solvent expression.
static byte[] sphere(MoleculeRenderer r, double rad, byte[] sphereMask)
          Return a set of atoms withinin a sphere.
static byte[] sphere(MoleculeRenderer r, double rad, double x, double y, double z)
          Return a set of atoms withinin a sphere.
static void store(DynamicArray sel)
          Store the result of a selection expression.
static byte[] wide(MoleculeRenderer r)
          Return the current selection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

aminoacidNames

public static DynamicArray aminoacidNames
Residue names for aminoacids.


dnaNames

public static DynamicArray dnaNames
Residue names for dna.


solventNames

public static DynamicArray solventNames
Residue names for solvent.


ionNames

public static DynamicArray ionNames
Residue names for ions.


GT

public static final int GT
Greater than attribute.

See Also:
Constant Field Values

GE

public static final int GE
Greater equal attribute.

See Also:
Constant Field Values

LT

public static final int LT
Less than attribute.

See Also:
Constant Field Values

LE

public static final int LE
Less equal attribute.

See Also:
Constant Field Values

EQ

public static final int EQ
Equal attribute.

See Also:
Constant Field Values

NE

public static final int NE
Not equal attribute.

See Also:
Constant Field Values

dynamicArrayCache

public static DynamicArray dynamicArrayCache
Cache for DynamicArray that will return selected atoms.

Constructor Detail

Selection

public Selection()
Method Detail

store

public static void store(DynamicArray sel)
Store the result of a selection expression.


retrieve

public static DynamicArray retrieve()
Retrieve the result of a selection expression.


maskToArray

public static DynamicArray maskToArray(MoleculeRenderer r,
                                       byte[] mask)
Return a DynamicArray from a selection mask.


arrayToMask

public static byte[] arrayToMask(MoleculeRenderer r,
                                 DynamicArray selectedAtoms)
Return a mask from a DynamicArray.


all

public static byte[] all(MoleculeRenderer r)
Select all the atoms.


none

public static byte[] none(MoleculeRenderer r)
Select all the atoms.


attribute

public static byte[] attribute(MoleculeRenderer r,
                               int attribute,
                               int operator,
                               double value)
Select on the basis of an attribute.


residue2

public static byte[] residue2(MoleculeRenderer r,
                              java.util.Vector ids)
Select a set of atoms on the basis of ids.


residue

public static byte[] residue(MoleculeRenderer r,
                             java.util.Vector ids)
Select a set of atoms on the basis of ids.


modulo

public static byte[] modulo(MoleculeRenderer r,
                            int n)
Select a set of atoms on the basis of ids.


composite

public static byte[] composite(MoleculeRenderer r,
                               java.util.Vector ids)
Select a set of atoms on the basis of ids.


sequential

public static byte[] sequential(MoleculeRenderer r,
                                java.util.Vector ids)
Select a set of atoms on the basis of ids.


insertion

public static byte[] insertion(MoleculeRenderer r,
                               java.lang.String insertionCode)
Select a set of atoms on the basis of insertion code.


molecule

public static byte[] molecule(MoleculeRenderer r,
                              java.util.Vector ids)
Select a set of atoms on the basis of molecule name.


moleculeExact

public static byte[] moleculeExact(MoleculeRenderer r,
                                   java.util.Vector ids)
Select a set of atoms on the basis of molecule name.


byresidue

public static byte[] byresidue(MoleculeRenderer r,
                               byte[] mask)
Select a set of atoms on the basis of residue names.


bonded

public static byte[] bonded(MoleculeRenderer r,
                            byte[] mask)
Select a set of atoms on the basis of residue names.


name

public static byte[] name(MoleculeRenderer r,
                          java.util.Vector ids)
Select a set of atoms on the basis of residue names.


chain

public static byte[] chain(MoleculeRenderer r,
                           java.util.Vector ids)
Select a set of atoms on the basis of residue names.


atom

public static byte[] atom(MoleculeRenderer r,
                          java.util.Vector ids)
Select a set of atoms on the basis of atom ids.


group

public static byte[] group(MoleculeRenderer r,
                           java.util.Hashtable group)
Select a set of atoms in a group.


id

public static byte[] id(MoleculeRenderer r,
                        java.util.Vector ids)
Select a set of atoms on the basis of ids.


element

public static byte[] element(MoleculeRenderer r,
                             java.util.Vector ids)
Select a set of atoms on the basis of elements.


current

public static byte[] current(MoleculeRenderer r)
Return the current selection.


property

public static byte[] property(MoleculeRenderer r,
                              int property)
Return atoms that have the specified property.


displayed

public static byte[] displayed(MoleculeRenderer r)
Return the atoms that are actively displayed. Also check to see if the molecule that contains the atom is displayed. Used to check the molecule display status as well as the atom, but this was arguably wrong as it could result in atoms in turned off molecueles getting changed unexpectedly.


labelled

public static byte[] labelled(MoleculeRenderer r)
Return the current selection.


defaultSelection

public static byte[] defaultSelection(MoleculeRenderer r)
Return the default selection. If any atoms are selected they are returned, otherwise all atoms are returned.


wide

public static byte[] wide(MoleculeRenderer r)
Return the current selection.


sphere

public static byte[] sphere(MoleculeRenderer r,
                            double rad,
                            double x,
                            double y,
                            double z)
Return a set of atoms withinin a sphere.


sphere

public static byte[] sphere(MoleculeRenderer r,
                            double rad,
                            byte[] sphereMask)
Return a set of atoms withinin a sphere.


contact

public static byte[] contact(MoleculeRenderer r,
                             double rad,
                             byte[] sphereMask)
Return a set of atoms withinin a tolerance of sum of vdw radii.


graph

public static byte[] graph(MoleculeRenderer r,
                           byte[] graphMask)
Return a set of atoms in a connected graph.


compositeSelection

public static byte[] compositeSelection(MoleculeRenderer r,
                                        java.util.Vector molecules,
                                        java.util.Vector chains,
                                        java.util.Vector residues,
                                        java.util.Vector atoms)
Composite specification.


and

public static byte[] and(byte[] mask1,
                         byte[] mask2)
And two selection masks together.


or

public static byte[] or(byte[] mask1,
                        byte[] mask2)
Or two selection masks together.


not

public static byte[] not(byte[] mask1)
Not a selection mask.


builtin

public static byte[] builtin(MoleculeRenderer r,
                             DynamicArray names)
Evaluate a builtin expression against residue names.


builtin2

public static byte[] builtin2(MoleculeRenderer r,
                              DynamicArray names)
Evaluate a builtin expression atom names.


builtin3

public static byte[] builtin3(MoleculeRenderer r,
                              DynamicArray names)
Evaluate a builtin expression atom names.


aminoacid

public static byte[] aminoacid(MoleculeRenderer r)
Aminoacid expression.


solvent

public static byte[] solvent(MoleculeRenderer r)
Solvent expression.


dna

public static byte[] dna(MoleculeRenderer r)
DNA expression.


ions

public static byte[] ions(MoleculeRenderer r)
Ions expression.