Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_presence_absence_table(self):
(pa_file, pa_fname) = self._createTemporaryFile(delete=True)
cluster = self._getClusterId()
cmd = 'db_getPresenceAbsenceTable.py -r %s -c %s > %s 2> /dev/null' %(self.accumulated_data['runid'], cluster, pa_fname)
print cmd
os.system(cmd)
pa_table = [ line.strip('\r\n').split('\t') for line in pa_file ]
text = self._print_readable_table(pa_table)
easygui.codebox(text=text)
output_file = self._save_file_dialogs(extension="txt")
if output_file is not None:
self._save_text(text, output_file)
self._success_dialog(output_file)
return True
def _make_crude_alignment(self):
def _make_crude_alignment(self):
(aln_file, aln_fname) = self._createTemporaryFile(delete=True)
cluster = self._getClusterId()
cmd = 'makeTabDelimitedRow.py %s %s | db_makeClusterAlignment.py -m mafft_linsi -n | Gblocks_wrapper.py | db_replaceGeneNameWithAnnotation.py -a -o > %s 2> /dev/null' \
%(self.accumulated_data['runid'], cluster, aln_fname)
print cmd
os.system(cmd)
text = ''.join( [ line for line in aln_file ] )
easygui.codebox(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 _make_crude_tree(self, replacename = True):
def display(header, results):
"""
Display header string and list of result lines
"""
if displayer == 'easygui':
title = 'Waveform properties'
easygui.codebox(header, title, '\n'.join(results))
else:
print('No EasyGUI; printing output to console\n')
print(header)
print('-----------------')
print('\n'.join(results))
def _get_cluster_geneinfo(self):
clusterid = self._getClusterId()
genelist = getGenesInCluster(self.accumulated_data['runid'], clusterid, self.sqlite_cursor)
geneinfo = getGeneInfo(genelist, self.sqlite_cursor)
geneinfo.insert(0, self._geneInfoHeader())
text = self._print_readable_table(geneinfo, header=True)
easygui.codebox(text=text)
output_file = self._save_file_dialogs(extension="txt")
if output_file is not None:
self._save_text(text, output_file)
self._success_dialog(output_file)
return True
def _get_cluster_fasta(self, amino=True):
def hexview_data (data, msg='', title='ezhexviewer', length=16, startindex=0):
hex = hexdump3(data, length=length, startindex=startindex)
easygui.codebox(msg=msg, title=title, text=hex)
def _get_cluster_blast(self):
clusterid = self._getClusterId()
genelist = getGenesInCluster(self.accumulated_data['runid'], clusterid, self.sqlite_cursor)
blast = getBlastResultsBetweenSpecificGenes(genelist, self.sqlite_cursor)
blast.insert(0, self._blastHeader())
text = self._print_readable_table(blast, header=True)
easygui.codebox(text=text)
output_file = self._save_file_dialogs(extension="txt")
if output_file is not None:
self._save_text(text, output_file)
self._success_dialog(output_file)
return True
def _get_cluster_geneinfo(self):
def Choice_Run_Tabanalys():
#Run Tabanalys and clean into CSV file
now = datetime.datetime.now()
TabAnalysFile = PilotApp.Settings['EpicorDBDir'] + r'\TabAnalys.tmp'
TabCSVFile = PilotApp.Settings['EpicorDBDir'] + r'\TabAnalys ' + str(now.year) + '-' + str(now.month) + '-' + str(now.day) + '.csv'
easygui.msgbox('This may take a few, please be patient.')
Command(PilotApp.Settings['OpenEdgeDir'] + r'\bin\proutil.bat ' + PilotApp.Settings['EpicorDBDir'] + '\\' + PilotApp.Settings['Database Name'] + ' -C tabanalys > ' + TabAnalysFile).run()
#print PilotApp.Settings['OpenEdgeDir'] + '\\bin\\proutil.bat ' + PilotApp.Settings['EpicorDBDir'] + '\\' + PilotApp.Settings['Database Name'] + ' -C tabanalys > ' + TabAnalysFile
tabtmp = open(TabAnalysFile)
tabcontents = tabtmp.readlines()
easygui.codebox('Contents','Contents',tabcontents)
tabtmp.close()
CleanTabAnalys(TabAnalysFile,TabCSVFile)
easygui.msgbox('Saved csv (w/ headers) file to ' + TabCSVFile)