Skip to content

Commit

Permalink
11/25/2019
Browse files Browse the repository at this point in the history
  • Loading branch information
nsalomonis committed Nov 25, 2019
1 parent 422442f commit 65f7100
Show file tree
Hide file tree
Showing 7 changed files with 414 additions and 39 deletions.
63 changes: 45 additions & 18 deletions AltAnalyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -8477,6 +8477,19 @@ def write(self, message):
self.log.close()

def flush(self): pass

class SysLogger(object):
def __init__(self,null):
self.terminal = sys.stdout
self.log = open(sys_log_file, "w")

def write(self, message):
self.terminal.write(message)
self.log = open(sys_log_file, "a")
self.log.write(message)
self.log.close()

def flush(self): pass

def verifyPath(filename):
### See if the file is in the current working directory
Expand Down Expand Up @@ -8579,31 +8592,51 @@ def unpackConfigFiles():
zip_ref.extractall(userdir+"/altanalyze")
print '...written'

def systemLog():
global sys_log_file
sys_log_file = filepath('Config/report.log')
sys_report = open(sys_log_file,'w'); sys_report.close()
sys.stdout = SysLogger('')

def versionCheck():
import platform
if platform.system()=='Darwin':
if platform.mac_ver()[0] == '10.14.6':
print 'CRITICAL ERROR. AltAanlyze has a critical incompatibility with this specific OS version.'
url = 'http://www.altanalyze.org/MacOS-critical-error.html'
try: webbrowser.open(url)
except Exception: pass
sys.exit()

if __name__ == '__main__':
try: mlp.freeze_support()
except Exception: pass


systemLog()
sys_log_file = filepath('Config/report.log')
print 'Using the Config location:',sys_log_file

versionCheck()

try: unpackConfigFiles()
except: pass
#testResultsPanel()
skip_intro = 'yes'; #sys.exit()
#skip_intro = 'remoteViewer'
dependencyCheck()
runCommandLineVersion()

if use_Tkinter == 'yes': AltAnalyzeSetup(skip_intro)
try:
runCommandLineVersion()

if use_Tkinter == 'yes':
AltAnalyzeSetup(skip_intro)
except:
print traceback.format_exc()
pass

""" To do list:
1) RNA-Seq and LineageProfiler: threshold based RPKM expression filtering for binary absent present gene and exon calls
3) SQLite for gene-set databases prior to clustering and network visualization
5) (explored - not good) Optional algorithm type of PCA
7) (partially) Integrate splicing factor enrichment analysis (separate module?)
11) Update fields in summary combined alt.exon files (key by probeset)
12) Check field names for junction, exon, RNA-Seq in summary alt.exon report
14) Proper FDR p-value for alt.exon analyses (include all computed p-values)
15) Add all major clustering and LineageProfiler options to UI along with stats filtering by default
17) Support R check (and response that they need it) along with GUI gcrma, agilent array, hopach, combat
18) Probe-level annotations from Ensembl (partial code in place) and probe-level RMA in R (or possibly APT) - google pgf for U133 array
19) Update the software from the software

Advantages of this tool kit:
Expand All @@ -8620,11 +8653,5 @@ def unpackConfigFiles():
1) MySQL or equivalent transition for all large database queries (e.g., HuEx 2.1 on-the-fly coordinate mapping).
3) Isoform-domain network visualization and WP overlays.
4) Webservice calls to in silico protein translation, domain prediction, splicing factor regulation.

### 2.0.9
moncole integration
generic and cell classification machine learning
PCR primer design (gene centric after file selection)
BAM->BED (local SAMTools)
updated APT

"""
4 changes: 2 additions & 2 deletions Config/default-files.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"exon_seq","","HuEx-1_0-st-v2.hg16.probeset.fa","Hs"
"exon_seq","","MoEx-1_0-st-v1.mm5.probeset.fa","Mm"
"exon_seq","","RaEx-1_0-st-v1.rn3.probeset.fa","Rn"
"PathDir","local","/Users/saljh8/Dropbox/Collaborations/Hupert/10X-Huppert-JB-20190425-3v3mm/cellHarmony/DifferentialExpression_Fold_1.5_rawp_0.05","all"
"PathDir","local","/Users/saljh8/Downloads","all"
"temp","temp","ftp://ftp.geneontology.org/pub/go/ontology-archive/function.ontology.2008-08-01.gz","all"
"Program/Download","Status","Location","Species"
"url","url","http://altanalyze.org/archiveDBs/","all"
"PathFile","local","/Users/saljh8/Documents/1-manuscripts/David/R412X/completed/cellHarmony/reference","all"
"PathFile","local","/Users/saljh8/Documents/1-manuscripts/David/R412X/completed/cellHarmony/query/R412X-het/cellHarmony/OtherFiles","all"
"TrEMBL","ftp","ftp://ftp.expasy.org/databases/uniprot/current_release/knowledgebase/taxonomic_divisions/uniprot_trembl_human.dat.gz","Hs"
"TrEMBL","ftp","ftp://ftp.expasy.org/databases/uniprot/current_release/knowledgebase/taxonomic_divisions/uniprot_trembl_rodents.dat.gz","Mm|Rn"
"APT","local","AltDatabase/affymetrix/APT","all"
Expand Down
2 changes: 1 addition & 1 deletion Config/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
EnsMart72 11/23/2019
EnsMart72 11/25/2019
13 changes: 10 additions & 3 deletions UI.py
Original file line number Diff line number Diff line change
Expand Up @@ -2544,8 +2544,11 @@ def runPredictGroupsTest():
button_instance = Button(self._parent, text='Kallisto License', command=self.openPDFHelp)
button_instance.pack(side = 'left', padx = 5, pady = 5)

self._parent.protocol("WM_DELETE_WINDOW", self.deleteWindow)
self._parent.mainloop()
try:
self._parent.protocol("WM_DELETE_WINDOW", self.deleteWindow)
self._parent.mainloop()
except:
pass

def verifyExpressionFile(self):
continue_analysis = False ### See if the input file is already present
Expand Down Expand Up @@ -4023,7 +4026,8 @@ def __init__(self,message,button_text):
Label(parent, text='\n'+self.message+'\n'+nulls).pack()
quit_button = Button(parent, text='Quit', command=self.quit); quit_button.pack(side = 'bottom', padx = 5, pady = 5)
text_button = Button(parent, text=self.button_text, command=parent.destroy); text_button.pack(side = 'bottom', padx = 5, pady = 5)
parent.mainloop()
try: parent.mainloop()
except: pass
def quit(self):
try: self._parent.quit(); self._parent.destroy(); sys.exit()
except Exception: self._parent.quit(); sys.exit()
Expand Down Expand Up @@ -5553,6 +5557,8 @@ def rebootAltAnalyzeGUI(selected_parameters,user_variables):
IndicatorWindow(print_out,'Continue')

if additional_analyses == 'Hierarchical Clustering':
print 'Hierarchical Clustering'

selected_parameters.append('Hierarchical Clustering')

supported_geneset_types = getSupportedGeneSetTypes(species,'gene-mapp')
Expand Down Expand Up @@ -5648,6 +5654,7 @@ def rebootAltAnalyzeGUI(selected_parameters,user_variables):
IndicatorWindow(print_out,'Continue')

if additional_analyses == 'Dimensionality Reduction':
print 'Performing Dimensionality Reduction'
selected_parameters.append('Dimensionality Reduction')
status = 'repeat'
while status == 'repeat':
Expand Down
13 changes: 3 additions & 10 deletions import_scripts/mergeFiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,15 @@ def cleanUpLine(line):
return data

def combineAllLists(files_to_merge,original_filename,includeColumns=False):
headers =[]; all_keys={}; dataset_data={}; files=[]; unique_filenames=[]
count=0
headers =[]; all_keys={}; dataset_data={}; files=[]
for filename in files_to_merge:
print filename
duplicates=[]
count+=1
fn=filepath(filename); x=0; combined_data ={}
fn=filepath(filename); x=0; combined_data ={}; files.append(filename)
if '/' in filename:
file = string.split(filename,'/')[-1][:-4]
else:
file = string.split(filename,'\\')[-1][:-4]
### If two files with the same name being merged
if file in unique_filenames:
file += str(count)
unique_filenames.append(file)
print file
files.append(filename)
for line in open(fn,'rU').xreadlines():
data = cleanUpLine(line)
t = string.split(data,'\t')
Expand Down
Loading

0 comments on commit 65f7100

Please sign in to comment.