本文整理汇总了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 )