コード例 #1
0
ファイル: exac.py プロジェクト: porter2006/exac_browser
def text_page():
    db = get_db()
    query = request.args.get("text")
    datatype, identifier = lookups.get_awesomebar_result(db, query)
    if datatype in ["gene", "transcript"]:
        gene = lookups.get_gene(db, identifier)
        link = "http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&position=chr%(chrom)s%%3A%(start)s-%(stop)s" % gene
        output = """Searched for %s. Found %s.
%s; Canonical: %s.
%s""" % (
            query,
            identifier,
            gene["full_gene_name"],
            gene["canonical_transcript"],
            link,
        )
        output += (
            ""
            if "omim_accession" not in gene
            else """
In OMIM: %(omim_description)s
http://omim.org/entry/%(omim_accession)s"""
            % gene
        )
        return output
    elif datatype == "error" or datatype == "not_found":
        return "Gene/transcript %s not found" % query
    else:
        return "Search types other than gene transcript not yet supported"
コード例 #2
0
def awesome():
    db = get_db()
    query = request.args.get('query')
    if query is None:
        return redirect(url_for('.homepage'))
    datatype, redirect_args = lookups.get_awesomebar_result(db, query)
    _log('  =>  {}_page({})'.format(datatype, redirect_args))
    return redirect(url_for('.{}_page'.format(datatype), **redirect_args))
コード例 #3
0
def awesome():
    db = get_db()
    query = request.args.get('query')
    datatype, identifier = lookups.get_awesomebar_result(db, query)

    print "Searched for %s: %s" % (datatype, identifier)
    if datatype == 'gene':
        print "\nGO TO GNEN\n"
        return redirect('/gene/{}'.format(identifier))
    elif datatype == 'variant':
        return redirect('/variant/{}'.format(identifier))
    else:
        raise Exception
コード例 #4
0
ファイル: exac.py プロジェクト: ColorGenomics/exac_browser
def text_page():
    db = get_db()
    query = request.args.get('text')
    datatype, identifier = lookups.get_awesomebar_result(db, query)
    if datatype in ['gene', 'transcript']:
        gene = lookups.get_gene(db, identifier)
        link = "http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&position=chr%(chrom)s%%3A%(start)s-%(stop)s" % gene
        output = '''Searched for %s. Found %s.
%s; Canonical: %s.
%s''' % (query, identifier, gene['full_gene_name'], gene['canonical_transcript'], link)
        output += '' if 'omim_accession' not in gene else '''
In OMIM: %(omim_description)s
http://omim.org/entry/%(omim_accession)s''' % gene
        return output
    elif datatype == 'error' or datatype == 'not_found':
        return "Gene/transcript %s not found" % query
    else:
        return "Search types other than gene transcript not yet supported"
コード例 #5
0
ファイル: exac.py プロジェクト: mattsolo1/gnomad_browser
def text_page():
    db = get_db()
    query = request.args.get('text')
    datatype, identifier = lookups.get_awesomebar_result(db, query)
    if datatype in ['gene', 'transcript']:
        gene = lookups.get_gene(db, identifier)
        link = "http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&position=chr%(chrom)s%%3A%(start)s-%(stop)s" % gene
        output = '''Searched for %s. Found %s.
%s; Canonical: %s.
%s''' % (query, identifier, gene['full_gene_name'], gene['canonical_transcript'], link)
        output += '' if 'omim_accession' not in gene else '''
In OMIM: %(omim_description)s
http://omim.org/entry/%(omim_accession)s''' % gene
        return output
    elif datatype == 'error' or datatype == 'not_found':
        return "Gene/transcript %s not found" % query
    else:
        return "Search types other than gene transcript not yet supported"
コード例 #6
0
ファイル: exac.py プロジェクト: ColorGenomics/exac_browser
def awesome():
    db = get_db()
    query = request.args.get('query')
    datatype, identifier = lookups.get_awesomebar_result(db, query)

    print "Searched for %s: %s" % (datatype, identifier)
    if datatype == 'gene':
        return redirect('/gene/{}'.format(identifier))
    elif datatype == 'transcript':
        return redirect('/transcript/{}'.format(identifier))
    elif datatype == 'variant':
        return redirect('/variant/{}'.format(identifier))
    elif datatype == 'region':
        return redirect('/region/{}'.format(identifier))
    elif datatype == 'dbsnp_variant_set':
        return redirect('/dbsnp/{}'.format(identifier))
    elif datatype == 'error':
        return redirect('/error/{}'.format(identifier))
    elif datatype == 'not_found':
        return redirect('/not_found/{}'.format(identifier))
    else:
        raise Exception
コード例 #7
0
ファイル: exac.py プロジェクト: porter2006/exac_browser
def awesome():
    db = get_db()
    query = request.args.get("query")
    datatype, identifier = lookups.get_awesomebar_result(db, query)

    print "Searched for %s: %s" % (datatype, identifier)
    if datatype == "gene":
        return redirect("/gene/{}".format(identifier))
    elif datatype == "transcript":
        return redirect("/transcript/{}".format(identifier))
    elif datatype == "variant":
        return redirect("/variant/{}".format(identifier))
    elif datatype == "region":
        return redirect("/region/{}".format(identifier))
    elif datatype == "dbsnp_variant_set":
        return redirect("/dbsnp/{}".format(identifier))
    elif datatype == "error":
        return redirect("/error/{}".format(identifier))
    elif datatype == "not_found":
        return redirect("/not_found/{}".format(identifier))
    else:
        raise Exception
コード例 #8
0
def awesome():
    db = get_db()
    query = request.args.get('query')
    datatype, identifier = lookups.get_awesomebar_result(db, query)

    print "Searched for %s: %s" % (datatype, identifier)
    if datatype == 'gene':
        return redirect('/gene/{}'.format(identifier))
    elif datatype == 'transcript':
        return redirect('/transcript/{}'.format(identifier))
    elif datatype == 'variant':
        return redirect('/variant/{}'.format(identifier))
    elif datatype == 'region':
        return redirect('/region/{}'.format(identifier))
    elif datatype == 'dbsnp_variant_set':
        return redirect('/dbsnp/{}'.format(identifier))
    elif datatype == 'error':
        return redirect('/error/{}'.format(identifier))
    elif datatype == 'not_found':
        return redirect('/not_found/{}'.format(identifier))
    else:
        raise Exception