Skip to content

Commit

Permalink
closes #963
Browse files Browse the repository at this point in the history
the solution is not optimal, but I think making something general is not
trivial
  • Loading branch information
carlocamilloni committed Nov 29, 2023
1 parent a22fb5e commit 10e2afc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions regtest/secondarystructure/rt32/plumed.dat
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
MOLINFO STRUCTURE=helix.pdb
ALPHARMSD RESIDUES=all TYPE=DRMSD LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12 NOSTRETCH} LABEL=a
ALPHARMSD RESIDUES=ALL TYPE=DRMSD LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12 NOSTRETCH} LABEL=a
ANTIBETARMSD RESIDUES=all TYPE=DRMSD STRANDS_CUTOFF=1.0 LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12 NOSTRETCH} LABEL=b
PARABETARMSD RESIDUES=all TYPE=DRMSD STRANDS_CUTOFF=1.0 LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12 NOSTRETCH} LABEL=p
PRINT ARG=a.*,b.*,p.* STRIDE=1 FILE=colvar FMT=%8.4f
ALPHARMSD RESIDUES=2-7 TYPE=DRMSD R_0=0.08 NN=8 MM=12 LABEL=a2
ALPHARMSD RESIDUES=2-7 TYPE=DRMSD R_0=0.08 NN=8 MM=12 NUMERICAL_DERIVATIVES LABEL=a2num
DUMPDERIVATIVES ARG=a2.*,a2num.* FILE=derivatives1 FMT=%8.4f STRIDE=1
ANTIBETARMSD RESIDUES=3-5,8-10 STYLE=inter TYPE=OPTIMAL LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12 NOSTRETCH} LABEL=b2
ANTIBETARMSD RESIDUES=3-5,8-10 STYLE=INTER TYPE=OPTIMAL LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12 NOSTRETCH} LABEL=b2
ANTIBETARMSD RESIDUES=3-5,8-10 STYLE=inter TYPE=OPTIMAL LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12 NOSTRETCH} NUMERICAL_DERIVATIVES LABEL=b2num
DUMPDERIVATIVES ARG=b2.*,b2num.* FILE=derivatives2 FMT=%8.3f STRIDE=1
RESTRAINT ARG=b.lessthan,p.lessthan,a.lessthan,a2,b2.lessthan AT=0,1,2,3,4 KAPPA=1,2,3,4,5 SLOPE=5,4,3,2,1
Expand Down
6 changes: 3 additions & 3 deletions src/secondarystructure/AntibetaRMSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ AntibetaRMSD::AntibetaRMSD(const ActionOptions&ao):

bool intra_chain(false), inter_chain(false);
std::string style; parse("STYLE",style);
if( style=="all" ) {
if( Tools::caseInSensStringCompare(style, "all") ) {
intra_chain=true; inter_chain=true;
} else if( style=="inter") {
} else if( Tools::caseInSensStringCompare(style, "inter") ) {
intra_chain=false; inter_chain=true;
} else if( style=="intra") {
} else if( Tools::caseInSensStringCompare(style, "intra") ) {
intra_chain=true; inter_chain=false;
} else {
error( style + " is not a valid directive for the STYLE keyword");
Expand Down
8 changes: 4 additions & 4 deletions src/secondarystructure/ParabetaRMSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ ParabetaRMSD::ParabetaRMSD(const ActionOptions&ao):

bool intra_chain(false), inter_chain(false);
std::string style; parse("STYLE",style);
if( style=="all" ) {
if( Tools::caseInSensStringCompare(style, "all") ) {
intra_chain=true; inter_chain=true;
} else if( style=="inter") {
} else if( Tools::caseInSensStringCompare(style, "inter") ) {
intra_chain=false; inter_chain=true;
} else if( style=="intra") {
} else if( Tools::caseInSensStringCompare(style, "intra") ) {
intra_chain=true; inter_chain=false;
} else {
error( style + " is not a valid directive for the STYLE keyword");
Expand Down Expand Up @@ -148,7 +148,7 @@ ParabetaRMSD::ParabetaRMSD(const ActionOptions&ao):
}
// This constructs all conceivable sections of antibeta sheet that form between chains
if( inter_chain ) {
if( chains.size()==1 && style!="all" ) error("there is only one chain defined so cannot use inter_chain option");
if( chains.size()==1 && !Tools::caseInSensStringCompare(style, "all") ) error("there is only one chain defined so cannot use inter_chain option");
std::vector<unsigned> nlist(30);
for(unsigned ichain=1; ichain<chains.size(); ++ichain) {
unsigned iprev=0; for(unsigned i=0; i<ichain; ++i) iprev+=chains[i];
Expand Down
3 changes: 2 additions & 1 deletion src/secondarystructure/SecondaryStructureRMSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ void SecondaryStructureRMSD::readBackboneAtoms( const std::string& moltype, std:
std::vector<std::string> resstrings; parseVector( "RESIDUES", resstrings );
if( !verbose_output ) {
if(resstrings.size()==0) error("residues are not defined, check the keyword RESIDUES");
else if(resstrings[0]=="all") {
else if( Tools::caseInSensStringCompare(resstrings[0], "all") ) {
resstrings[0]="all";
log.printf(" examining all possible secondary structure combinations\n");
} else {
log.printf(" examining secondary structure in residue positions : %s \n",resstrings[0].c_str() );
Expand Down

1 comment on commit 10e2afc

@PlumedBot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found broken examples in automatic/a-masterclass-22-09.txt
Found broken examples in automatic/a-masterclass-22-11.txt
Found broken examples in automatic/a-masterclass-22-12.txt
Found broken examples in automatic/performance-optimization.txt
Found broken examples in automatic/a-trieste-6.txt
Found broken examples in automatic/munster.txt
Found broken examples in automatic/ANN.tmp
Found broken examples in automatic/EDS.tmp
Found broken examples in automatic/EMMI.tmp
Found broken examples in automatic/ENVIRONMENTSIMILARITY.tmp
Found broken examples in automatic/FOURIER_TRANSFORM.tmp
Found broken examples in automatic/FUNCPATHGENERAL.tmp
Found broken examples in automatic/FUNCPATHMSD.tmp
Found broken examples in automatic/FUNNEL.tmp
Found broken examples in automatic/FUNNEL_PS.tmp
Found broken examples in automatic/GHBFIX.tmp
Found broken examples in automatic/INCLUDE.tmp
Found broken examples in automatic/MAZE_MEMETIC_SAMPLING.tmp
Found broken examples in automatic/MAZE_OPTIMIZER_BIAS.tmp
Found broken examples in automatic/MAZE_RANDOM_ACCELERATION_MD.tmp
Found broken examples in automatic/MAZE_RANDOM_WALK.tmp
Found broken examples in automatic/MAZE_SIMULATED_ANNEALING.tmp
Found broken examples in automatic/MAZE_STEERED_MD.tmp
Found broken examples in automatic/PIV.tmp
Found broken examples in automatic/PLUMED.tmp
Found broken examples in MiscelaneousPP.md

Please sign in to comment.