Skip to content

Commit

Permalink
11/23/2019
Browse files Browse the repository at this point in the history
  • Loading branch information
nsalomonis committed Nov 24, 2019
1 parent 965409a commit fdeeb77
Show file tree
Hide file tree
Showing 16 changed files with 7,881 additions and 1,048 deletions.
15 changes: 11 additions & 4 deletions AltAnalyze.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###AltAnalyze
#Copyright 2005-20019
#Copyright 2005-2008 J. David Gladstone Institutes, San Francisco California
#Author Nathan Salomonis - [email protected]

#Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -5266,16 +5266,19 @@ def AltAnalyzeMain(expr_var,alt_var,goelite_var,additional_var,exp_file_location
if use_direct_domain_alignments_only == 'direct-alignment': use_direct_domain_alignments_only = 'yes'
if run_from_scratch == 'Process CEL files': expression_data_format = 'log'
print "Beginning AltAnalyze Analysis... Format:", expression_data_format


if array_type == 'RNASeq': id_name = 'exon/junction IDs'
else: id_name = 'array IDs'

print_items=[]; #print [permute_p_threshold]; sys.exit()
if 'array' in array_type:
dataType='Gene Expression'
else:
dataType=array_type
print_items.append("AltAnalyze version 2.1.3 - Expression Analysis Parameters Being Used...")
print_items.append('\t'+'database'+': '+unique.getCurrentGeneDatabaseVersion())
print_items.append('\t'+'species'+': '+species)
print_items.append('\t'+'method'+': '+array_type)
print_items.append('\t'+'method'+': '+dataType)
print_items.append('\t'+'manufacturer'+': '+manufacturer)
print_items.append('\t'+'probability_statistic'+': '+probability_statistic)
print_items.append('\t'+'constitutive_source'+': '+constitutive_source)
Expand Down Expand Up @@ -6985,6 +6988,7 @@ def commandLineRun():
colorByGene=None
separateGenePlots = False
reimportModelScores = True
maskGroups = None
if 't-SNE' in image_export:
pca_algorithm = 't-SNE'
if 'UMAP' in image_export or 'umap' in image_export:
Expand All @@ -7001,6 +7005,7 @@ def commandLineRun():
if opt == '--algorithm': pca_algorithm=arg
if opt == '--geneSetName': geneSetName=arg
if opt == '--genes': colorByGene=arg
if opt == '--maskGroups': maskGroups=arg
if opt == '--reimportModelScores':
if arg == 'yes' or arg == 'True' or arg == 'true':
reimportModelScores = True
Expand All @@ -7023,7 +7028,9 @@ def commandLineRun():
if input_file_dir==None:
print 'Please provide a valid file location for your input data matrix (must have an annotation row and an annotation column)';sys.exit()
UI.performPCA(input_file_dir, include_labels, pca_algorithm, transpose, None,
plotType=plotType, display=display, geneSetName=geneSetName, species=species, zscore=zscore, colorByGene=colorByGene, reimportModelScores=reimportModelScores, separateGenePlots=separateGenePlots)
plotType=plotType, display=display, geneSetName=geneSetName, species=species, zscore=zscore,
colorByGene=colorByGene, reimportModelScores=reimportModelScores, separateGenePlots=separateGenePlots,
maskGroups=maskGroups)
sys.exit()

if 'VennDiagram' in image_export:
Expand Down
2 changes: 1 addition & 1 deletion Config/source_data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ DEDb De
OTT Ot
Symbol Sy
KEGG_Enzyme KEG
AltExon Ae
AltExon Ae MOD
4 changes: 1 addition & 3 deletions ExpressionBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,6 @@ def simpleGroupImport(group_dir,splitHeaders=False, ignoreComps=False, reverseOr
data = cleanUpLine(line)
try: sample_filename,group_number,group_name = string.split(data,'\t')
except Exception:
print group_dir
print data
print traceback.format_exc()
print "\nWARNING!!! Impropper groups file format detected. Terminating AltAnalyze. The groups file must have only three columns (sampleName, groupNumber, groupName).\n"
forceGroupsError
Expand Down Expand Up @@ -4112,7 +4110,7 @@ def convertPSIJunctionIDsToPositions(psi_file,regulated_file):
try: genesToExclude = excludeGenesImport(excludeGenes)
except Exception: genesToExclude = {}
print analysis
if array_type == 'RNASeq':
if array_type == 'RNASeq':
gene_exp_threshold = 50
gene_rpkm_threshold = 3
if analysis == 'matchAndCorrelate':
Expand Down
11 changes: 7 additions & 4 deletions GO_Elite.py
Original file line number Diff line number Diff line change
Expand Up @@ -2110,7 +2110,7 @@ def returnDirectoriesNoReplace(dir):
dir_list = unique.returnDirectoriesNoReplace(dir); dir_list2 = []
for entry in dir_list:
if '.' not in entry: dir_list2.append(entry)
return dir_list2
return dir_list2

###### Command Line Functions (AKA Headless Mode) ######
def commandLineRun():
Expand Down Expand Up @@ -2243,7 +2243,7 @@ def commandLineRun():

if len(resources)>1: resources_to_analyze = resources
elif len(resources)>0: resources_to_analyze = resources[0]

species_full_original = species_full; species_code_original = species_code
if image_export != None:
if image_export == 'WikiPathways':
Expand Down Expand Up @@ -2753,8 +2753,11 @@ def commandLineRun():
try:
import UI
species_dirs = UI.returnDirectoriesNoReplace('/Databases')
except Exception:
print '\nPlease install a species database (to install: python GO_Elite.py --update Official --species Hs --version EnsMart62Plus)';sys.exit()
except:
try:
species_dirs = UI.returnDirectoriesNoReplace('/AltDatabase')
except Exception:
print '\nPlease install a species database (to install: python GO_Elite.py --update Official --species Hs --version EnsMart62Plus)';sys.exit()

print ''
root = parent; runGOElite(mod)
Expand Down
6 changes: 4 additions & 2 deletions InteractionBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def importInteractionDatabases(interactionDirs):
except Exception: None
except Exception:
proceed = False

if proceed: ### If the interaction data conformed to one of the two above types (typically two valid interacting gene IDs)
if (len(ens_ls1)>0 and len(ens_ls2)>0):
secondary_proceed = True
Expand Down Expand Up @@ -218,7 +219,7 @@ def importInteractionDatabases(interactionDirs):
### Evaluate the most promiscous interactors (e.g., UBC)
remove_list=[]
for ID in interaction_db:
if len(interaction_db[ID])>2000:
if len(interaction_db[ID])>20000:
remove_list.append(ID)
#print len(interaction_db[ID]),ensembl_symbol_db[ID]
for ID in remove_list:
Expand Down Expand Up @@ -364,7 +365,8 @@ def associateQueryGenesWithInteractions(query_db,query_interactions,dir_file):
connections = 1
primary=0
secondary=0
terciary=0
terciary=0

for ensemblGene in query_db:
if ensemblGene in interaction_db:
for interacting_ensembl in interaction_db[ensemblGene]:
Expand Down
Loading

0 comments on commit fdeeb77

Please sign in to comment.