# Combined cluster analysis with cpptraj.

# Load topology and both trajectories
parm rGACC.nowat.parm7
trajin rGACC.MREMD1.nowat.nc.40 # 83843 frames
trajin rGACC.MREMD2.nowat.nc.40 # 108887 frames
# Remove ions so they do not appear in output structures.
strip :Na+ outprefix noions
# Cluster analysis command
#  C1: Cluster output data set(s) name.
#  dbscan: Clustering algorithm.
#    minpoints: Minimum # of points to form a cluster.
#    epsilon: Distance cutoff for forming cluster.
#    sievetoframe: Restore sieved frames by comparing to all cluster frames,
#                  not just centroid.
#  rms <mask>: Use RMSD of atoms in <mask> as distance metric.
#  sieve 20: Use <total> / 20 initial frames for clustering.
#  out <file>: Write cluster number versus time to file.
#  info <file>: Write detailed cluster results (including DBI, pSF etc) to file.
#  summarysplit <file>: Write cluster information for split to file.
#    splitframe 83843: Split clustering at frame 83843 (where first traj stops).
cluster C1 \
        dbscan minpoints 25 epsilon 0.9 sievetoframe \
        rms :1@N2,O6,C1',P,:2@H2,N6,C1',P,:3@O2,H5,C1',P,:4@O2,H5,C1',P \
        sieve 20 \
        out combined.cnumvtime.dat \
        info combined.info.dat \
        summarysplit split.dat splitframe 83843
