tmpdir_mutants = tempfile.mkdtemp("dictymutants") base_mutants = DictyMutants.download_mutants() file_mutants = os.path.join(tmpdir_mutants, "tempMut") fm = open(file_mutants, "wb") fm.write(base_mutants) fm.close() fm_dom = DictyMutants.domain fm_name = DictyMutants.pickle_file print file_mutants sf_server.upload(fm_dom, fm_name, file_mutants, title="dictyBase mutant phenotypes", tags=DictyMutants.tags) sf_server.unprotect(fm_dom, fm_name) shutil.rmtree(tmpdir_mutants) """ Orange server upload for Dicty mutant gene sets """ from orangecontrib.bio.geneset import dictyMutantSets, update_server_list, register mutant_sets_split = dictyMutantSets().split_by_hierarchy() for mutant_sets in mutant_sets_split: register(mutant_sets, sf_server)
import os, sys path = os.path.join(environ.buffer_dir, "tmp_OMIM") try: os.mkdir(path) except OSError: pass filename = os.path.join(path, "morbidmap") obiOMIM.OMIM.download_from_NCBI(filename) sf_server.upload("OMIM", "morbidmap", filename, title="Online Mendelian Inheritance in Man (OMIM)", tags=[ "genes", "diseases", "human", "OMIM" "#version:%i" % obiOMIM.OMIM.VERSION ]) sf_server.unprotect("OMIM", "morbidmap") """ Orange server upload for OMIM morbidmap gene sets """ from orangecontrib.bio.geneset import omimGeneSets, register omim_sets_split = omimGeneSets().split_by_hierarchy() for omim_sets in omim_sets_split: register(omim_sets, sf_server)
##[email protected] from common import * from orangecontrib.bio import obiOMIM import os, sys path = os.path.join(environ.buffer_dir, "tmp_OMIM") try: os.mkdir(path) except OSError: pass filename = os.path.join(path, "morbidmap") obiOMIM.OMIM.download_from_NCBI(filename) sf_server.upload("OMIM", "morbidmap", filename, title="Online Mendelian Inheritance in Man (OMIM)", tags=["genes", "diseases", "human", "OMIM" "#version:%i" % obiOMIM.OMIM.VERSION]) sf_server.unprotect("OMIM", "morbidmap") """ Orange server upload for OMIM morbidmap gene sets """ from orangecontrib.bio.geneset import omimGeneSets, register omim_sets_split = omimGeneSets().split_by_hierarchy() for omim_sets in omim_sets_split: register(omim_sets, sf_server)
##interval:7 from common import * """ Orange server upload for Cytoband gene sets """ from orangecontrib.bio.geneset import reactomePathwaysGeneSets, register reactome_sets_split = reactomePathwaysGeneSets().split_by_hierarchy() for pathway_sets in reactome_sets_split: register(pathway_sets, sf_server)
for exp in result["expressions"]: diff_exp = [ e for e in exp["experiments"] if e["pvalue"] <= max_pvalue ] # Use only genes that are significantly diff. expressed if diff_exp: try: sets[exp["ef"], exp["efv"]].append( result["gene"]["name"] ) # The Gene Expression Atlas entries are not consistent. except: sets[exp["efoTerm"], exp["efoId"]].append(result["gene"]["name"]) print time.time() - start gene_sets = [] for (ef, efv), genes in sets.items(): ef_display = display_string(ef) gs = GeneSet(genes, "Diff. expressed in %s=%s." % (ef_display, efv), id=ef + ":" + efv, description="Diff. expressed in %s=%s." % (ef_display, efv), link="http://www.ebi.ac.uk/gxa/qrs?specie_0={organism}&gprop_0=&gnot_0=&gval_0=&fact_1=&fexp_1=UPDOWN&fmex_1=&fval_1=%22{efv}%22+&view=hm".format( \ organism = "+".join(organism.lower().split()), efv = "+".join(efv.lower().split())), organism=org_code, hierarchy=("Gene Expression Atlas", display_string(condition))) gene_sets.append(gs) final_set = GeneSets(gene_sets) set_split = final_set.split_by_hierarchy() for s in set_split: register(s, sf_server) print "Gene sets successfully registered..."
##interval:7 from common import * """ Orange server upload for Cytoband gene sets """ from orangecontrib.bio.geneset import cytobandGeneSets, register cytoband_sets_split = cytobandGeneSets().split_by_hierarchy() for band_sets in cytoband_sets_split: register(band_sets, sf_server)
start = time.time() query = run_simple_query(regulation=regulation, organism=organism, condition=condition, start=start*no_of_genes, rows=no_of_genes) for result in query["results"]: i += 1 print result["gene"]["name"] + "\t" + str(i) # For printing out gene names and the current number of genes during debugging for exp in result["expressions"]: diff_exp = [e for e in exp["experiments"] if e["pvalue"] <= max_pvalue] # Use only genes that are significantly diff. expressed if diff_exp: try: sets[exp["ef"], exp["efv"]].append(result["gene"]["name"]) # The Gene Expression Atlas entries are not consistent. except: sets[exp["efoTerm"], exp["efoId"]].append(result["gene"]["name"]) print time.time() - start gene_sets = [] for (ef, efv), genes in sets.items(): ef_display = display_string(ef) gs = GeneSet(genes, "Diff. expressed in %s=%s." % (ef_display, efv), id=ef + ":" + efv, description="Diff. expressed in %s=%s." % (ef_display, efv), link="http://www.ebi.ac.uk/gxa/qrs?specie_0={organism}&gprop_0=&gnot_0=&gval_0=&fact_1=&fexp_1=UPDOWN&fmex_1=&fval_1=%22{efv}%22+&view=hm".format( \ organism = "+".join(organism.lower().split()), efv = "+".join(efv.lower().split())), organism=org_code, hierarchy=("Gene Expression Atlas", display_string(condition))) gene_sets.append(gs) final_set = GeneSets(gene_sets) set_split = final_set.split_by_hierarchy() for s in set_split: register(s, sf_server) print "Gene sets successfully registered..."
Orange server upload for DictyMutants """ tmpdir_mutants = tempfile.mkdtemp("dictymutants") base_mutants = DictyMutants.download_mutants() file_mutants = os.path.join(tmpdir_mutants, "tempMut") fm = open(file_mutants, "wb") fm.write(base_mutants) fm.close() fm_dom = DictyMutants.domain fm_name = DictyMutants.pickle_file print file_mutants sf_server.upload(fm_dom, fm_name, file_mutants, title="dictyBase mutant phenotypes", tags=DictyMutants.tags) sf_server.unprotect(fm_dom, fm_name) shutil.rmtree(tmpdir_mutants) """ Orange server upload for Dicty mutant gene sets """ from orangecontrib.bio.geneset import dictyMutantSets, update_server_list, register mutant_sets_split = dictyMutantSets().split_by_hierarchy() for mutant_sets in mutant_sets_split: register(mutant_sets, sf_server)