Beispiel #1
0
def suggest(request):
    """
    Suggest gene names based on the input text
    """
    # suggestions are taken from a gene annotations tileset
    tileset_uuid = request.GET["d"]
    text = request.GET["ac"]

    try:
        tileset = tm.Tileset.objects.get(uuid=tileset_uuid)
    except ObjectDoesNotExist:
        raise rfe.NotFound("Suggestion source file not found")

    result_dict = tsu.get_gene_suggestions(tileset.datafile.path, text)

    return JsonResponse(result_dict, safe=False)
Beispiel #2
0
def suggest(request):
    '''
    Suggest gene names based on the input text
    '''
    # suggestions are taken from a gene annotations tileset
    tileset_uuid = request.GET['d']
    text = request.GET['ac']

    try:
        tileset = tm.Tileset.objects.get(uuid=tileset_uuid)
    except:
        raise rfe.NotFound('Suggestion source file not found')

    result_dict = tsu.get_gene_suggestions(
        get_datapath(tileset.datafile), text
    )

    return JsonResponse(result_dict, safe=False)