From 10e2afc64ab565e19b5f71eb0547c6b288e22ea7 Mon Sep 17 00:00:00 2001 From: Carlo Camilloni Date: Wed, 29 Nov 2023 16:19:57 +0100 Subject: [PATCH] closes #963 the solution is not optimal, but I think making something general is not trivial --- regtest/secondarystructure/rt32/plumed.dat | 4 ++-- src/secondarystructure/AntibetaRMSD.cpp | 6 +++--- src/secondarystructure/ParabetaRMSD.cpp | 8 ++++---- src/secondarystructure/SecondaryStructureRMSD.cpp | 3 ++- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/regtest/secondarystructure/rt32/plumed.dat b/regtest/secondarystructure/rt32/plumed.dat index 180a6c5e80..aaf56d6e0b 100644 --- a/regtest/secondarystructure/rt32/plumed.dat +++ b/regtest/secondarystructure/rt32/plumed.dat @@ -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 diff --git a/src/secondarystructure/AntibetaRMSD.cpp b/src/secondarystructure/AntibetaRMSD.cpp index c06abc7e3c..bab794e256 100644 --- a/src/secondarystructure/AntibetaRMSD.cpp +++ b/src/secondarystructure/AntibetaRMSD.cpp @@ -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"); diff --git a/src/secondarystructure/ParabetaRMSD.cpp b/src/secondarystructure/ParabetaRMSD.cpp index 9e2e06ea52..1ef9fc9101 100644 --- a/src/secondarystructure/ParabetaRMSD.cpp +++ b/src/secondarystructure/ParabetaRMSD.cpp @@ -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"); @@ -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 nlist(30); for(unsigned ichain=1; ichain 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() );