Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _make_crude_tree(self, replacename = True):
# Create tree and make human-readable.
(nwk_file, nwk_fname) = self._createTemporaryFile(delete=True)
cluster = self._getClusterId()
if replacename:
cmd = 'makeTabDelimitedRow.py %s %s | db_makeClusterAlignment.py -m mafft_linsi -n | Gblocks_wrapper.py | FastTreeMP -wag -gamma | db_replaceGeneNameWithAnnotation.py -a -o > %s 2> /dev/null' \
%(self.accumulated_data['runid'], cluster, nwk_fname)
else:
cmd = 'makeTabDelimitedRow.py %s %s | db_makeClusterAlignment.py -m mafft_linsi -n | Gblocks_wrapper.py | FastTreeMP -wag -gamma > %s 2> /dev/null' \
%(self.accumulated_data['runid'], cluster, nwk_fname)
print cmd
os.system(cmd)
text = ''.join( [ line for line in nwk_file ] )
easygui.textbox(text=text)
output_file = self._save_file_dialogs(extension="nwk")
if output_file is not None:
self._save_text(text, output_file)
self._success_dialog(output_file)
return True
def _display_crude_neighborhood_tree(self):
def _get_cluster_fasta(self, amino=True):
r2c = self.accumulated_data['run_to_cluster']
clusterid = self._getClusterId()
genelist = getGenesInCluster(self.accumulated_data['runid'], clusterid, self.sqlite_cursor)
geneinfo = getGeneInfo(genelist, self.sqlite_cursor)
if amino:
idx = 11
else:
idx = 10
text = ''
for gi in geneinfo:
text += '>%s %s\n%s\n'%(gi[0], gi[9], gi[idx])
easygui.textbox(text=text)
output_file = self._save_file_dialogs(extension="fasta")
if output_file is not None:
self._save_text(text, output_file)
self._success_dialog(output_file)
return True
def _get_presence_absence_table(self):
def about ():
"""
Display information about this tool
"""
easygui.textbox(title='About olebrowse', text=__doc__)
msg2 = "fullscreen mode"
else:
msg2 = "window mode"
msg = "Welcome at screensaver game menu.\nScreensaver will run with %ix%i resolution,\n%s" % (resolution[0], resolution[1], msg2)
selection = easygui.buttonbox(msg, title, buttons, picture)
if selection == "quit":
easygui.msgbox("bye-bye", "such a sad decision...")
break # leave loop
elif selection == "visit homepage":
print("i try to open the webbrowser, please wait a bit...")
webbrowser.open_new_tab("http://www.thepythongamebook.com")
elif selection == "toggle fullscreen":
fullscreen = not fullscreen
elif selection == "view highscore":
text = readGameFile(gamefile)
easygui.textbox("This is the Screensaver logfile", "displaying highscore", text)
# elif selection == "watch screensaver":
# watched += 1
# get return value from called pygame program (playtime)
# playtime = screensaver.screensaver(resolution, fullscreen)
# easygui.msgbox("You watched the scrensaver %i x using this game menu \nYour screen was saved for %.2f seconds" % (watched, playtime))
# writing highscore-list
# line = "date: %s player: %s playtime: %.2f seconds resolution: %ix%i fullscreen: %s \n" % (time.asctime(), playername, playtime, resolution[0], resolution[1], fullscreen)
# writeGameFile(gamefile, line)
elif selection == "change resolution":
answer = easygui.choicebox("Please select one of those screen resolutions", "x,y", reslist)
# answer gives back a string like '(320, 200)'
resolution = parse(answer)
return
def show_log(battles, vtext, log):
if battles == 0:
easygui.msgbox("no battles yet !")
return # do nothing and return
easygui.textbox(vtext, "combat log", log) # show box and return
if battles == 0:
easygui.msgbox("no battles yet !")
continue # jump to the top of the current (while) loop
easygi.textbox(vtext, "combat log", log)
elif action == "edit":
pass
elif action == "save":
output = open("combat_statistic","a") # a: append
output.write("\n- - - - -\ntext")
output.close()
elif action == "+1 battle":
pass
if easygui.ccbox(text,"combat result", image=victorimage):
easygui.textbox(vtext, "combat log", log)
def _get_amino_acid_fasta(self):
geneinfo = self.accumulated_data['geneinfo']
text = '>%s %s\n%s\n' %(geneinfo[0], geneinfo[9], geneinfo[11])
easygui.textbox(text=text)
output_file = self._save_file_dialogs(extension="fasta")
if output_file is not None:
self._save_text(text, output_file)
self._success_dialog(output_file)
return True
def _get_gene_neighborhood(self):