Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a71f3dd
Add charmm HIS residue names
drroe Apr 15, 2020
208ed3a
Add 'nointrares' keyword to 'bonds' command.
drroe Apr 15, 2020
d3b17a5
Start adding a remove bond function
drroe Apr 15, 2020
40c2c37
Ensure erased bond indices are removed from atoms as well.
drroe Apr 15, 2020
a7ff245
Add new formatted name routine
drroe Apr 16, 2020
c5dc53a
Add a removebonds command
drroe Apr 16, 2020
24161e2
Use a copy of the bonds array since it will be modified. Have RemoveB…
drroe Apr 16, 2020
0ec93fa
Ensure molecule info is redetermined.
drroe Apr 16, 2020
7d6728e
Fix print of command line to the log
drroe Apr 16, 2020
fab96fe
Add outfile to removebonds
drroe Apr 16, 2020
bab75a3
Add a command that can be used to create leap input for a given set o…
drroe Apr 16, 2020
cf645c5
Change name of cys residues involved in disulfide bonds
drroe Apr 16, 2020
1e156aa
Get rid of 'if' statement inside loop reading residue numbers
drroe Apr 17, 2020
b063339
The last atom of residues is already being set after the atom is added.
drroe Apr 17, 2020
2f87aa9
Have atom/residue/molecule info print out the number or atoms/residue…
drroe Apr 17, 2020
f4cc8c6
Add back the concept of "offset" when searching for dihedrals. In wei…
drroe Apr 18, 2020
7de0781
Add option to print reference values to a file
drroe Apr 18, 2020
afdc39f
Add founddihout option; makes for easier debugging
drroe Apr 18, 2020
a34d469
More info
drroe Apr 19, 2020
5dad3ce
Add crdset keyword to GetTopByIndex
drroe Apr 19, 2020
e525e4c
Add the PSI-O dihedral
drroe Apr 19, 2020
0ee15b0
DRR - If an action was skipped, do not make it an error.
drroe Apr 20, 2020
d262474
Allow multiple args for removedata
drroe Apr 20, 2020
26e0303
Go back to making a single skipped action an error for crdaction
drroe Apr 20, 2020
34da275
Merge branch 'master' into debug
drroe Apr 22, 2020
22a2675
Improve DSSP help. Add "SG" atom name so that disulfides are not foll…
drroe Apr 22, 2020
560470c
Add namesg keyword.
drroe Apr 22, 2020
2578039
DRR - Skip residues for which no atoms are selected.
drroe Apr 22, 2020
4827141
DRR - Nonsense assignment no longer made.
drroe Apr 22, 2020
ba2a8bd
DRR - Do not follow bonds to unselected atoms
drroe Apr 22, 2020
9dad85a
Hide command for now
drroe Apr 22, 2020
16fd050
Remove the "psi-o" dihedral
drroe Apr 22, 2020
d488247
Update makestructure
drroe Apr 22, 2020
f5d2705
Add namesg keyword to manual
drroe Apr 22, 2020
48e3916
Note that residues with no selected atoms in dssp are now skipped.
drroe Apr 22, 2020
2fa035b
Add change removebonds to manual
drroe Apr 22, 2020
1db5aee
Add bonds nointrares to manual
drroe Apr 22, 2020
afff29f
Add change removebonds out keyword to manual
drroe Apr 22, 2020
e6abebc
Version change for makestructure additional keywords, change removebo…
drroe Apr 22, 2020
c918572
Fix up change removebonds help
drroe Apr 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 75 additions & 4 deletions doc/cpptraj.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -11368,7 +11368,11 @@ bondinfo | bonds | printbonds
\end_layout

\begin_layout LyX-Code
bondinfo [parm <name> | parmindex <#> | <#>] [<mask1>] [<mask2>] [out <file>]
bondinfo [parm <name> | parmindex <#> | <#>]
\end_layout

\begin_layout LyX-Code
[<mask1>] [<mask2>] [out <file>] [nointrares]
\end_layout

\begin_deeper
Expand Down Expand Up @@ -11417,6 +11421,10 @@ parmindex
<file>] File to print to (default STDOUT).
\end_layout

\begin_layout Description
[nointrares] Do not print intra-residue bonds.
\end_layout

\end_deeper
\begin_layout Standard
Print bond information for atoms in <mask> for selected topology (first
Expand Down Expand Up @@ -11486,7 +11494,11 @@ change [parm <name> | parmindex <#> | <#> |
\end_layout

\begin_layout LyX-Code
addbond <mask1> <mask2> [req <length> <rk> <force constant>] }
addbond <mask1> <mask2> [req <length> <rk> <force constant>]
\end_layout

\begin_layout LyX-Code
removebonds <mask1> [<mask2>] [out <file>] }
\end_layout

\begin_deeper
Expand Down Expand Up @@ -11628,6 +11640,31 @@ addbond
constant>] The bond force constant in kcal/mol*Angstrom.
\end_layout

\end_deeper
\begin_layout Description
removebonds
\begin_inset space ~
\end_inset

<mask1>
\begin_inset space ~
\end_inset

[<mask2>] Remove bonds from atoms in <mask1>.
If <mask2> also given, remove bonds between atoms in <mask1> and atoms
in <mask2>.
\end_layout

\begin_deeper
\begin_layout Description
[out
\begin_inset space ~
\end_inset

<file>] If specified, write removed bonds to <file> with format '<residue
name> <residue num> <atom name> <atom num>'.
\end_layout

\end_deeper
\end_deeper
\begin_layout Standard
Expand Down Expand Up @@ -26990,7 +27027,7 @@ ref:<range>:<refname>[:<ref
\begin_inset space ~
\end_inset

range>[:<dih types>]]
range>[:<dih types>]] [refvalsout <file>] [founddihout <file>]
\end_layout

\begin_layout Standard
Expand All @@ -27003,6 +27040,8 @@ Apply dihedrals from residues <ref_range> in previously loaded reference
\series default
above) can be specified in a comma-separated list; default is phi/psi.
Note that in order to specify <dih types>, <ref range> must be specified.
The 'refvalsout' and 'founddihout' keywords can be used to print dihedrals
found in the reference and target structures respectively to files.
\end_layout

\begin_layout Subsubsection*
Expand Down Expand Up @@ -31834,7 +31873,7 @@ secstruct
\end_layout

\begin_layout LyX-Code
[namec <C name>] [nameo <O name>]
[namec <C name>] [nameo <O name>] [namesg <sulfur name>]
\begin_inset Separator latexpar
\end_inset

Expand Down Expand Up @@ -31947,6 +31986,19 @@ name>] Backbone carbonyl carbon atom name (default 'C').
name>] Backbone carbonyl oxygen atom name (default 'O').
\end_layout

\begin_layout Description
[namesg
\begin_inset space ~
\end_inset

<SG
\begin_inset space ~
\end_inset

name>] Cysteine sulfur atom name, used to ignore disulfide connectivity
(default 'SG').
\end_layout

\begin_layout Standard
Data Sets Created:
\end_layout
Expand Down Expand Up @@ -32105,6 +32157,25 @@ nameX
cpptraj
\shape default
will print an informational message but the calculation will proceed normally.
If a residue has no atoms selected it will be skipped.
When determining residue connecivity, disulfide bonds will be ignored;

\emph on
cpptraj
\emph default
identifies such bonds based on the
\series bold
namesg
\series default
atom name (default
\begin_inset Quotes eld
\end_inset

SG
\begin_inset Quotes erd
\end_inset

).
\end_layout

\begin_layout Standard
Expand Down
129 changes: 85 additions & 44 deletions src/Action_DSSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ Action_DSSP::Action_DSSP() :
BB_C_("C"),
BB_O_("O"),
BB_CA_("CA"),
SG_("SG"),
outfile_(0),
dsspFile_(0),
assignout_(0),
Expand All @@ -287,9 +288,21 @@ void Action_DSSP::Help() const {
"\t[assignout <filename>] [totalout <filename>] [ptrajformat]\n"
"\t[betadetail]\n"
"\t[namen <N name>] [nameh <H name>] [nameca <CA name>]\n"
"\t[namec <C name>] [nameo <O name>]\n"
" Calculate secondary structure content for residues in <mask>.\n"
" If sumout not specified, the filename specified by out is used with .sum suffix.\n");
"\t[namec <C name>] [nameo <O name>] [namesg <sulfur name>]\n"
" Calculate secondary structure (SS) content for residues in <mask>.\n"
" The 'out' file will contain SS vs frame.\n"
" The 'sumout' file will contain total SS content for each residue, by SS type.\n"
" If sumout not specified, the filename specified by out is used with .sum suffix.\n"
" The 'assignout' file will contain the SS assignment foe each residue based\n"
" on the majority SS type.\n"
" The 'totalout' file will contain overall SS content vs frame, by SS type.\n"
" The 'ptrajformat' keyword will use characters instead of #s in the 'out' file.\n"
" The 'betadetail' keyword will print parallel/anti-parallel beta instead of\n"
" extended/bridge.\n"
" The backbone N, H, CA, C, and O atom names can be specifed with 'nameX' keywords.\n"
" The disulfide sulfur atom name can be specified with the 'nameSG' keyword.\n"
);

}

// Action_DSSP::Init()
Expand Down Expand Up @@ -317,6 +330,8 @@ Action::RetType Action_DSSP::Init(ArgList& actionArgs, ActionInit& init, int deb
if (!temp.empty()) BB_O_ = temp;
temp = actionArgs.GetStringKey("nameca");
if (!temp.empty()) BB_CA_ = temp;
temp = actionArgs.GetStringKey("namesg");
if (!temp.empty()) SG_ = temp;
// Get masks
if (Mask_.SetMaskString( actionArgs.GetMaskNext() )) return Action::ERR;

Expand Down Expand Up @@ -383,6 +398,7 @@ Action::RetType Action_DSSP::Init(ArgList& actionArgs, ActionInit& init, int deb
mprintf("\tOverall assigned SS will be written to %s\n", assignout_->Filename().full());
mprintf("\tBackbone Atom Names: N=[%s] H=[%s] C=[%s] O=[%s] CA=[%s]\n",
*BB_N_, *BB_H_, *BB_C_, *BB_O_, *BB_CA_ );
mprintf("\tDisulfide sulfur atom name: %s\n", *SG_);
mprintf("# Citation: Kabsch, W.; Sander, C.; \"Dictionary of Protein Secondary Structure:\n"
"# Pattern Recognition of Hydrogen-Bonded and Geometrical Features.\"\n"
"# Biopolymers (1983), V.22, pp.2577-2637.\n" );
Expand Down Expand Up @@ -450,23 +466,34 @@ Action::RetType Action_DSSP::Setup(ActionSetup& setup)
int nextresnum = -1;
for (int at = thisRes.FirstAtom(); at != thisRes.LastAtom(); at++) {
if ( setup.Top()[at].Element() != Atom::HYDROGEN ) {
bool isSGatom = (setup.Top()[at].Name() == SG_);
for (Atom::bond_iterator ib = setup.Top()[at].bondbegin();
ib != setup.Top()[at].bondend(); ++ib)
{
if ( setup.Top()[*ib].ResNum() < *ridx ) {
if (prevresnum != -1)
mprintf("Warning: Multiple previous residues for res %i\n", *ridx+1);
else
prevresnum = setup.Top()[*ib].ResNum();
} else if ( setup.Top()[*ib].ResNum() > *ridx ) {
if (nextresnum != -1)
mprintf("Warning: Multiple next residues for res %i\n", *ridx+1);
else
nextresnum = setup.Top()[*ib].ResNum();
}
}
}
}
// Skip the bonded atom if it is not in the mask
if (Mask_.AtomInCharMask(*ib)) {
// Do not follow disulfide bonds.
if (isSGatom && setup.Top()[*ib].Name() == SG_) {
mprintf("\tSkipping disulfide bond between %s and %s\n",
setup.Top().TruncResNameNum(setup.Top()[at].ResNum()).c_str(),
setup.Top().TruncResNameNum(setup.Top()[*ib].ResNum()).c_str());
continue;
}
if ( setup.Top()[*ib].ResNum() < *ridx ) {
if (prevresnum != -1)
mprintf("Warning: Multiple previous residues for res %i\n", *ridx+1);
else
prevresnum = setup.Top()[*ib].ResNum();
} else if ( setup.Top()[*ib].ResNum() > *ridx ) {
if (nextresnum != -1)
mprintf("Warning: Multiple next residues for res %i\n", *ridx+1);
else
nextresnum = setup.Top()[*ib].ResNum();
}
} // END if atom in mask
} // END loop over bonded atoms
} // END atom is not hydrogen
} // END loop over residue atoms
# ifdef DSSPDEBUG
mprintf("\t %8i < %8i < %8i\n", prevresnum+1, *ridx+1, nextresnum+1);
# endif
Expand All @@ -476,40 +503,54 @@ Action::RetType Action_DSSP::Setup(ActionSetup& setup)
}
// Determine if this residue is selected
if (Mask_.AtomsInCharMask(thisRes.FirstAtom(), thisRes.LastAtom())) {
Res->SetSelected( true );
++nResSelected;
// Determine atom indices
bool hasAtoms = false;
for (int at = thisRes.FirstAtom(); at != thisRes.LastAtom(); at++)
{
if ( setup.Top()[at].Name() == BB_C_ ) Res->SetC( at*3 );
else if ( setup.Top()[at].Name() == BB_O_ ) Res->SetO( at*3 );
else if ( setup.Top()[at].Name() == BB_N_ ) Res->SetN( at*3 );
else if ( setup.Top()[at].Name() == BB_H_ ) Res->SetH( at*3 );
else if ( setup.Top()[at].Name() == BB_CA_ ) Res->SetCA( at*3 );
if ( setup.Top()[at].Name() == BB_C_ ) { Res->SetC( at*3 ); hasAtoms = true; }
else if ( setup.Top()[at].Name() == BB_O_ ) { Res->SetO( at*3 ); hasAtoms = true; }
else if ( setup.Top()[at].Name() == BB_N_ ) { Res->SetN( at*3 ); hasAtoms = true; }
else if ( setup.Top()[at].Name() == BB_H_ ) { Res->SetH( at*3 ); hasAtoms = true; }
else if ( setup.Top()[at].Name() == BB_CA_ ) { Res->SetCA( at*3 ); hasAtoms = true; }
}
// Check if residue is missing atoms
if (Res->IsMissingAtoms()) {
mprintf("Warning: Res %s is missing atoms", setup.Top().TruncResNameNum( *ridx ).c_str());
if (Res->C() == -1) mprintf(" %s", *BB_C_);
if (Res->O() == -1) mprintf(" %s", *BB_N_);
if (Res->N() == -1) mprintf(" %s", *BB_O_);
if (Res->H() == -1) mprintf(" %s", *BB_H_);
if (Res->CA() == -1) mprintf(" %s", *BB_CA_);
mprintf("\n");
}
// Set up DataSet if necessary
if (Res->Dset() == 0) {
md.SetIdx( *ridx+1 );
md.SetLegend( setup.Top().TruncResNameNum( *ridx ) );
// Setup DataSet for this residue
Res->SetDset( Init_.DSL().AddSet( dt, md ) );
if (!hasAtoms) {
mprintf("Warning: No atoms selected for res %s; skipping.\n",
setup.Top().TruncResNameNum( *ridx ).c_str());
} else {
Res->SetSelected( true );
++nResSelected;
for (int at = thisRes.FirstAtom(); at != thisRes.LastAtom(); at++)
{
if ( setup.Top()[at].Name() == BB_C_ ) Res->SetC( at*3 );
else if ( setup.Top()[at].Name() == BB_O_ ) Res->SetO( at*3 );
else if ( setup.Top()[at].Name() == BB_N_ ) Res->SetN( at*3 );
else if ( setup.Top()[at].Name() == BB_H_ ) Res->SetH( at*3 );
else if ( setup.Top()[at].Name() == BB_CA_ ) Res->SetCA( at*3 );
}
// Check if residue is missing atoms
if (Res->IsMissingAtoms()) {
mprintf("Warning: Res %s is missing atoms", setup.Top().TruncResNameNum( *ridx ).c_str());
if (Res->C() == -1) mprintf(" %s", *BB_C_);
if (Res->O() == -1) mprintf(" %s", *BB_N_);
if (Res->N() == -1) mprintf(" %s", *BB_O_);
if (Res->H() == -1) mprintf(" %s", *BB_H_);
if (Res->CA() == -1) mprintf(" %s", *BB_CA_);
mprintf("\n");
}
// Set up DataSet if necessary
if (Res->Dset() == 0) {
mprinterr("Error: Could not allocate DSSP data set for residue %i\n", *ridx+1);
return Action::ERR;
md.SetIdx( *ridx+1 );
md.SetLegend( setup.Top().TruncResNameNum( *ridx ) );
// Setup DataSet for this residue
Res->SetDset( Init_.DSL().AddSet( dt, md ) );
if (Res->Dset() == 0) {
mprinterr("Error: Could not allocate DSSP data set for residue %i\n", *ridx+1);
return Action::ERR;
}
if (outfile_ != 0) outfile_->AddDataSet( Res->Dset() );
}
if (outfile_ != 0) outfile_->AddDataSet( Res->Dset() );
}
} // END residue is selected
} // END residue is selected by Mask
}
mprintf("\t%u of %i solute residues selected.\n", nResSelected, soluteRes.Size());

Expand Down
1 change: 1 addition & 0 deletions src/Action_DSSP.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class Action_DSSP : public Action {
NameType BB_C_; ///< Protein C atom name ('C')
NameType BB_O_; ///< Protein C-O atom name ('O')
NameType BB_CA_; ///< Protein alpha C name ('CA')
NameType SG_; ///< Protein cysteine sulfur name for detecting disulfides
CharMask Mask_; ///< Mask used to determine selected residues.
DataFile* outfile_; ///< Output Data file
DataFile* dsspFile_; ///< Sum output file
Expand Down
Loading