def test_TrajCluster(self): """TrajCluster test""" from biskit.md import traj2ensemble traj = T.load( T.testRoot()+'/lig_pcr_00/traj.dat') traj = traj2ensemble( traj ) aMask = traj.ref.mask( lambda a: a['name'] in ['CA','CB','CG'] ) traj = traj.thin( 1 ) traj.fit( aMask, verbose=self.local ) self.tc = TrajCluster( traj, verbose=self.local ) ## check how many clusters that are needed with the given criteria n_clusters = self.tc.calcClusterNumber( min_clst=3, max_clst=15, rmsLimit=0.7, aMask=aMask ) ## cluster self.tc.cluster( n_clusters, aMask=aMask ) if self.local: member_frames = self.tc.memberFrames() print('There are %i clusters where the members are:'%n_clusters) for i in range(n_clusters): print('Cluster %i (%i members): %s'%( i+1, len(member_frames[i]), member_frames[i] ))
#!/usr/bin/env python ## re-generate binary test data in this folder import biskit as B import biskit.tools as T from biskit.md import AmberCrdParser, EnsembleTraj, traj2ensemble p = AmberCrdParser('raw/traj.crd', 'raw/traj_ref.pdb' ) ## create standard trajectory object t = p.crd2traj() t.frameNames = T.load('raw/traj_framenames.list') te = traj2ensemble(t, members=10) te.fit(fit=0) ## re-calculate profile 'rms' (all-atom fit to average structure) T.dump(te, 'traj.dat')
#!/usr/bin/env python ## re-generate binary test data in this folder import biskit as B import biskit.tools as T from biskit.md import AmberCrdParser, EnsembleTraj, traj2ensemble p = AmberCrdParser('raw/traj.crd', 'raw/traj_ref.pdb') ## create standard trajectory object t = p.crd2traj() t.frameNames = T.load('raw/traj_framenames.list') te = traj2ensemble(t, members=10) te.fit( fit=0) ## re-calculate profile 'rms' (all-atom fit to average structure) T.dump(te, 'traj.dat')