예제 #1
0
def ensure_downloaded(callback=None, verbose=True):
    """
    Retrieve the taxonomy database if not already downloaded.
    """
    serverfiles.localpath_download(
        Taxonomy.DOMAIN, Taxonomy.FILENAME,
        callback=callback, verbose=verbose)
def ensure_downloaded(callback=None, verbose=True):
    """
    Retrieve the taxonomy database if not already downloaded.
    """
    serverfiles.localpath_download(Taxonomy.DOMAIN,
                                   Taxonomy.FILENAME,
                                   callback=callback,
                                   verbose=verbose)
예제 #3
0
def fetch_ncbi_geneinfo(taxid, progress=None):
    taxid = gene.NCBIGeneInfo.TAX_MAP.get(taxid, taxid)
    sf.localpath_download(
        "NCBI_geneinfo",
        "gene_info.{taxid}.db".format(taxid=taxid),
        callback=progress,
        verbose=True,
    )
    return gene.NCBIGeneInfo(taxid)
예제 #4
0
def fetch_ppidb(ppisource, taxid, progress=None):
    fname = ppisource.sf_filename

    if "{taxid}" in fname:
        if taxid in ppisource.tax_mapping:
            taxid_m = ppisource.tax_mapping[taxid]
            if taxid_m is None:
                raise ValueError(taxid)
            taxid = taxid_m
        fname = fname.format(taxid=taxid)
        constructor = lambda: ppisource.constructor(taxid)
    else:
        constructor = ppisource.constructor

    sf.localpath_download(ppisource.sf_domain,
                          fname,
                          callback=progress,
                          verbose=True)
    return constructor()
예제 #5
0
def load_miRNA_microCosm(org="mus_musculus", max_pvalue=None, min_score=None):
    """ Load miRNA's from microcosm into the global scope (currently
    only Mus musculus is supported)
    
    """
    global IDs, LABELS, miRNA_lib, mat_toPre, ACCtoID
    global preIDs, premiRNA_lib, preACCtoID, clusters
    global num_toClusters,  clusters_toNum
    
    file = osf.localpath_download("miRNA", "v5.txt.{org}".format(org=org))
    [IDs, LABELS, miRNA_lib, mat_toPre, ACCtoID] = parse_targets_microcosm_v5(file,
                                max_pvalue=max_pvalue, min_score=min_score)
    [preIDs, premiRNA_lib, preACCtoID, clusters] = [], {}, {}, {}
    num_toClusters, clusters_toNum = {}, {}
예제 #6
0
def load_miRNA_microCosm(org="mus_musculus", max_pvalue=None, min_score=None):
    """ Load miRNA's from microcosm into the global scope (currently
    only Mus musculus is supported)
    
    """
    global IDs, LABELS, miRNA_lib, mat_toPre, ACCtoID
    global preIDs, premiRNA_lib, preACCtoID, clusters
    global num_toClusters, clusters_toNum

    file = osf.localpath_download("miRNA", "v5.txt.{org}".format(org=org))
    [IDs, LABELS, miRNA_lib, mat_toPre,
     ACCtoID] = parse_targets_microcosm_v5(file,
                                           max_pvalue=max_pvalue,
                                           min_score=min_score)
    [preIDs, premiRNA_lib, preACCtoID, clusters] = [], {}, {}, {}
    num_toClusters, clusters_toNum = {}, {}
예제 #7
0
def ensure_downloaded(domain, filename, advance=None):
    serverfiles.localpath_download(domain, filename, callback=advance)
예제 #8
0
def ensure_downloaded(domain, filename, advance=None):
    serverfiles.localpath_download(domain, filename, callback=advance)
예제 #9
0
from __future__ import absolute_import, division

from collections import defaultdict
import math, os, random, re, urllib
import functools
import numpy as np

from orangecontrib.bio.utils import serverfiles as osf
#import statc

from . import gene as ge, go, kegg as kg, utils, taxonomy as obiTaxonomy

op = utils.stats

mirnafile = osf.localpath_download('miRNA','miRNA.txt')
premirnafile = osf.localpath_download('miRNA','premiRNA.txt')

################################################################################################################
################################################################################################################

def __build_lib(filename, labels=True, MATtoPRE=True, ACCtoID=True, clust=False):
    """
    build_lib() function takes as input a filename
    and gives as output some variables there will be used in
    the module.
    """
    content = [l.rstrip() for l in open(filename).readlines()][1:]
    to_return = []
    
    ids = [l.split('\t')[0] for l in content]
    to_return.append(ids)
예제 #10
0
 def __init__(self):
     from .ncbi.taxonomy import Taxonomy
     # Ensure the taxonomy db is downloaded.
     filename = serverfiles.localpath_download(self.DOMAIN, self.FILENAME)
     self._tax = Taxonomy(filename)
 def __init__(self):
     from .ncbi.taxonomy import Taxonomy
     # Ensure the taxonomy db is downloaded.
     filename = serverfiles.localpath_download(self.DOMAIN, self.FILENAME)
     self._tax = Taxonomy(filename)
예제 #12
0
from __future__ import absolute_import, division

from collections import defaultdict
import math, os, random, re, urllib
import functools
import numpy as np

from orangecontrib.bio.utils import serverfiles as osf
#import statc

from . import gene as ge, go, kegg as kg, utils, taxonomy as obiTaxonomy

op = utils.stats

mirnafile = osf.localpath_download('miRNA', 'miRNA.txt')
premirnafile = osf.localpath_download('miRNA', 'premiRNA.txt')

################################################################################################################
################################################################################################################


def __build_lib(filename,
                labels=True,
                MATtoPRE=True,
                ACCtoID=True,
                clust=False):
    """
    build_lib() function takes as input a filename
    and gives as output some variables there will be used in
    the module.
    """
예제 #13
0
def ensure_downloaded(callback=None, verbose=True):
    """
    Retrieve the taxonomy database if not already downloaded.
    """
    serverfiles.localpath_download("Taxonomy", "ncbi_taxonomy.tar.gz",
                                   callback=callback, verbose=verbose)
예제 #14
0
 def Load(self):
     path = serverfiles.localpath_download("Taxonomy", "ncbi_taxonomy.tar.gz")
     self._text = TextDB(os.path.join(path, "ncbi_taxonomy.db"))
     self._info = TextDB(os.path.join(path, "ncbi_taxonomy_inf.db"))