Skip to content

Commit 2a4a62c

Browse files
authored
Add option to prevent spaces between frames in 'nastruct' output. (#804)
* DRR - Add 'noframespaces' option * DRR - Add 'noframespaces' to nastruct entry * DRR - Revision bump; 'noframespaces' option for nastruct
1 parent aa67457 commit 2a4a62c

4 files changed

Lines changed: 22 additions & 7 deletions

File tree

doc/cpptraj.lyx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28082,7 +28082,7 @@ nastruct
2808228082
\end_layout
2808328083

2808428084
\begin_layout LyX-Code
28085-
[baseref <file>] ...
28085+
[noframespaces] [baseref <file>] ...
2808628086
\end_layout
2808728087

2808828088
\begin_layout LyX-Code
@@ -28156,6 +28156,15 @@ naout
2815628156
bonds present between them.
2815728157
\end_layout
2815828158

28159+
\begin_layout Description
28160+
[noframespaces] If specified there will be no spaces between frames in the
28161+
28162+
\series bold
28163+
naout
28164+
\series default
28165+
files.
28166+
\end_layout
28167+
2815928168
\begin_layout Description
2816028169
[baseref
2816128170
\begin_inset space ~

src/Action_NAstruct.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Action_NAstruct::Action_NAstruct() :
2828
printheader_(true),
2929
seriesUpdated_(false),
3030
skipIfNoHB_(true),
31+
spaceBetweenFrames_(true),
3132
bpout_(0), stepout_(0), helixout_(0),
3233
masterDSL_(0)
3334
# ifdef NASTRUCTDEBUG
@@ -38,7 +39,7 @@ Action_NAstruct::Action_NAstruct() :
3839
void Action_NAstruct::Help() const {
3940
mprintf("\t[<dataset name>] [resrange <range>] [naout <suffix>]\n"
4041
"\t[noheader] [resmap <ResName>:{A,C,G,T,U} ...] [calcnohb]\n"
41-
"\t[baseref <file>] ...\n"
42+
"\t[noframespaces] [baseref <file>] ...\n"
4243
"\t[hbcut <hbcut>] [origincut <origincut>] [altona | cremer]\n"
4344
"\t[zcut <zcut>] [zanglecut <zanglecut>] [groovecalc {simple | 3dna}]\n"
4445
"\t[{ %s | allframes | guessbp}]\n", DataSetList::RefArgs);
@@ -58,7 +59,9 @@ void Action_NAstruct::Help() const {
5859
" hydrogen bonds present between base pairs.\n"
5960
" Base pair parameters are written to 'BP.<suffix>', base pair step parameters\n"
6061
" are written to 'BPstep.<suffix>', and helix parameters are written to\n"
61-
" Helix.<suffix>'\n");
62+
" Helix.<suffix>'.\n"
63+
" If 'noframespaces' is specified there will be no spaces between frames\n"
64+
" in the 'naout' files.\n");
6265
}
6366

6467
// Action_NAstruct::Init()
@@ -110,6 +113,7 @@ Action::RetType Action_NAstruct::Init(ArgList& actionArgs, ActionInit& init, int
110113
resRange_.ShiftBy(-1); // User res args start from 1
111114
printheader_ = !actionArgs.hasKey("noheader");
112115
skipIfNoHB_ = !actionArgs.hasKey("calcnohb");
116+
spaceBetweenFrames_ = !actionArgs.hasKey("noframespaces");
113117
// Determine how base pairs will be found.
114118
ReferenceFrame REF = init.DSL().GetReferenceFrame( actionArgs );
115119
if (REF.error()) return Action::ERR;
@@ -197,6 +201,7 @@ Action::RetType Action_NAstruct::Init(ArgList& actionArgs, ActionInit& init, int
197201
mprintf("\tBase pair step parameters written to %s\n", stepout_->Filename().full());
198202
mprintf("\tHelical parameters written to %s\n", helixout_->Filename().full());
199203
if (!printheader_) mprintf("\tHeader line will not be written.\n");
204+
if (!spaceBetweenFrames_) mprintf("\tNo spaces will be written between frames.\n");
200205
}
201206
mprintf("\tHydrogen bond cutoff for determining base pairs is %.2f Angstroms.\n",
202207
sqrt( HBdistCut2_ ) );
@@ -1776,7 +1781,7 @@ void Action_NAstruct::Print() {
17761781
bpout_->Printf(GROOVE_FMT, BP.major_->Dval(frame), BP.minor_->Dval(frame));
17771782
bpout_->Printf("\n");
17781783
}
1779-
bpout_->Printf("\n");
1784+
if (spaceBetweenFrames_) bpout_->Printf("\n");
17801785
}
17811786
}
17821787

@@ -1821,7 +1826,7 @@ void Action_NAstruct::Print() {
18211826
}
18221827
stepout_->Printf("\n");
18231828
}
1824-
stepout_->Printf("\n");
1829+
if (spaceBetweenFrames_) stepout_->Printf("\n");
18251830
}
18261831
// Helix frames
18271832
if (printheader_)
@@ -1840,7 +1845,7 @@ void Action_NAstruct::Print() {
18401845
BS.tip_->Dval(frame), BS.htwist_->Dval(frame));
18411846
helixout_->Printf("\n");
18421847
}
1843-
helixout_->Printf("\n");
1848+
if (spaceBetweenFrames_) helixout_->Printf("\n");
18441849
}
18451850
}
18461851
}

src/Action_NAstruct.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ class Action_NAstruct: public Action {
153153
bool printheader_; ///< If true, print header to naout files.
154154
bool seriesUpdated_; ///< If false, check that time series data is nframes long
155155
bool skipIfNoHB_; ///< When true, do not calc parameters when BP not present
156+
bool spaceBetweenFrames_; ///< If false do not print spaces between frames in naout
156157
CpptrajFile* bpout_; ///< Base pair out (BP.<suffix>).
157158
CpptrajFile* stepout_; ///< Base pair step out (BPstep.<suffix>).
158159
CpptrajFile* helixout_; ///< Helical parameters out (Helix.<suffix>).

src/Version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Whenever a number that precedes <revision> is incremented, all subsequent
1313
* numbers should be reset to 0.
1414
*/
15-
#define CPPTRAJ_INTERNAL_VERSION "V4.25.7"
15+
#define CPPTRAJ_INTERNAL_VERSION "V4.25.8"
1616
/// PYTRAJ relies on this
1717
#define CPPTRAJ_VERSION_STRING CPPTRAJ_INTERNAL_VERSION
1818
#endif

0 commit comments

Comments
 (0)