コード例 #1
0
ファイル: preprocess.py プロジェクト: jksr/beta2
		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)

	################################################
	# recenter balls
	print( '\tRecentering the coordinate matrix in balls file' )
	ball_fn = pdbfn[:-4]+'.balls'
	if os.path.isfile(ball_fn) and not args['overwrite']:
		print( '\tFile '+pdbcode+'.balls exists. Nothing changed.\n' )
	else:
		ball_coord_mat = bbtmio.recenter_coord_mat( bbtmio.get_ball_coords(ball_data), bbin_data)
		ball_data = bbtmio.set_ball_coords(ball_data, ball_coord_mat)
		bbtmio.write_ball_file(ball_data, ball_fn)
		print( '\tFile '+pdbcode+'.balls written.\n' )
	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
コード例 #2
0
ファイル: test.py プロジェクト: 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)