def analyzeTrajectory(trajFN): #print "Analyzing trajectory: %s ..." % trajFN coords = readxtc( trajFN, atomindices = range(128) ) count = 0 for frame in coords: rms = RMSD.GetDistance( frame, NatState['XYZ'] ) # print rms if rms >= options.uCut: return 1 elif rms <= options.fCut: return 0 else: continue return -1
def analyzeTrajectory(trajFN): # this function will analyze a trajectory for native contacts in the toTestLists global U_states global F_states #print "Analyzing trajectory: %s ..." % trajFN coords = readxtc( trajFN, atomindices = range(128) ) # Assignment stuff #AssList = clstr.Assign(Generators=gens['XYZList'],XYZData=array(coords)) #for ass in AssList: for frame in coords: ass,rmsd = clstr.Assign(Generators=gens['XYZList'],XYZData=array([frame])) ass = ass[0] if ass in U_states: return 0 elif ass in F_states: return 1 return -1
def analyzeTrajectory(trajFN): global options global natContacts global cutoff2Dict # this function will analyze a trajectory for native contacts in the toTestLists #print "Analyzing trajectory: %s ..." % trajFN coords = readxtc( trajFN, atomindices = range(128) ) count = 0 for frame in coords: frameSum = 0. count += 1 for contact in natContacts: atomA = contact[0] atomB = contact[1] # Need to check the distance between these atoms in all frames: tempArray = [] coordA = frame[atomA-1] coordB = frame[atomB-1] diff = [ (thingA - thingB) for (thingA,thingB) in zip(coordA,coordB) ] r2 = diff[0]*diff[0] + diff[1]*diff[1] + diff[2]*diff[2] try: cutoff2 = cutoff2Dict[ (atomA,atomB) ] except: try: cutoff2 = cutoff2Dict[ (atomB,atomA) ] except: print "Cutoff not found for %d,%d, using default = 1.0" % (atomA,atomB) cutoff2 = 1 frameSum += ( r2 <= cutoff2 ) frameSum /= float(len(natContacts)) if frameSum <= options.uCut: return 1 elif frameSum >= options.fCut: return 0 else: continue return -1