Ejemplo n.º 1
0
def _get_paea_link(ranked_genes, description):
    """Wrapper for paea module's get_link function.
    """
    paea_genes = _apply_cutoff(ranked_genes, PAEA_CUTOFF)
    link = paea.get_link(paea_genes, description)
    target_app = get_or_create(TargetApp, name='paea')
    return TargetAppLink(target_app, link)
Ejemplo n.º 2
0
def _get_crowdsourcing_link(ranked_genes, optional_metadata, soft_file, tags):
    """Wrapper for crowdsourcing module's get_link function.
    """
    link = crowdsourcing.get_link(ranked_genes, optional_metadata, soft_file,
                                  tags)
    target_app = get_or_create(TargetApp, name='crowdsourcing')
    return TargetAppLink(target_app, link)
Ejemplo n.º 3
0
def _get_paea_link(ranked_genes, description):
    """Wrapper for paea module's get_link function.
    """
    paea_genes = _apply_cutoff(ranked_genes, PAEA_CUTOFF)
    link = paea.get_link(paea_genes, description)
    target_app = get_or_create(TargetApp, name='paea')
    return TargetAppLink(target_app, link)
Ejemplo n.º 4
0
def _get_l1000cds2_link(ranked_genes, required_metadata):
    """Wrapper for l1000cds2 module's get_link function.
    """
    # This is a hard cutoff and is also independent of user selection.
    l1000cds2_genes = _apply_cutoff(ranked_genes, L1000CDS2_CUTOFF)
    link = l1000cds2.get_link(l1000cds2_genes, required_metadata)
    target_app = get_or_create(TargetApp, name='l1000cds2')
    return TargetAppLink(target_app, link)
Ejemplo n.º 5
0
def _get_enrichr_link(ranked_genes, required_metadata, description):
    """Wrapper for enrichr module's get_link function.
    """
    enrichr_cutoff = _get_cutoff(required_metadata)
    enrichr_genes = _apply_cutoff(ranked_genes, enrichr_cutoff)
    link = enrichr.get_link(enrichr_genes, description)
    target_app = get_or_create(TargetApp, name='enrichr')
    return TargetAppLink(target_app, link)
Ejemplo n.º 6
0
def _get_l1000cds2_link(ranked_genes, required_metadata):
    """Wrapper for l1000cds2 module's get_link function.
    """
    # This is a hard cutoff and is also independent of user selection.
    l1000cds2_genes = _apply_cutoff(ranked_genes, L1000CDS2_CUTOFF)
    link = l1000cds2.get_link(l1000cds2_genes, required_metadata)
    target_app = get_or_create(TargetApp, name='l1000cds2')
    return TargetAppLink(target_app, link)
Ejemplo n.º 7
0
def _get_enrichr_link(ranked_genes, required_metadata, description):
    """Wrapper for enrichr module's get_link function.
    """
    enrichr_cutoff = _get_cutoff(required_metadata)
    enrichr_genes = _apply_cutoff(ranked_genes, enrichr_cutoff)
    link = enrichr.get_link(enrichr_genes, description)
    target_app = get_or_create(TargetApp, name='enrichr')
    return TargetAppLink(target_app, link)
Ejemplo n.º 8
0
def from_http_request(args):
    """Returns list of Tag instances.
    """
    tag_names = get_param_as_list(args, 'tags')
    tags = []
    for name in tag_names:
        # If the name is not an empty string or just whitespace.
        if bool(name.strip()):
            tags.append(get_or_create(Tag, name=name))
    return tags
Ejemplo n.º 9
0
def do(a_vals, b_vals, genes, metadata):
    """Delegates to the correct helper function based on client or default
    configuration.
    """
    if metadata.diff_exp_method == 'ttest':
        genes, values = ttest(a_vals, b_vals, genes,
                              metadata.ttest_correction_method,
                              metadata.threshold)
    else:
        genes, values = chdir(a_vals, b_vals, genes)

    # TODO: We should do this *after* the potential cutoff.
    genes = [get_or_create(Gene, name=name) for name in genes]
    ranked_genes = [
        RankedGene(pair[0], pair[1]) for pair in zip(genes, values)
    ]
    return ranked_genes
def do(a_vals, b_vals, genes, metadata):
    """Delegates to the correct helper function based on client or default
    configuration.
    """
    if metadata.diff_exp_method == 'ttest':
        genes, values = ttest(
            a_vals, b_vals, genes,
            metadata.ttest_correction_method,
            metadata.threshold
        )
    else:
        genes, values = chdir(a_vals, b_vals, genes)

    # TODO: We should do this *after* the potential cutoff.
    genes = [get_or_create(Gene, name=name) for name in genes]
    ranked_genes = [RankedGene(pair[0], pair[1]) for pair in zip(genes, values)]
    return ranked_genes
Ejemplo n.º 11
0
def _get_crowdsourcing_link(ranked_genes, optional_metadata, soft_file, tags):
    """Wrapper for crowdsourcing module's get_link function.
    """
    link = crowdsourcing.get_link(ranked_genes, optional_metadata, soft_file, tags)
    target_app = get_or_create(TargetApp, name='crowdsourcing')
    return TargetAppLink(target_app, link)