Commits

Flashpoint committed e6ed6e7

Added Phenotypes to DictyMutants hierarchy

Comments (0)

Files changed (2)

_bioinformatics/obiGeneSets.py

     """
     from . import obiDictyMutants
     link_fmt = "http://dictybase.org/db/cgi-bin/dictyBase/SC/scsearch.pl?searchdb=strains&search_term=%s&column=all&B1=Submit" 
-    #genesets = [GeneSet(id=mutant.name, name=mutant.descriptor, genes=obiDictyMutants.mutant_genes(mutant), hierarchy=("Dictybase", ), organism="352472", # 352472 gathered from obiGO.py code_map -> Dicty identifier
+    #genesets = [GeneSet(id=mutant.name, name=mutant.descriptor, genes=obiDictyMutants.mutant_genes(mutant), hierarchy=("Dictybase", "Mutants"), organism="352472", # 352472 gathered from obiGO.py code_map -> Dicty identifier
     #                    link=(link_fmt % mutant.name if mutant.name else None)) \
     #                    for mutant in obiDictyMutants.mutants()]
  
-    genesets = [GeneSet(id=phenotype, name=phenotype, genes=[obiDictyMutants.mutant_genes(mutant)[0] for mutant in mutants], hierarchy=("Dictybase", ), organism="352472", # 352472 gathered from obiGO.py code_map -> Dicty identifier
+    genesets = [GeneSet(id=phenotype, name=phenotype, genes=[obiDictyMutants.mutant_genes(mutant)[0] for mutant in mutants], hierarchy=("Dictybase", "Phenotypes"), organism="352472", # 352472 gathered from obiGO.py code_map -> Dicty identifier
                         link="") \
                         for phenotype, mutants in obiDictyMutants.phenotype_mutants().items()]
 

server_update/updateDictyBase.py

 """
 Orange server upload for Dicty mutant gene sets
 """
-from Orange.bio.obiGeneSets import dictyMutantSets, update_server_list
-import cPickle as pickle
+from Orange.bio.obiGeneSets import dictyMutantSets, update_server_list, register
 
-mutant_sets = dictyMutantSets()
+mutant_sets_split = dictyMutantSets().split_by_hierarchy()
+for mutant_sets in mutant_sets_split:
+    register(mutant_sets, sf_server)
 
-tmpdir_sets = tempfile.mkdtemp("dictygenesets")
-file_mutants = os.path.join(tmpdir_sets, "tempSets")
-
-with open(file_mutants, "wb") as f:
-    pickle.dump(mutant_sets, f, -1)
-
-fm_dom = "gene_sets"
-fm_name = "DictyMutant phenotypes"
-set_tags = ["Mutant", "phenotype", "dicty"]
-
-print file_mutants
-
-sf_server.upload(fm_dom, fm_name, file_mutants, title="Dictyostelium discoideum mutant phenotypes",
-    tags=set_tags)
-sf_server.unprotect(fm_dom, fm_name)
 update_server_list(sf_server)
-
-shutil.rmtree(tmpdir_sets)
-