Parser of atom selection expressions. Full description of the syntax can be
found at the Cuby wiki.
class SelectionParser
parse_on_geometry(geometry, string)
module GeometrySelections
The almighty method and one derivative of it
atomlist_from_selection(selection)
Get list of atoms (array of indexes) that match the selection
geometry_from_selection(selection)
Get Geometry object of atoms that match the selection
Reverse: string from atomlist
GeometrySelections.atomlist_to_string(atomlist, first = 1) # => String
Convert atom list (array of indexes) to selection expression
in the simple syntax (list of index ranges).
Private methods
atomlist_from_subselection(selection)
Parse elementary selection expression
atomlist_from_simple_selection(selection)
Parse elementary expression in the simple syntax
atomlist_from_atom_selection_fragment(fragment)
return array of indexes of atoms that matches following selections:
- atom number (starting from 1) (i.e. 5)
- atom number range (i.e. 1-10)
- element (all atoms of selected element)
atomlist_of_element(element)
return array of indexes of atoms of the specified element
residuelist_from_residue_selection_fragment(fragment)
return array of indexes of residues that matches following selections:
- residue number (starting from 1) (i.e. 5)
- residue number range (i.e. 1-10)
- residue name (all residues of this name)
residuelist_of_name(name)
Get list of residue numbers for residues of given name
atomlist_from_reslist(reslist)
Get atom list from list of residue numbers
Special selections
atomlist_from_special_selection(selection)
Special selection functions
Set operations
GeometrySelections.overlap?(atomlist1, atomlist2) # => true/false
Check overlap of two atomlists