Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: respect resid and resiude as distinct entities #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions doc/pbctools.tex
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ \section{Basic usage}

\texttt{unwrap} [\textit{options}\dots]
& When overlong bonds (that stretch the whole system) occur and
compounds (residues, segments, chains or fragments) are broken in
compounds (resids, residues, segments, chains or fragments) are broken in
the course of a simulation trajectory because atoms are wrapped
around the periodic boundaries, this function will remove large
jumps of atoms between consecutive frames.
Expand Down Expand Up @@ -431,7 +431,7 @@ \section{\texttt{wrap} -- Wrapping atoms}
\texttt{-nocompound}\linebreak $|$\texttt{-compound} \texttt{res}[\texttt{id}[\texttt{ue}]]$|$\texttt{seg}[\texttt{id}]$|$\texttt{chain}$|$\texttt{fragment}
& Defines, which atom compounds should be kept together, \ie which
atoms will not be wrapped if a compound would be split by the
wrapping: residues, segments or chains (default:
wrapping: resids, residues, segments or chains (default:
\texttt{-nocompound}).
Note: this does not presently work with \texttt{-cell compact}.
\\ \hline
Expand Down Expand Up @@ -560,7 +560,7 @@ \section{\texttt{unwrap} -- Unwrapping atoms}


\newpage
\section{\texttt{join} -- Joining residues, chains, segments, fragments,
\section{\texttt{join} -- Joining resids, residues, chains, segments, fragments,
and connected/bonded groups}
\label{sec:join}

Expand Down
14 changes: 11 additions & 3 deletions pbcjoin.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace eval ::PBCTools:: {
# Joins compounds of type $compound of atoms that have been
# split due to wrapping around the unit cell boundaries, so that
# they are not split anymore. $compound must be one of the values
# "residue", "chain", "segment", "fragment" or "connected".
# "resid", "residue", "chain", "segment", "fragment" or "connected".
#
# OPTIONS:
# -molid $molid|top
Expand Down Expand Up @@ -54,8 +54,11 @@ namespace eval ::PBCTools:: {
set compoundtype "segid"
set compoundseltext "segid %s"
}
"resid" {
set compoundtype "resid"
set compoundseltext "resid %s"
}
"res" -
"resid" -
"residue" {
set compoundtype "residue"
set compoundseltext "residue %s"
Expand All @@ -76,7 +79,7 @@ namespace eval ::PBCTools:: {
default {
vmdcon -err "pbcjoin: unknown compound type $compoundtype"
vmdcon -err "pbcjoin: syntax: pbc join <compound> \[<options> ...\]"
vmdcon -err "pbcjoin: supported compound types: segment, residue, chain, fragment, connected"
vmdcon -err "pbcjoin: supported compound types: segment, resid, residue, chain, fragment, connected"
error "pbcjoin: argument parse error"
}
}
Expand Down Expand Up @@ -167,6 +170,11 @@ namespace eval ::PBCTools:: {
lappend compoundlist "segid $segid"
}
}
"resid" {
foreach resid [lsort -integer -unique [$sel get resid]] {
lappend compoundlist "resid $resid"
}
}
"residue" {
foreach resid [lsort -integer -unique [$sel get residue]] {
lappend compoundlist "residue $resid"
Expand Down
4 changes: 2 additions & 2 deletions pbcwrap.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ namespace eval ::PBCTools:: {
# handle compounds
switch -- $compound {
"" {}
"resid" { set compound "resid" }
"res" -
"resid" -
"residue" { set compound "residue" }
"seg" -
"segid" { set compound "segid" }
Expand Down Expand Up @@ -307,7 +307,7 @@ namespace eval ::PBCTools:: {
# Wrap all atoms in $wrapsel to their closest approach
# to the origin. This ignores molecule selections
# because there doesn't seem to be a way to loop
# over residues / chains / etc. inside the selection.
# over resid / residues / chains / etc. inside the selection.
#
# TODO:
# Maybe there's a way to select the first atom of each residue,
Expand Down