本文整理匯總了Python中Data.load_snp方法的典型用法代碼示例。如果您正苦於以下問題:Python Data.load_snp方法的具體用法?Python Data.load_snp怎麽用?Python Data.load_snp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Data
的用法示例。
在下文中一共展示了Data.load_snp方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: PooGUI
# 需要導入模塊: import Data [as 別名]
# 或者: from Data import load_snp [as 別名]
#.........這裏部分代碼省略.........
opt = \
InferredOrigin(master=self.origin_frame,x=e[0][1],y=e[0][2],
text="Origin "+cluster.name)
opt.set_color("red")
cluster.origin = opt
else:
opt = cluster.origin
opt.tX.set("%2.2f"%(e[0][1]))
opt.tY.set("%2.2f"%(e[0][2]))
opt.set_x(e[0][1])
opt.set_y(e[0][2])
opt.update_()
print "UPDATED ORIGN"
self.d.oList.append(opt)
opt.grid(in_=self.origin_frame)
self.canvas['H'].panel.add_artist( opt.circH )
self.canvas['H'].update_()
self.canvas['Psi'].panel.add_artist( opt.circP )
#origins shouldn't be movable
#opt.circH.connect()
#opt.circP.connect()
self.activeCanvas.redraw()
return ev, msev, pv, dv
#------------------------------------Hyperbola---------------------------------
# loading files and data
#---------------------------------------------------------------------
def loadSNP(self,f=None):
"""loads SNP and saves them in data"""
if f == None:
f = tkFileDialog.askopenfile(mode='r')
self.d.load_snp( np.loadtxt(f) )
self.canvas['H'].draw_all_hyperbolas()
self.canvas['Psi'].draw_all_pairwise_psi()
self.initPsiMatrix(self.master)
#---------------------------- Sorting stuff ------------------------
# this set of functions handles all the sorting of elements
#--------------------------------------------------
def update_sample_order(self):
"""
when the samples are sorted and have to be reordered, this function
does it
"""
self.d.sList = sorted(self.d.sList)
self.sample_frame.update_sample_order(self.d.sList)
self.psi_matrix.update_sample_order(self.d.sList)
#--------------------------------------------------
def loadCoords(self,f=None):
"""loads Coords, creates the corresponding UI elements
and the circles for plotting
"""
default_cluster = self.d.default_cluster
self.reset_sample_list()
if f is None:
f = tkFileDialog.askopenfile(mode='r',initialfile="coords.txt")
print f
else:
f = open( f )