Exemplo n.º 1
0
def forest_data(request, analysis_id, mygene_sym):
    analysis = Analysis.objects.get(pk=analysis_id)
    if not analysis.fold_changes:
        raise ajax.error('no-fold-changes', help='Try rerunning analysis')

    data = get_gene_analysis(analysis, mygene_sym)
    data['min_samples'] = analysis.min_samples
    return data
Exemplo n.º 2
0
def save_polygons(request):
    try:
        company_id = int(request.POST.get('company_id'))
        polygons_json = request.POST.get('polygons_data')
        polygons = json.loads(polygons_json)
        assert isinstance(polygons, list)
    except (TypeError, ValueError, AssertionError):
        raise ajax.error('wrong_agruments')

    company = Company.objects.get(id=company_id)

    Polygon.objects.filter(company=company).delete()
    for polygon in polygons:
        save_polygon(company, polygon)

    return polygons
Exemplo n.º 3
0
def get_polygons(request):
    try:
        company_id = int(request.GET.get('company_id'))
    except TypeError, ValueError:
        raise ajax.error('wrong_agrument')
Exemplo n.º 4
0
def find_suppliers(request):
    try:
        lat = float(request.GET.get('lat'))
        lng = float(request.GET.get('lng'))
    except TypeError, ValueError:
        raise ajax.error('wrong_agrument')