Skip to content

Commit

Permalink
4.7.0 new minor upate: you can now stride (read every Xth frames) you…
Browse files Browse the repository at this point in the history
…r trajectories with "-s" argument
  • Loading branch information
tubiana committed May 14, 2020
1 parent 53712d1 commit c36acf2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ the interactive prompt.
-h, --help show this help message and exit
-f TRAJ, --traj TRAJ trajectory file(s). You can give a list of trajectory (see usage example)
-t TOP, --top TOP topfile
-s INT, --stride INT stride, read every Xth frames
-o OUTPUT, --output OUTPUT (default: clustering.log)
logfile
-st SELECT_TRAJ, --select_traj SELECT_TRAJ (default: all)
Expand Down Expand Up @@ -196,6 +197,8 @@ Please note that the trajectory is reduced to the backbone in order to reduce th
Caution: You have to put quote beside your selection string (for *sr*, *st*, and *sa* arguments)
- Simple usage (clustering on backbone, logfile is called clustering.log, output folder is "clustering")
```python ttclust.py -f examples/example.xtc -t examples/example.pdb```
- Simple usage with reading every 10 frames
```python ttclust.py -f examples/example.xtc -t examples/example.pdb -s 10```
- Simple usage with multiple trajectories
```python ttclust.py -f traj1.xtc traj2.xtc -t examples/example.pdb```
```python ttclust.py -f *.xtc -t examples/example.pdb```
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from setuptools import setup, find_packages

MAJOR = 4
MINOR = 6
PATCH = 10
MINOR = 7
PATCH = 0
VERSION = "{}.{}.{}".format(MAJOR, MINOR, PATCH)

with open("ttclust/version.py", "w") as f:
Expand Down
8 changes: 5 additions & 3 deletions ttclust/ttclust.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def init_log(args, mdtrajectory):
select_align))
LOGFILE.write(" Atoms selected for RMSD = {} \n".format(select_rmsd))
LOGFILE.write(" trajectory file : {} \n".format(','.join(traj)))
LOGFILE.write(" Stride : {} \n".format(args["stride"]))
LOGFILE.write(" Number of frames : {} \n".format(mdtrajectory.n_frames))
LOGFILE.write(" Number of atoms : {} \n".format(mdtrajectory.n_atoms))
LOGFILE.write(" topology file : {} \n".format(topo))
Expand Down Expand Up @@ -320,6 +321,7 @@ def parseArg():
pass
arguments.add_argument('-f', "--traj", help="trajectory file(s). You can give a list of files.", required=True, nargs='+')
arguments.add_argument('-t', '--top', help="topfile", default=None)
arguments.add_argument('-s', '--stride', help="stride (read every Xth frames", default=1)
arguments.add_argument('-l', '--logfile', help="logfile (default : clustering.log). The "
"name of your output file will be the basename (name before the extention "
"of this logfile", default="clustering")
Expand Down Expand Up @@ -1162,7 +1164,7 @@ def Cluster_analysis_call(args):
else:

traj = md.load(trajfile,
top=topfile)
top=topfile, stride=args["stride"])
elif len(trajfile) > 1:
print(">Several trajectories given. Will concatenate them.")
trajList = []
Expand All @@ -1171,7 +1173,7 @@ def Cluster_analysis_call(args):
trajList.append(md.load_pdb(t))
else:
trajList.append(md.load(t,
top=topfile))
top=topfile,stride=args["stride"]))
traj = md.join(trajList)

#resting the timetable
Expand Down Expand Up @@ -1236,7 +1238,7 @@ def main():
"""

print("********************************************************")
print("****************** TTCLUST {} **********************".format(
print("****************** TTCLUST {} *********************".format(
__version__))
print("********************************************************")
print("")
Expand Down
2 changes: 1 addition & 1 deletion ttclust/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '4.6.10'
__version__ = '4.7.0'

0 comments on commit c36acf2

Please sign in to comment.