|
Pteros
2.0
Molecular modeling library for human beings!
|
39 #include "pteros/core/atom_handler.h"
40 #include "pteros/core/system.h"
41 #include "pteros/core/typedefs.h"
47 class SelectionParser;
68 friend class Grid_searcher;
105 std::vector<int>::iterator it1,
106 std::vector<int>::iterator it2);
117 const std::function<
void(
const System&,
int,std::vector<int>&)>& callback,
136 return !(*
this == other);
207 void append(
const std::vector<Selection>& sel_vec);
226 void modify(std::string str,
int fr = 0);
229 void modify(
int ind1,
int ind2);
233 void modify(
const std::vector<int>& ind);
237 void modify(std::vector<int>::iterator it1, std::vector<int>::iterator it2);
247 void modify(
const std::function<
void(
const System&,
int,std::vector<int>&)>& callback,
int fr = 0);
250 void modify(
const System& sys, std::string str,
int fr = 0);
256 void modify(
const System& sys,
const std::vector<int>& ind);
260 std::vector<int>::iterator it1,
261 std::vector<int>::iterator it2);
264 void modify(
const System& sys,
const std::function<
void(
const System&,
int,std::vector<int>&)>& callback,
int fr = 0);
325 Selection operator()(
int ind1,
int ind2);
329 Selection operator()(
const std::vector<int>& ind);
337 std::vector<int>::const_iterator
index_begin()
const {
return _index.begin(); }
340 std::vector<int>::const_iterator
index_end()
const {
return _index.end(); }
344 return std::back_inserter(_index);
380 std::vector<char>
get_chain(
bool unique=
false)
const;
384 void set_chain(
const std::vector<char>& data);
392 std::vector<int>
get_resid(
bool unique=
false)
const;
396 void set_resid(
const std::vector<int>& data);
403 std::vector<std::string>
get_name(
bool unique=
false)
const;
407 void set_name(
const std::vector<std::string>& data);
414 std::vector<std::string>
get_resname(
bool unique=
false)
const;
418 void set_resname(
const std::vector<std::string>& data);
432 Eigen::MatrixXf
get_xyz(
bool make_row_major_matrix =
false)
const;
435 void set_xyz(MatrixXf_const_ref coord);
439 std::vector<float>
get_mass()
const;
443 void set_mass(
const std::vector<float>& m);
450 std::vector<float>
get_beta()
const;
454 void set_beta(
const std::vector<float>& data);
476 void set_charge(
const std::vector<float>& data);
485 std::vector<std::string>
get_tag(
bool unique=
false)
const;
489 void set_tag(
const std::vector<std::string>& data);
492 void set_tag(std::string data);
498 Eigen::MatrixXf
get_vel(
bool make_row_major_matrix =
false)
const;
501 void set_vel(MatrixXf_const_ref data);
506 Eigen::MatrixXf
get_force(
bool make_row_major_matrix =
false)
const;
509 void set_force(MatrixXf_const_ref coord);
532 Eigen::Vector3f
center(
bool mass_weighted =
false,
533 Array3i_const_ref pbc = noPBC,
534 int pbc_atom = -1)
const;
537 Eigen::Vector3f
center(
const std::vector<float>& weights,
538 Array3i_const_ref pbc = noPBC,
539 int pbc_atom = -1)
const;
542 void minmax(Vector3f_ref min, Vector3f_ref max)
const;
546 std::vector<float>* area_per_atom =
nullptr,
547 float* total_volume =
nullptr,
548 std::vector<float>* volume_per_atom =
nullptr)
const;
551 float sasa(
float probe_r = 0.14, std::vector<float>* area_per_atom =
nullptr,
int n_sphere_points = 960)
const;
554 Eigen::MatrixXf
average_structure(
int b=0,
int e=-1,
bool make_row_major_matrix =
false)
const;
560 Eigen::MatrixXf
atom_traj(
int ind,
int b=0,
int e=-1,
bool make_row_major_matrix =
false)
const;
569 void inertia(Vector3f_ref moments, Matrix3f_ref axes,
570 Array3i_const_ref pbc = noPBC,
571 int pbc_atom = -1)
const;
580 float gyration(Array3i_const_ref pbc = noPBC,
int pbc_atom = -1)
const;
588 Eigen::Vector3f dipole(
bool as_charged=
false, Array3i_const_ref pbc = fullPBC,
int pbc_atom = -1)
const;
593 float distance(
int i,
int j, Array3i_const_ref pbc = fullPBC)
const;
598 float angle(
int i,
int j,
int k, Array3i_const_ref pbc = fullPBC)
const;
603 float dihedral(
int i,
int j,
int k,
int l, Array3i_const_ref pbc = fullPBC)
const;
616 bool mass_weighted =
false,
617 Array3i_const_ref pbc = noPBC,
624 void rotate(Vector3f_const_ref pivot, Vector3f_const_ref axis,
float angle);
627 void mirror(
int dim,
float around=0);
630 void mirror(Vector3f_const_ref normal, Vector3f_const_ref point=Eigen::Vector3f::Zero());
633 void wrap(Array3i_const_ref pbc = fullPBC);
642 void unwrap(Array3i_const_ref pbc = fullPBC,
int pbc_atom = -1);
651 int unwrap_bonds(
float d, Array3i_const_ref pbc = fullPBC,
int pbc_atom = -1);
658 Eigen::Affine3f
principal_transform(Array3i_const_ref pbc = noPBC,
int pbc_atom = -1)
const;
679 float rmsd(
int fr)
const;
682 float rmsd(
int fr1,
int fr2)
const;
708 void fit(
int fr1,
int fr2);
721 Eigen::Vector2f
non_bond_energy(
float cutoff=0,
bool pbc =
true)
const;
736 void write(std::string fname,
int b=-1,
int e=-1)
const;
738 void write(
const std::unique_ptr<FileHandler>& handler, FileContent what,
int b=-1,
int e=-1)
const;
747 int size()
const {
return _index.size();}
817 void split(std::vector<Selection>& parts, F callback){
820 using Ret = decltype(callback(*
this,0));
821 map<Ret,vector<int> > m;
822 for(
int i=0; i<
size(); ++i){
823 m[callback(*
this,i)].push_back(
index(i));
827 for(it=m.begin();it!=m.end();it++){
828 parts.emplace_back(*system, it->second.begin(), it->second.end());
845 void dssp(std::string fname)
const;
848 void dssp(std::ostream& os)
const;
863 std::string
dssp()
const;
878 inline float&
x(
int ind) {
return system->traj[frame].coord[_index[ind]](0); }
879 inline float x(
int ind)
const {
return system->traj[frame].coord[_index[ind]](0); }
881 inline float&
x(
int ind,
int fr) {
return system->traj[fr].coord[_index[ind]](0); }
882 inline float x(
int ind,
int fr)
const {
return system->traj[fr].coord[_index[ind]](0); }
885 inline float&
y(
int ind) {
return system->traj[frame].coord[_index[ind]](1); }
886 inline float y(
int ind)
const {
return system->traj[frame].coord[_index[ind]](1); }
888 inline float&
y(
int ind,
int fr) {
return system->traj[fr].coord[_index[ind]](1); }
889 inline float y(
int ind,
int fr)
const {
return system->traj[fr].coord[_index[ind]](1); }
892 inline float&
z(
int ind) {
return system->traj[frame].coord[_index[ind]](2); }
893 inline float z(
int ind)
const {
return system->traj[frame].coord[_index[ind]](2); }
895 inline float&
z(
int ind,
int fr) {
return system->traj[fr].coord[_index[ind]](2); }
896 inline float z(
int ind,
int fr)
const {
return system->traj[fr].coord[_index[ind]](2); }
899 inline Eigen::Vector3f&
xyz(
int ind) {
return system->traj[frame].coord[_index[ind]]; }
900 inline const Eigen::Vector3f&
xyz(
int ind)
const {
return system->traj[frame].coord[_index[ind]]; }
902 inline Eigen::Vector3f&
xyz(
int ind,
int fr) {
return system->traj[fr].coord[_index[ind]]; }
903 inline const Eigen::Vector3f&
xyz(
int ind,
int fr)
const {
return system->traj[fr].coord[_index[ind]]; }
907 inline Eigen::Vector3f*
xyz_ptr(
int ind)
const {
return &(system->traj[frame].coord[_index[ind]]); }
908 inline Eigen::Vector3f*
xyz_ptr(
int ind,
int fr)
const {
return &(system->traj[fr].coord[_index[ind]]); }
911 inline Eigen::Vector3f&
vel(
int ind) {
return system->traj[frame].vel[_index[ind]]; }
912 inline const Eigen::Vector3f&
vel(
int ind)
const {
return system->traj[frame].vel[_index[ind]]; }
914 inline Eigen::Vector3f&
vel(
int ind,
int fr) {
return system->traj[fr].vel[_index[ind]]; }
915 inline const Eigen::Vector3f&
vel(
int ind,
int fr)
const {
return system->traj[fr].vel[_index[ind]]; }
918 inline Eigen::Vector3f&
force(
int ind) {
return system->traj[frame].force[_index[ind]]; }
919 inline const Eigen::Vector3f&
force(
int ind)
const {
return system->traj[frame].force[_index[ind]]; }
921 inline Eigen::Vector3f&
force(
int ind,
int fr) {
return system->traj[fr].force[_index[ind]]; }
922 inline const Eigen::Vector3f&
force(
int ind,
int fr)
const {
return system->traj[fr].force[_index[ind]]; }
924 #define DEFINE_ACCESSOR(T,prop) \
925 inline T& prop(int ind){ return system->atoms[_index[ind]].prop; } \
926 inline const T& prop(int ind) const { return system->atoms[_index[ind]].prop; }
929 DEFINE_ACCESSOR(
int,type)
931 DEFINE_ACCESSOR(std::string,type_name)
933 DEFINE_ACCESSOR(std::string,resname)
935 DEFINE_ACCESSOR(
char,chain)
937 DEFINE_ACCESSOR(std::string,name)
939 DEFINE_ACCESSOR(
float,mass)
941 DEFINE_ACCESSOR(
float,charge)
943 DEFINE_ACCESSOR(
float,beta)
945 DEFINE_ACCESSOR(
float,occupancy)
947 DEFINE_ACCESSOR(
int,resid)
949 DEFINE_ACCESSOR(std::string,tag)
952 inline
int index(
int ind)
const {
return _index[ind]; }
955 inline Atom&
atom(
int ind){
return system->atoms[_index[ind]]; }
956 inline const Atom&
atom(
int ind)
const {
return system->atoms[_index[ind]]; }
959 DEFINE_ACCESSOR(
int,resindex)
961 DEFINE_ACCESSOR(
int,atomic_number)
964 float vdw(
int ind)
const;
980 inline const PeriodicBox&
box()
const {
return system->traj[frame].box; }
990 inline float&
time() {
return system->traj[frame].time; }
991 inline const float&
time()
const {
return system->traj[frame].time; }
997 std::string sel_text;
999 std::vector<int> _index;
1007 std::unique_ptr<SelectionParser> parser;
1008 void allocate_parser();
1009 void sort_and_remove_duplicates();
1010 void process_pbc_atom(
int& a)
const;
1011 void get_local_bonds_from_topology(std::vector<std::vector<int>>& con)
const;
1019 using difference_type = size_t;
1022 using iterator_category = std::random_access_iterator_tag;
1025 index_it = sel.index_begin() + i;
1026 proxy.set(sel,*index_it);
1028 iterator operator++(
int junk) {
iterator tmp = *
this; advance_proxy();
return tmp; }
1029 iterator& operator++() { advance_proxy();
return *
this; }
1030 iterator& operator+(
int i) {advance_proxy(i);
return *
this;}
1033 pointer operator->() {
return &proxy; }
1040 std::vector<int>::const_iterator index_it;
1042 void advance_proxy(
int n=1){
1043 int offset = *index_it;
1045 offset = *index_it-offset;
1046 proxy.ind = *index_it;
1047 proxy.atom_ptr += offset;
1048 proxy.coord_ptr += offset;
1053 bool check_selection_overlap(
const std::vector<Selection> &sel_vec);
Selection class.
Definition: selection.h:65
std::vector< int >::const_iterator index_end() const
Get const iterator for the end of index.
Definition: selection.h:340
std::string get_text() const
Get selection text If selection is not textual returns generated index-based text "index i j k....
Definition: selection.cpp:761
void update()
Recomputes selection completely.
Definition: selection.cpp:651
bool operator!=(const Selection &other) const
Inequality operator Selection are compared by their indexes.
Definition: selection.h:135
float distance(int i, int j, Array3i_const_ref pbc=fullPBC) const
Get distance between two atoms (periodic in given dimensions if needed).
Definition: selection.cpp:1905
float & y(int ind)
Extracts Y for current frame.
Definition: selection.h:885
void split_by_molecule(std::vector< Selection > &res)
Split selection by molecule definition from topology.
Definition: selection.cpp:1735
void modify(std::string str, int fr=0)
Modifies selection string in existing selection.
Definition: selection.cpp:387
void set_charge(const std::vector< float > &data)
Set charge in selection to the values from supplied vector.
float & time()
Returns time stamp of the frame pointed by selection The same as:
Definition: selection.h:990
friend Selection operator-(const Selection &sel1, const Selection &sel2)
Creates new Selection, by removing all atoms of sel2 from sel1.
Definition: selection.cpp:592
Selection operator~() const
Creates new Selection, which is a logical negation of existing one.
Definition: selection.cpp:523
void set_resid(const std::vector< int > &data)
Set resid's in selection from supplied vector.
Eigen::Vector3f & xyz(int ind, int fr)
Extracts X,Y and Z for given frame fr.
Definition: selection.h:902
Eigen::Affine3f principal_transform(Array3i_const_ref pbc=noPBC, int pbc_atom=-1) const
Get transform for orienting selection by principal axes.
Definition: selection.cpp:2006
std::vector< float > get_occupancy() const
Get occupancy.
float get_total_charge() const
Computes total charge of selection.
Definition: selection.cpp:860
bool operator==(const Selection &other) const
Equality operator Selection are compared by their indexes.
Definition: selection.cpp:511
float gyration(Array3i_const_ref pbc=noPBC, int pbc_atom=-1) const
Computes radius of gyration for selection.
Definition: selection.cpp:1867
friend Eigen::Affine3f fit_transform(const Selection &sel1, const Selection &sel2)
Returns fitting transformation for two given selections of the same size.
Definition: selection.cpp:1220
Selection & operator=(const Selection &other)
Assignment operator.
Definition: selection.cpp:484
std::vector< float > get_charge() const
Get charge.
void split_by_connectivity(float d, std::vector< Selection > &res, bool periodic=true)
Split current selection into several selections according to the interatomic distances.
Definition: selection.cpp:1641
int size() const
Get the size of selection.
Definition: selection.h:747
friend Selection operator&(const Selection &sel1, const Selection &sel2)
Creates new Selection, which is the logical AND of two parent selections.
Definition: selection.cpp:565
std::vector< std::string > get_name(bool unique=false) const
Get vector of all atom names in selection.
int find_index(int global_index) const
Finds local index in selection of provided global index Returns -1 if not found.
Definition: selection.cpp:1518
void split_by_contiguous_index(std::vector< Selection > &parts)
Split selection into contiguous ranges of indexes.
Definition: selection.cpp:1774
std::vector< int > get_resindex(bool unique=false) const
Get vector of all resindexes in selection.
friend void copy_coord(const Selection &from, int from_fr, Selection &to, int to_fr)
Copy coordinates from one selection to the other using given frames.
Definition: selection.cpp:1140
PeriodicBox & box()
Returns periodic box of the frame pointed by selection The same as:
Definition: selection.h:979
void rotate(Vector3f_const_ref pivot, Vector3f_const_ref axis, float angle)
Rotate selection around given axis relative to given pivot.
Definition: selection.cpp:1073
friend void fit(Selection &sel1, const Selection &sel2)
Fit two selection of the same size. sel1 is modified to be fit to sel2.
Definition: selection.cpp:1313
void unwrap(Array3i_const_ref pbc=fullPBC, int pbc_atom=-1)
Unwraps selection to make it whole if possible (without jumps over periodic box boundary).
Definition: selection.cpp:1926
float & z(int ind)
Extracts Z for current frame.
Definition: selection.h:892
std::vector< std::vector< int > > get_internal_bonds(float d, bool periodic=true) const
Get all bonds within this selection returned as local selection indexes in form 1->[2,...
Definition: selection.cpp:1528
void translate(Vector3f_const_ref v)
Translate selection by given vector.
Definition: selection.cpp:1060
iterator end()
End iterator.
Definition: selection.cpp:680
void set_mass(const std::vector< float > &m)
Set atom masses in selection to the values from supplied vector.
void split_by_contiguous_residue(std::vector< Selection > &parts)
Split selection into contiguous ranges of resindexes.
Definition: selection.cpp:1788
void apply()
Recomputes selection without re-parsing selection text.
Definition: selection.cpp:656
std::back_insert_iterator< std::vector< int > > index_back_inserter()
Get back_insert_iterator for index.
Definition: selection.h:343
void append(const Selection &sel)
Append another selection to this one.
Definition: selection.cpp:209
float dihedral(int i, int j, int k, int l, Array3i_const_ref pbc=fullPBC) const
Get dihedral angle in degrees between three atoms (periodic in given dimensions if needed).
Definition: selection.cpp:1915
The system of atoms.
Definition: system.h:93
void set_xyz(MatrixXf_const_ref coord)
Set coordinates of this selection for current frame.
Definition: selection.cpp:787
void inertia(Vector3f_ref moments, Matrix3f_ref axes, Array3i_const_ref pbc=noPBC, int pbc_atom=-1) const
Computes the central momens of inertia and principal axes of inertia.
Definition: selection.cpp:1802
void fit_trajectory(int ref_frame=0, int b=0, int e=-1)
Fit specified frames in the trajectory to reference frame.
Definition: selection.cpp:1341
void set_system(const System &sys)
Sets new system for selection.
Definition: selection.cpp:296
float & z(int ind, int fr)
Extracts Z for given frame frame fr.
Definition: selection.h:895
Eigen::Vector3f * xyz_ptr(int ind) const
Returns pointer to the coordinates of given atom for current frame.
Definition: selection.h:907
iterator begin()
Begin iterator.
Definition: selection.cpp:676
Eigen::Vector2f non_bond_energy(float cutoff=0, bool pbc=true) const
Self-energy of selection computed within given interaction cut-off.
Definition: selection.cpp:1321
void flatten()
"Flattens" selection by removing coordinate dependence and making it not text-based.
Definition: selection.cpp:1493
void translate_to(Vector3f_const_ref p, bool mass_weighted=false, Array3i_const_ref pbc=noPBC, int pbc_atom=-1)
Translate center of masses of selection to given point.
Definition: selection.cpp:1066
float rmsd(int fr) const
RMSD between current and another frame.
Definition: selection.cpp:1122
Eigen::MatrixXf get_vel(bool make_row_major_matrix=false) const
Get velocities of all atoms in this selection for the current frame By default columnt of the matrix ...
Definition: selection.cpp:798
void set_tag(const std::vector< std::string > &data)
Set tags in selection to the values from supplied vector.
void write(std::string fname, int b=-1, int e=-1) const
Write structure or trajectory for selection.
Definition: selection.cpp:1421
std::vector< float > get_beta() const
Get beta.
virtual ~Selection()
Destructor.
Definition: selection.cpp:205
Eigen::Vector3f & vel(int ind, int fr)
Extracts velocity for given frame fr.
Definition: selection.h:914
bool coord_dependent() const
Returns true if selection is coordinate-dependent and is able to recompute itself on the change of fr...
Definition: selection.cpp:1489
friend Selection operator|(const Selection &sel1, const Selection &sel2)
Creates new Selection, which is the logical OR of two parent selections.
Definition: selection.cpp:547
Auxilary type used to incapsulate the atom and its current coordinates Used internally in Selection::...
Definition: atom_handler.h:49
void set_occupancy(const std::vector< float > &data)
Set occupancy in selection to the values from supplied vector.
void split(std::vector< Selection > &parts, F callback)
Split selection by the values returned by custom callback function.
Definition: selection.h:817
void set_name(const std::vector< std::string > &data)
Set atom names in selection from supplied vector.
void mirror(int dim, float around=0)
Mirror selection along one of coordinates around given point.
Definition: selection.cpp:1077
void set_resname(const std::vector< std::string > &data)
Set resnames in selection from supplied vector.
std::vector< int > get_resid(bool unique=false) const
Get vector of all resid's in selection.
float powersasa(float probe_r=0.14, std::vector< float > *area_per_atom=nullptr, float *total_volume=nullptr, std::vector< float > *volume_per_atom=nullptr) const
Get the SASA using powersasa algorithm. Returns area and computes volume and per-atom values if asked...
Definition: selection.cpp:2156
bool text_based() const
Returns true if selection was created from text string and false if it was constructed 'by hand' by a...
Definition: selection.cpp:1485
std::vector< float > get_mass() const
Get masses of all atoms in selection.
std::vector< std::string > get_tag(bool unique=false) const
Get tags.
float vdw(int ind) const
Extracts resindex.
Definition: selection.cpp:1611
void set_chain(const std::vector< char > &data)
Set chains from supplied vector.
Random-access forward iterator for Selection.
Definition: selection.h:1016
Eigen::MatrixXf get_force(bool make_row_major_matrix=false) const
Get forces of all atoms in this selection for the current frame By default columnt of the matrix cont...
Definition: selection.cpp:829
void clear()
Clears selection and frees memory.
Definition: selection.cpp:303
Eigen::MatrixXf atom_traj(int ind, int b=0, int e=-1, bool make_row_major_matrix=false) const
Extracts X,Y,Z for given atom index for specified range of frames (gets trajectory of given atom).
Definition: selection.cpp:1621
bool is_large()
Checks if selection is larger than 1/2 of the box size in any dimension.
Definition: selection.cpp:897
System * get_system() const
Get pointer to the system, which is pointed by this selection.
Definition: selection.h:370
void set_force(MatrixXf_const_ref coord)
Set forces of this selection for current frame.
Definition: selection.cpp:845
Eigen::Vector3f & force(int ind, int fr)
Extracts force for given frame fr.
Definition: selection.h:921
std::vector< int >::const_iterator index_begin() const
Get const iterator for begin of index.
Definition: selection.h:337
Atom & atom(int ind)
Extracts whole atom.
Definition: selection.h:955
friend std::ostream & operator<<(std::ostream &os, const Selection &sel)
Writing selection to stream.
Definition: selection.cpp:584
void invert()
Inverts selection in place by selecting those atoms which were not selected.
Definition: selection.cpp:272
std::vector< std::string > get_resname(bool unique=false) const
Get vector of all resnames in selection.
void principal_orient(Array3i_const_ref pbc=noPBC, int pbc_atom=-1)
Orient molecule by its principal axes.
Definition: selection.cpp:2042
Eigen::Vector3f & force(int ind)
Extracts force for current frame.
Definition: selection.h:918
std::vector< char > get_chain(bool unique=false) const
Get vector of all chains in selection.
Class encapsulating all operations with arbitrary triclinic periodic boxes This class stores the peri...
Definition: periodic_box.h:43
Eigen::Vector3f center(bool mass_weighted=false, Array3i_const_ref pbc=noPBC, int pbc_atom=-1) const
Get the center of selection.
Definition: selection.cpp:911
float sasa(float probe_r=0.14, std::vector< float > *area_per_atom=nullptr, int n_sphere_points=960) const
Get SASA using Shrake and Rupley algorithm (slower than powersasa and can't compute volumes)
Definition: selection.cpp:2167
int unwrap_bonds(float d, Array3i_const_ref pbc=fullPBC, int pbc_atom=-1)
Unwraps selection to make it whole (without jumps over periodic box boundary).
Definition: selection.cpp:1939
float & x(int ind, int fr)
Extracts X for given frame frame fr.
Definition: selection.h:881
std::vector< int > get_index() const
Get vector of all indexes in selection.
Definition: selection.h:377
Selection parser class.
Definition: selection_parser.h:59
int num_residues() const
Returns total number of residues in selection. Partial residues are also included.
Definition: selection.cpp:2047
Selection()
Default constructor for empty selection.
Definition: selection.cpp:89
Eigen::MatrixXf average_structure(int b=0, int e=-1, bool make_row_major_matrix=false) const
Computes average structure over the range of frames.
Definition: selection.cpp:867
void wrap(Array3i_const_ref pbc=fullPBC)
Wraps whole selection to the periodic box.
Definition: selection.cpp:1920
Eigen::Vector3f & xyz(int ind)
Extracts X,Y and Z for current frame.
Definition: selection.h:899
float angle(int i, int j, int k, Array3i_const_ref pbc=fullPBC) const
Get angle in degrees between three atoms (periodic in given dimensions if needed).
Definition: selection.cpp:1910
void set_vel(MatrixXf_const_ref data)
Set velocities of this selection for current frame.
Definition: selection.cpp:814
void set_frame(int fr)
Set current frame for selection.
Definition: selection.cpp:663
AtomHandler operator[](int ind)
Indexing operator.
Definition: selection.cpp:515
void set_beta(const std::vector< float > &data)
Set beta in selection to the values from supplied vector.
void split_by_residue(std::vector< Selection > &res)
Split selection by residue index.
Definition: selection.cpp:1719
void minmax(Vector3f_ref min, Vector3f_ref max) const
Get minimal and maximal coordinates in selection.
Definition: selection.cpp:1387
void split_by_chain(std::vector< Selection > &chains)
Split selection by chain.
Definition: selection.cpp:1758
void each_residue(std::vector< Selection > &sel) const
Selects each residue, which is referenced by selection.
Definition: selection.cpp:1555
std::string element_name(int ind) const
Extracts element name based on element_number. Read only.
Definition: selection.cpp:1615
int get_frame() const
Get current frame selection is pointing to.
Definition: selection.h:363
std::string dssp() const
Determines secondary structure with DSSP algorithm and return it as a code string.
Definition: selection.cpp:1602
float & y(int ind, int fr)
Extracts Y for given frame frame fr.
Definition: selection.h:888
Class which represents a single atom.
Definition: atom.h:39
std::string to_gromacs_ndx(std::string name) const
Returns a string formatted as Gromacs ndx file containing the current selection with given name.
Definition: selection.cpp:1499
int index(int ind) const
Extracts type.
Definition: selection.h:952
void apply_transform(const Eigen::Affine3f &t)
Apply transformation.
Definition: selection.cpp:1130
Eigen::MatrixXf get_xyz(bool make_row_major_matrix=false) const
Get coordinates of all atoms in this selection for the current frame By default columnt of the matrix...
Definition: selection.cpp:773
float & x(int ind)
Extracts X for current frame.
Definition: selection.h:878
void remove(const Selection &sel)
Remove all atoms of sel from current selection.
Definition: selection.cpp:253
Selection select(std::string str)
Sub-selections allow selecting atoms inside existing selection (narrowing or refining existing select...
Definition: selection.cpp:313
Eigen::Vector3f & vel(int ind)
Extracts velocity for current frame.
Definition: selection.h:911