Exemplo n.º 1
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)
Exemplo n.º 2
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)
Exemplo n.º 3
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)
Exemplo n.º 4
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)
Exemplo n.º 5
0
def from_soft_file(gene_signature):
    """Performs hierarchical clustering on SOFT file.
    """
    target_app_link = __get_clustergrammer_link(gene_signature)

    # Only create the link from Clustergrammer once.
    # TODO: Move into targetapp module. API should not know about this.
    if not target_app_link:
        link = __from_soft_file(gene_signature)
        link = '{0}?preview=true'.format(link)
        target_app = database.get_or_create(TargetApp, name='clustergrammer')
        target_app_link = TargetAppLink(target_app, link)
        gene_signature.gene_lists[2].target_app_links.append(target_app_link)
        database.save_gene_signature(gene_signature)

    return target_app_link.link