Exemplo n.º 1
0
	ball_data = bbtmio.read_ball_file(ball_fn)

	################################################
	# recenter pdb balls file
	print( '\tPreparing recentered and aligned pdb balls file' )
	ball_pdb_fn = pdbfn[:-4]+'_pdb.balls'
	if os.path.isfile(ball_pdb_fn) and not args['overwrite']:
		print( '\tFile '+pdbcode+'_pdb.balls exists. Nothing changed.\n' )
	else:
		ball_coord_mat = bbtmio.get_ball_coords( ball_data )
		pdbball_data = bbtmio.read_ball_file(ball_ori_fn)
		# recenter
		pdbball_coord_mat = bbtmio.recenter_coord_mat( bbtmio.get_pdb_coords(structure,bbin_data), bbin_data )
		pdbball_data = bbtmio.set_ball_coords(pdbball_data, pdbball_coord_mat)
		# align
		rotation_matrix, pdbball_coord_mat = bbtmio.align_coordmat(pdbball_coord_mat, ball_coord_mat) 
		pdbball_data = bbtmio.set_ball_coords(pdbball_data, pdbball_coord_mat)
		bbtmio.write_ball_file(pdbball_data, ball_pdb_fn)
		print( '\tFile '+pdbcode+'_pdb.balls written.\n' )
	ball_pdb_data = bbtmio.read_ball_file(ball_pdb_fn)


	################################################
	# calculate displacement from ideal barrel
	print( '\tCalculate displacement from ideal to real' )
	dfn = pdbfn[:-4]+'.displacement'
	if os.path.isfile(dfn) and not args['overwrite']:
		print( '\tFile '+pdbcode+'.displacement exists. Nothing changed.\n' )
	else:
		#ball_data = bbtmio.read_ball_file(ball_fn)
		#ball82_data = bbtmio.read_ball_file(ball_fn+'82')
Exemplo n.º 2
0
Arquivo: test.py Projeto: jksr/beta
	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)