Rosetta
Functions | Variables
kmeans_common Namespace Reference

Functions

def get_common_int_coords_2 (x, y, z)
 
def get_common_int_coords (x, y, z)
 
def load_centroid (fn, ncluster)
 
def load_centroid_xyz (fn, ncluster)
 

Variables

float cutoff = 1.6
 
 restype = sys.argv[1]
 
 ncluster = int(sys.argv[2])
 
string inpfile = "./split/" + restype + ".dat"
 
 inp = open(inpfile,'r')
 
 lines = inp.readlines()
 
 skip = int(len(lines)/10000)
 
list colorlist = ['r', 'b', 'g', 'y', 'c', 'm', 'k', 'w', 'r']
 
list marklist = ['o', '^', '+', '>', (5,2), (5,0)]
 
list xyzlist = []
 
list bblist = []
 
 dats = line.split()
 
 dis = float(dats[0])
 
 ang = float(dats[1])
 
 dih = float(dats[2])
 
 psi = float(dats[3])
 
 phi = float(dats[4])
 
 x = dis*sin(ang)*cos(dih)
 
 y = dis*sin(ang)*sin(dih)
 
 z = dis*cos(ang)
 
 data = vstack(xyzlist)
 cluster, find the centroid More...
 
 save_data = data
 
string fn = "refine/" + restype + ".xyz"
 
def centroids = load_centroid_xyz(fn, ncluster)
 
 _
 
 idx
 assign More...
 
 dist
 
 nd = len(data)
 
 savend = nd
 
 fig = plt.figure()
 
 ax = fig.add_subplot(111, projection='3d')
 
float R = 2.0
 
list c = colorlist[i]
 
string m = '.'
 
 flag = i
 
 xs = save_data[flag, 0]
 
 ys = save_data[flag, 1]
 
 zs = save_data[flag, 2]
 
 n = len(xs)
 
 s
 
 marker
 
 r = sqrt(x*x+y*y+z*z)
 
 t = arccos(z/r)
 
 p = arctan2(y,x)
 
 u
 
 v
 
 color
 

Function Documentation

◆ get_common_int_coords()

def kmeans_common.get_common_int_coords (   x,
  y,
  z 
)

◆ get_common_int_coords_2()

def kmeans_common.get_common_int_coords_2 (   x,
  y,
  z 
)

◆ load_centroid()

def kmeans_common.load_centroid (   fn,
  ncluster 
)

◆ load_centroid_xyz()

def kmeans_common.load_centroid_xyz (   fn,
  ncluster 
)

Variable Documentation

◆ _

kmeans_common._
private

◆ ang

kmeans_common.ang = float(dats[1])

◆ ax

kmeans_common.ax = fig.add_subplot(111, projection='3d')

◆ bblist

list kmeans_common.bblist = []

◆ c

kmeans_common.c = colorlist[i]

◆ centroids

kmeans_common.centroids = load_centroid_xyz(fn, ncluster)

◆ color

kmeans_common.color

◆ colorlist

list kmeans_common.colorlist = ['r', 'b', 'g', 'y', 'c', 'm', 'k', 'w', 'r']

◆ cutoff

kmeans_common.cutoff = 1.6

◆ data

kmeans_common.data = vstack(xyzlist)

cluster, find the centroid

◆ dats

kmeans_common.dats = line.split()

◆ dih

kmeans_common.dih = float(dats[2])

◆ dis

kmeans_common.dis = float(dats[0])

◆ dist

kmeans_common.dist

◆ fig

kmeans_common.fig = plt.figure()

◆ flag

kmeans_common.flag = i

◆ fn

string kmeans_common.fn = "refine/" + restype + ".xyz"

◆ idx

kmeans_common.idx

assign

◆ inp

kmeans_common.inp = open(inpfile,'r')

◆ inpfile

string kmeans_common.inpfile = "./split/" + restype + ".dat"

◆ lines

kmeans_common.lines = inp.readlines()

◆ m

string kmeans_common.m = '.'

◆ marker

kmeans_common.marker

◆ marklist

list kmeans_common.marklist = ['o', '^', '+', '>', (5,2), (5,0)]

◆ n

kmeans_common.n = len(xs)

◆ ncluster

kmeans_common.ncluster = int(sys.argv[2])

◆ nd

kmeans_common.nd = len(data)

◆ p

kmeans_common.p = arctan2(y,x)

◆ phi

kmeans_common.phi = float(dats[4])

◆ psi

kmeans_common.psi = float(dats[3])

◆ R

kmeans_common.R = 2.0

◆ r

kmeans_common.r = sqrt(x*x+y*y+z*z)

◆ restype

kmeans_common.restype = sys.argv[1]

◆ s

kmeans_common.s

◆ save_data

kmeans_common.save_data = data

◆ savend

kmeans_common.savend = nd

◆ skip

kmeans_common.skip = int(len(lines)/10000)

◆ t

kmeans_common.t = arccos(z/r)

◆ u

kmeans_common.u

◆ v

kmeans_common.v

◆ x

float kmeans_common.x = dis*sin(ang)*cos(dih)

◆ xs

kmeans_common.xs = save_data[flag, 0]

◆ xyzlist

list kmeans_common.xyzlist = []

◆ y

float kmeans_common.y = dis*sin(ang)*sin(dih)

◆ ys

kmeans_common.ys = save_data[flag, 1]

◆ z

float kmeans_common.z = dis*cos(ang)

◆ zs

kmeans_common.zs = save_data[flag, 2]