print( '\tPreparing bbin file' ) # check geo file geofn = pdbfn[:-4]+'.geo' if not os.path.isfile( geofn ): print( '\tFile '+pdbcode+'.geo not found. ' +pdbcode+ ' ignored\n' ) continue ################################################ # write bbin file bbinfn = pdbfn[:-4]+'.bbin' if os.path.isfile(bbinfn) and not args['overwrite']: print( '\tFile '+pdbcode+'.bbin exists. Nothing changed.\n' ) else: bbtmio.write_bbin_file(pdbfn, geofn) print( '\tFile '+pdbcode+'.bbin written.\n' ) bbin_data = bbtmio.read_bbin_file(bbinfn) ################################################ # write balls and sticks file print( '\tPreparing .balls and .sticks files' ) ball_ori_fn = pdbfn[:-4]+'_origin.balls' stick_fn = pdbfn[:-4]+'.sticks' if os.path.isfile(ball_ori_fn) and os.path.isfile(stick_fn) and not args['overwrite']: print( '\tFile '+pdbcode+'_origin.balls and .sticks exist. Nothing changed.\n' ) else: os.system('exec/barrel.out '+pdbfn[:-4]+'.bbin') print( '\tFile '+pdbcode+'_origin.balls and .sticks written.\n' ) ball_data = bbtmio.read_ball_file(ball_ori_fn) # temporary file, register for cleaning files_to_clean.append(ball_ori_fn)
ks3 = np.array( [ 1.31824322, 0.88899824, 0.9253788 , 0.72740754, 2.81697644, 0.66983903, 0.36771102] ) ks = np.mean(np.vstack((ks1,ks2,ks3)), axis=0) @classmethod def get_k(cls, btype, a1type, a2type): return 100 if btype=='SP' else 100000000 * np.dot( cls.kta.get_assign_vec(a1type, a2type, btype), cls.ks ) for coden in testset: ses = bbtmdsm.StiffnessEquSys('../../../data/testdata/'+coden+'.balls.ideallarge.ext', '../../../data/testdata/'+coden+'.sticks.ideallarge.ext', testkassigner ) ses.solve() u = ses.u.reshape(ses.u.shape[0]/3, 3) ideallargecoords = bbtmio.get_ball_coords( bbtmio.read_ball_file('../../../data/testdata/'+coden+'.balls.ideallarge') ) pdbcoords = bbtmio.get_ball_coords( bbtmio.read_ball_file('../../../data/'+coden+'_pdb.balls') ) afteru = ideallargecoords + u newafteru = bbtmio.recenter_coord_mat(afteru, bbtmio.read_bbin_file('../../../data/'+coden+'.bbin')) bbtmio.write_ball_file( bbtmio.set_ball_coords( bbtmio.read_ball_file('../../../data/testdata/'+coden+'.balls.ideallarge'), newafteru ), coden+'.balls.au') dummy,newpdbcoords = bbtmio.align_coordmat(pdbcoords, newafteru) disp = newafteru - newpdbcoords rmsd = np.mean(np.square(np.linalg.norm(disp, axis=1))) ** 0.5 print coden, disp.shape[0], rmsd #sys.exit(0)