コード例 #1
0
ファイル: skittles.py プロジェクト: masci/mmLib
            ##        'serial': 1}
            cid1      = atom_obj[u-1]["chainID"]
            cid2      = atom_obj[u]["chainID"]
            res_name1 = atom_obj[u-1]["resName"].strip()
            res_name2 = atom_obj[u]["resName"].strip()
            res_num1  = atom_obj[u-1]["resSeq"]
            res_num2  = atom_obj[u]["resSeq"]
            atm_name1 = atom_obj[u-1]["name"].strip()
            atm_name2 = atom_obj[u]["name"].strip()
            x1        = atom_obj[u-1]["x"]
            y1        = atom_obj[u-1]["y"]
            z1        = atom_obj[u-1]["z"]
            x2        = atom_obj[u]["x"]
            y2        = atom_obj[u]["y"]
            z2        = atom_obj[u]["z"]
            Upos      = tlsvld.array([x1,y1,z1])
            Vpos      = tlsvld.array([x2,y2,z2])
            tls_group = 0

            ## Calculate the distance between two atoms
            d = math.sqrt( (x1-x2)**2 + (y1-y2)**2 + (x1-x2)**2 )
            #d = AtomMath.calc_distance(atom_obj[u-1], atom_obj[u])
            if ( (d > 2.0) and (cid1 == cid2) ):
                print "# BOND BREAK!"
                continue

            ## Add newlines for new chain_id
            if cid1 != cid2:
                chain_type = get_chain_type(res_name2)
                print "\n"
                continue
コード例 #2
0
ファイル: test.py プロジェクト: Sree-Inventrust/pymmlib
#!/usr/bin/python
import tlsvld
import scipy
import numpy
import math

U = tlsvld.array([[0.37471362,-0.07411912,-0.0379023],[-0.07411912,0.39010298,-0.03240841],[-0.0379023,-0.03240841,0.33057791]])
V = tlsvld.array([[0.38484156,-0.06933809,-0.04994903],[-0.06933809,0.41376374,-0.03275701],[-0.04994903,-0.03275701,0.33967632]])
#print U
#print V
#print "="*80
#U = scipy.array([[0.37471362,-0.07411912,-0.0379023],[-0.07411912,0.39010298,-0.03240841],[-0.0379023,-0.03240841,0.33057791]])
#V = scipy.array([[0.38484156,-0.06933809,-0.04994903],[-0.06933809,0.41376374,-0.03275701],[-0.04994903,-0.03275701,0.33967632]])
#V = scipy.array([[100.38484156,-0.06933809,-0.04994903],[-0.06933809,0.41376374,-0.03275701],[-0.04994903,-0.03275701,0.33967632]])
#print U
#print V
#print "="*80

#U = tlsvld.array([[7,7,7],[7,7,7],[7,7,7]])
#V = tlsvld.array([[4,4,4],[4,4,4],[4,4,4]])
W = tlsvld.array([[1.0,1.0,1.0],[1.0,1.0,1.0],[1.0,1.0,1.0]])
X = tlsvld.array([[4.0,4.0,4.0],[4.0,4.0,4.0],[4.0,4.0,4.0]])
print "SQD = ",tlsvld.sum_square_diff(W,X)

#print "trace(U) = ", tlsvld.trace3x3(X)
print "dtUV = ",tlsvld.diff_trace_uv(W,X)

print tlsvld.mul3x3(U,V)
print tlsvld.add3x3(U,V)
print "SUM(W) = ",tlsvld.sum3x3(X)
print tlsvld.subtract3x3(U,V)
コード例 #3
0
            cid2      = atom_obj[u]["chainID"]
            res_name1 = atom_obj[u-1]["resName"].strip()
            res_name2 = atom_obj[u]["resName"].strip()
            res_num1  = atom_obj[u-1]["resSeq"]
            res_num2  = atom_obj[u]["resSeq"]
            atm_name1 = atom_obj[u-1]["name"].strip()
            atm_name2 = atom_obj[u]["name"].strip()
            #pos1      = atom_obj[u-1].position
            #pos2      = atom_obj[u].position
            x1        = atom_obj[u-1]["x"]
            y1        = atom_obj[u-1]["y"]
            z1        = atom_obj[u-1]["z"]
            x2        = atom_obj[u]["x"]
            y2        = atom_obj[u]["y"]
            z2        = atom_obj[u]["z"]
            Upos      = tlsvld.array([x1,y1,z1])
            Vpos      = tlsvld.array([x2,y2,z2])
            #tls_group = atom_obj[u-1].tls_group
            tls_group = 0

            d = math.sqrt( (x1-x2)**2 + (y1-y2)**2 + (x1-x2)**2 )
            #d = AtomMath.calc_distance(atom_obj[u-1], atom_obj[u])
            if ( (d > 2.0) and (cid1 == cid2) ):
                print "# BOND BREAK!"
                continue

            ## Add newlines for new chain_id
            if cid1 != cid2:
                chain_type = get_chain_type(res_name2)
                print "\n"
                continue