entities.MoleculeSelector
entities.MoleculeSelector(self , mol= None )
A helper to create selections for Molecules and AtomArrays.
The selection (self.mask) is not computed or returned until the evaluate_on_array
method is called. Until then methods are stored for later evaluation.
Parameters
mol
Molecule
The molecule object to select from.
None
Attributes
mol
Molecule
The molecule object to select from.
mask
ndarray or None
Boolean array for the selection on the most recently evaluated array.
pending_selections
list
List of selection operations to be applied once evaluate_on_array
is called.
Methods
atom_name
entities.MoleculeSelector.atom_name(atom_name)
Select atoms by their name.
Parameters
atom_name
str or list of str or tuple of str or ndarray
The atom name(s) to select.
required
Returns
Selector
Returns self for method chaining.
chain_id
entities.MoleculeSelector.chain_id(chain_id)
Select atoms by chain identifier.
Parameters
chain_id
list of str or tuple of str or ndarray
The chain identifier(s) to select.
required
Returns
Selector
Returns self for method chaining.
element
entities.MoleculeSelector.element(element)
Select atoms by element symbol.
Parameters
element
list of str or tuple of str or ndarray
The element symbol(s) to select.
required
Returns
Selector
Returns self for method chaining.
evaluate_on_array
entities.MoleculeSelector.evaluate_on_array(array)
Evaluate this selection on the AtomArray.
Parameters
array
AtomArray or AtomArrayStack
The atomic structure to evaluate the selection on.
required
Returns
ndarray
Boolean mask array indicating which atoms match the selection criteria.
Notes
All of the selection operations that have been staged for this Selector are evaluated and combined with a logical AND, using the AtomArray as input.
is_amino_acid
entities.MoleculeSelector.is_amino_acid()
Select amino acid residues.
Returns
Selector
Returns self for method chaining.
is_backbone
entities.MoleculeSelector.is_backbone()
Select backbone atoms for peptide and nucleotide.
is_canonical_amino_acid
entities.MoleculeSelector.is_canonical_amino_acid()
Select canonical amino acid residues.
Returns
Selector
Returns self for method chaining.
is_canonical_nucleotide
entities.MoleculeSelector.is_canonical_nucleotide()
Select canonical nucleotide residues.
Returns
Selector
Returns self for method chaining.
is_carbohydrate
entities.MoleculeSelector.is_carbohydrate()
Select carbohydrate residues.
Returns
Selector
Returns self for method chaining.
is_hetero
entities.MoleculeSelector.is_hetero()
Select hetero atoms.
Returns
Selector
Returns self for method chaining.
is_ligand
entities.MoleculeSelector.is_ligand()
Select ligand atoms.
Returns
Selector
Returns self for method chaining.
is_monoatomic_ion
entities.MoleculeSelector.is_monoatomic_ion()
Select monoatomic ions.
Returns
Selector
Returns self for method chaining.
is_nucleotide
entities.MoleculeSelector.is_nucleotide()
Select nucleotide residues.
Returns
Selector
Returns self for method chaining.
is_peptide_backbone
entities.MoleculeSelector.is_peptide_backbone()
Select peptide backbone atoms.
Returns
Selector
Returns self for method chaining.
is_phosphate_backbone
entities.MoleculeSelector.is_phosphate_backbone()
Select phosphate backbone atoms.
Returns
Selector
Returns self for method chaining.
is_polymer
entities.MoleculeSelector.is_polymer()
Select polymer atoms.
Returns
Selector
Returns self for method chaining.
is_solvent
entities.MoleculeSelector.is_solvent()
Select solvent atoms.
Returns
Selector
Returns self for method chaining.
linear_bond_continuity
entities.MoleculeSelector.linear_bond_continuity()
Select atoms with linear bond continuity.
Returns
Selector
Returns self for method chaining.
not_amino_acids
entities.MoleculeSelector.not_amino_acids()
Select non-amino acid residues.
Returns
Selector
Returns self for method chaining.
not_atom_names
entities.MoleculeSelector.not_atom_names(atomname)
Select atoms not matching the specified atom names.
Parameters
atomname
str or list of str
The atom name(s) to exclude.
required
Returns
Selector
Returns self for method chaining.
not_canonical_amino_acids
entities.MoleculeSelector.not_canonical_amino_acids()
Select non-canonical amino acid residues.
Returns
Selector
Returns self for method chaining.
not_canonical_nucleotides
entities.MoleculeSelector.not_canonical_nucleotides()
Select non-canonical nucleotide residues.
Returns
Selector
Returns self for method chaining.
not_carbohydrates
entities.MoleculeSelector.not_carbohydrates()
Select non-carbohydrate residues.
Returns
Selector
Returns self for method chaining.
not_chain_id
entities.MoleculeSelector.not_chain_id(chain_id)
Select atoms not in the specified chains.
Parameters
chain_id
str or list of str
The chain identifier(s) to exclude.
required
Returns
Selector
Returns self for method chaining.
not_element
entities.MoleculeSelector.not_element(element)
Select atoms not matching the specified elements.
Parameters
element
str or list of str
The element symbol(s) to exclude.
required
Returns
Selector
Returns self for method chaining.
not_hetero
entities.MoleculeSelector.not_hetero()
Select non-hetero atoms.
Returns
Selector
Returns self for method chaining.
not_monoatomic_ions
entities.MoleculeSelector.not_monoatomic_ions()
Select non-monoatomic ion atoms.
Returns
Selector
Returns self for method chaining.
not_nucleotides
entities.MoleculeSelector.not_nucleotides()
Select non-nucleotide residues.
Returns
Selector
Returns self for method chaining.
not_peptide_backbone
entities.MoleculeSelector.not_peptide_backbone()
Select non-peptide backbone atoms.
Returns
Selector
Returns self for method chaining.
not_phosphate_backbone
entities.MoleculeSelector.not_phosphate_backbone()
Select non-phosphate backbone atoms.
Returns
Selector
Returns self for method chaining.
not_polymer
entities.MoleculeSelector.not_polymer()
Select non-polymer atoms.
Returns
Selector
Returns self for method chaining.
not_res_id
entities.MoleculeSelector.not_res_id(num)
Select atoms not matching the specified residue IDs.
Parameters
num
int or list of int
The residue ID(s) to exclude.
required
Returns
Selector
Returns self for method chaining.
not_res_name
entities.MoleculeSelector.not_res_name(res_name)
Select atoms not matching the specified residue names.
Parameters
res_name
str or list of str
The residue name(s) to exclude.
required
Returns
Selector
Returns self for method chaining.
not_solvent
entities.MoleculeSelector.not_solvent()
Select non-solvent atoms.
Returns
Selector
Returns self for method chaining.
res_id
entities.MoleculeSelector.res_id(num)
Select atoms by residue ID.
Parameters
num
int or list of int
The residue ID(s) to select.
required
Returns
Selector
Returns self for method chaining.
res_name
entities.MoleculeSelector.res_name(res_name)
Select atoms by residue name.
Parameters
res_name
str or list of str
The residue name(s) to select.
required
Returns
Selector
Returns self for method chaining.
reset
entities.MoleculeSelector.reset()
Reset all pending selections and the mask
Returns
self
Selector
Returns self for method chaining
store_selection
entities.MoleculeSelector.store_selection(name)
Evaluate and store the current selection as a named attribute on the Molecule
Parameters
name
str
The name to store the selection under.
required
Raises
ValueError
If no selection has been made.