8#ifndef IMPATOM_SELECTION_H
9#define IMPATOM_SELECTION_H
11#include <IMP/atom/atom_config.h>
12#include <IMP/atom/internal/SelectionPredicate.h>
18#include <IMP/algebra/algebra_config.h>
23#include <boost/unordered_map.hpp>
25IMPATOM_BEGIN_NAMESPACE
91 IMP_NAMED_TUPLE_2(SearchResult, SearchResults,
bool, match,
94 boost::dynamic_bitset<> parent,
95 bool include_children,
96 bool found_rep_node=
false)
const;
98 void add_predicate(internal::SelectionPredicate *p);
99 void init_predicate();
112 double resolution = 0,
114 std::string molecule = None,
115 int residue_index = None, std::string chain_id = None,
116 AtomType atom_type = None, ResidueType residue_type = None,
117 Ints hierarchy_types = None,
Element element = None,
118 Terminus terminus = None,
121 Ints copy_indexes = [],
int state_index = -1,
122 Ints state_indexes = []);
133#if !defined(IMP_DOXYGEN) && !defined(SWIG)
153 { representation_type_ = t; }
239 operator ParticlesTemp()
const {
return get_selected_particles(); }
269 const Selections &s,
double k, std::string name =
"Connectivity%1%");
280 std::string name =
"Connectivity%1%");
289 const Selection &s,
double k, std::string name =
"Connectivity%1%");
301 std::string name =
"Connectivity%1%");
317 std::string name = std::string());
324#ifdef IMP_ALGEBRA_USE_IMP_CGAL
354 mutable boost::unordered_map<Particle *, Pointer<Geometry>>
A decorator for Representations.
A decorator for Residues.
A particle with a user-defined type.
Decorator for a sphere-like particle.
Decorator for helping deal with a hierarchy of molecules.
Class for storing model, its restraints, constraints, and particles.
Take Decorator, Particle or ParticleIndex.
Class to handle individual particles of a Model object.
A restraint is a term in an IMP ScoringFunction.
The standard decorator for manipulating molecular structures.
display::Geometries get_components() const override
Return a set of geometry composing this one.
Select hierarchy particles identified by the biological name.
void set_terminus(Terminus t)
Select the leaf particles at the N or C terminus.
void set_copy_index(unsigned int copy)
Select elements with Copy::get_copy_index() that match.
ParticleIndexes get_selected_particle_indexes(bool with_representation=true) const
Get the indexes of the selected particles.
ParticlesTemp get_selected_particles(bool with_representation=true) const
Get the selected particles.
Selection(Hierarchy hierarchy=None, Hierarchies hierarchies=[], Strings molecules=[], Ints residue_indexes=[], Strings chain_ids=[], AtomTypes atom_types=[], ResidueTypes residue_types=[], Strings domains=[], double resolution=0, RepresentationType representation_type=IMP.atom.BALLS, std::string molecule=None, int residue_index=None, std::string chain_id=None, AtomType atom_type=None, ResidueType residue_type=None, Ints hierarchy_types=None, Element element=None, Terminus terminus=None, std::string domain=None, core::ParticleType particle_type=None, core::ParticleTypes particle_types=[], int copy_index=-1, Ints copy_indexes=[], int state_index=-1, Ints state_indexes=[])
void set_copy_indexes(Ints copies)
Select elements with Copy::get_copy_index() that are in the list.
void set_domains(Strings names)
Select domains with the specified names.
void set_element(Element e)
Select atoms of the given Element.
void set_chain_id(std::string c)
Select with the passed chain id.
void set_resolution(double r)
Select at a Representation node with a resolution close to r.
void set_residue_index(int i)
Select only residues with the passed index.
void set_union(const Selection &s)
Select elements that are in either this Selection or the passed one.
void set_residue_type(ResidueType type)
Select only residues with the passed type.
void set_difference(const Selection &s)
Select elements that are in this Selection but not the passed one.
void set_atom_types(AtomTypes types)
Select atoms whose types are in the list, eg AT_CA.
void set_molecules(Strings mols)
Select based on the molecule name.
void set_particle_type(core::ParticleType t)
Select elements that match the core::ParticleType.
void set_hierarchy_types(Ints types)
void set_atom_type(AtomType types)
Select atoms with only the passed type.
void set_intersection(const Selection &s)
Select elements that are in both this Selection and the passed one.
void set_domain(std::string name)
Select only the single domain with that name.
Selection create_clone()
Make a clone of this Selection.
void set_residue_types(ResidueTypes types)
Select residues whose types are in the list.
Hierarchies get_hierarchies() const
Return the hierarchies that the Selection was constructed with.
void set_chain_ids(Strings chains)
Select particles in chains with the given ids.
void set_particle_types(core::ParticleTypes t)
Select elements that match the core::ParticleType.
void set_symmetric_difference(const Selection &s)
Select elements that are in this Selection or the passed one but not both.
void set_state_index(int state)
Select State with the passed index.
void set_representation_type(RepresentationType t)
Try to find this representation type.
void set_molecule(std::string mol)
Select a molecule with the passed name.
void set_state_indexes(Ints states)
Select State with the passed indexes.
void set_residue_indexes(Ints indexes)
Select residues whose indexes are in the passed list.
A decorator for a particle with x,y,z coordinates and a radius.
The base class for geometry.
Implement geometry for the basic shapes from IMP.algebra.
Define the elements used in IMP.
Functionality for loading, creating, manipulating and scoring atomic structures.
double get_surface_area(const Selection &s)
Get the total surface area of a hierarchy, in square angstroms.
IMP::Vector< Selection > Selections
IMP::Vector< AtomType > AtomTypes
IMP::Vector< ResidueType > ResidueTypes
Restraint * create_internal_connectivity_restraint(const Selection &s, double k, std::string name="Connectivity%1%")
Create a restraint connecting the selection.
double get_radius_of_gyration(const ParticlesTemp &ps, bool weighted=true)
Element
The various elements currently supported/known.
Restraint * create_connectivity_restraint(const Selections &s, double k, std::string name="Connectivity%1%")
Create a restraint connecting the selections.
double get_mass(ResidueType c)
Get the mass from the residue type.
Restraint * create_distance_restraint(const Selection &n0, const Selection &n1, double x0, double k, std::string name="Distance%1%")
double get_volume(const Selection &s)
Get the total volume of a hierarchy, in cubic angstroms.
Restraint * create_excluded_volume_restraint(const Hierarchies &hs, double resolution=-1)
core::XYZR create_cover(const Selection &s, std::string name=std::string())
Hierarchies get_leaves(const Selection &h)
Key< 34897493 > ParticleType
An IMP::Key object for identifying types of particles by strings.
IMP::Vector< ParticleType > ParticleTypes
IMP::Vector< IMP::Pointer< Geometry > > Geometries
Base functionality and abstract base classes for representation, scoring and sampling.
Index< ParticleIndexTag > ParticleIndex
IMP::Vector< Int > Ints
Standard way to pass a bunch of Int values.
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
IMP::Vector< String > Strings
Standard way to pass a bunch of String values.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
#define IMP_SHOWABLE(Name)
A smart pointer to a reference counted object.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.