23 #include "core/ActionRegister.h"
24 #include "core/PlumedMain.h"
25 #include "core/Atoms.h"
28 namespace secondarystructure {
92 keys.add(
"compulsory",
"STYLE",
"all",
"Antiparallel beta sheets can either form in a single chain or from a pair of chains. If STYLE=all all "
93 "chain configuration with the appropriate geometry are counted. If STYLE=inter "
94 "only sheet-like configurations involving two chains are counted, while if STYLE=intra "
95 "only sheet-like configurations involving a single chain are counted");
96 keys.use(
"STRANDS_CUTOFF");
104 std::vector<std::string> backnames(5); std::vector<unsigned> chains;
105 backnames[0]=
"N"; backnames[1]=
"CA"; backnames[2]=
"CB"; backnames[3]=
"C"; backnames[4]=
"O";
108 bool intra_chain(
false), inter_chain(
false);
109 std::string style;
parse(
"STYLE",style);
111 intra_chain=
true; inter_chain=
true;
112 }
else if( style==
"inter"){
113 intra_chain=
false; inter_chain=
true;
114 }
else if( style==
"intra"){
115 intra_chain=
true; inter_chain=
false;
117 error( style +
" is not a valid directive for the STYLE keyword");
125 unsigned nres, nprevious=0; std::vector<unsigned> nlist(30);
126 for(
unsigned i=0;i<chains.size();++i){
127 if( chains[i]<40 )
error(
"segment of backbone is not long enough to form an antiparallel beta hairpin. Each backbone fragment must contain a minimum of 8 residues");
130 if( chains[i]%5!=0 )
error(
"backbone segment received does not contain a multiple of five residues");
131 for(
unsigned ires=0;ires<nres-7;ires++){
132 for(
unsigned jres=ires+7;jres<nres;jres++){
133 for(
unsigned k=0;k<15;++k){
134 nlist[k]=nprevious + ires*5+k;
135 nlist[k+15]=nprevious + (jres-2)*5+k;
140 nprevious+=chains[i];
144 if( chains.size()==1 && style!=
"all" )
error(
"there is only one chain defined so cannot use inter_chain option");
145 unsigned iprev,jprev,inres,jnres; std::vector<unsigned> nlist(30);
146 for(
unsigned ichain=1;ichain<chains.size();++ichain){
147 iprev=0;
for(
unsigned i=0;i<ichain;++i) iprev+=chains[i];
148 inres=chains[ichain]/5;
149 if( chains[ichain]%5!=0 )
error(
"backbone segment received does not contain a multiple of five residues");
150 for(
unsigned ires=0;ires<inres-2;++ires){
151 for(
unsigned jchain=0;jchain<ichain;++jchain){
152 jprev=0;
for(
unsigned i=0;i<jchain;++i) jprev+=chains[i];
153 jnres=chains[jchain]/5;
154 if( chains[jchain]%5!=0 )
error(
"backbone segment received does not contain a multiple of five residues");
155 for(
unsigned jres=0;jres<jnres-2;++jres){
156 for(
unsigned k=0;k<15;++k){
157 nlist[k]=iprev+ ires*5+k;
158 nlist[k+15]=jprev+ jres*5+k;
168 std::vector<Vector> reference(30);
169 reference[0]=
Vector( 2.263, -3.795, 1.722);
170 reference[1]=
Vector( 2.493, -2.426, 2.263);
171 reference[2]=
Vector( 3.847, -1.838, 1.761);
172 reference[3]=
Vector( 1.301, -1.517, 1.921);
173 reference[4]=
Vector( 0.852, -1.504, 0.739);
174 reference[5]=
Vector( 0.818, -0.738, 2.917);
175 reference[6]=
Vector(-0.299, 0.243, 2.748);
176 reference[7]=
Vector(-1.421, -0.076, 3.757);
177 reference[8]=
Vector( 0.273, 1.680, 2.854);
178 reference[9]=
Vector( 0.902, 1.993, 3.888);
179 reference[10]=
Vector( 0.119, 2.532, 1.813);
180 reference[11]=
Vector( 0.683, 3.916, 1.680);
181 reference[12]=
Vector( 1.580, 3.940, 0.395);
182 reference[13]=
Vector(-0.394, 5.011, 1.630);
183 reference[14]=
Vector(-1.459, 4.814, 0.982);
184 reference[15]=
Vector(-2.962, 3.559, -1.359);
185 reference[16]=
Vector(-2.439, 2.526, -2.287);
186 reference[17]=
Vector(-1.189, 3.006, -3.087);
187 reference[18]=
Vector(-2.081, 1.231, -1.520);
188 reference[19]=
Vector(-1.524, 1.324, -0.409);
189 reference[20]=
Vector(-2.326, 0.037, -2.095);
190 reference[21]=
Vector(-1.858, -1.269, -1.554);
191 reference[22]=
Vector(-3.053, -2.199, -1.291);
192 reference[23]=
Vector(-0.869, -1.949, -2.512);
193 reference[24]=
Vector(-1.255, -2.070, -3.710);
194 reference[25]=
Vector( 0.326, -2.363, -2.072);
195 reference[26]=
Vector( 1.405, -2.992, -2.872);
196 reference[27]=
Vector( 2.699, -2.129, -2.917);
197 reference[28]=
Vector( 1.745, -4.399, -2.330);
198 reference[29]=
Vector( 1.899, -4.545, -1.102);
void setSecondaryStructure(std::vector< Vector > &structure, double bondlength, double units)
Set a reference configuration.
void error(const std::string &msg) const
Crash calculation and print documentation.
static void registerKeywords(Keywords &keys)
void readBackboneAtoms(const std::vector< std::string > &backnames, std::vector< unsigned > &chain_lengths)
Get the atoms in the backbone.
void addColvar(const std::vector< unsigned > &newatoms)
Add a set of atoms to calculat ethe rmsd from.
void parse(const std::string &key, T &t)
Parse one keyword as generic type.
This class holds the keywords and their documentation.
This class is used to bring the relevant information to the Action constructor.
Base class for all the input Actions.
static void registerKeywords(Keywords &keys)
Provides the keyword ANTIBETARMSD
const double & getLength() const
Get length units as double.
void setAtomsFromStrands(const unsigned &atom1, const unsigned &atom2)
Setup a pair of atoms to use for strands cutoff.
Vector3d Vector
Alias for three dimensional vectors.
AntibetaRMSD(const ActionOptions &)
Base action for calculating things like AlphRMSD, AntibetaRMSD, etc.