Exemplo n.º 1
0
def transformations(request, q, transformation=None, format=None):
    """
    Transformation of phenotypes
    ---
    parameters:
        - name: q
          description: the primary id or doi of the phenotype
          required: true
          type: string
          paramType: path
        - name: transformation
          description: the transformation to be calculates (if omitted, all transformations are returned)
          required: false
          type: string
          paramType: path

    produces:
        - text/csv
        - application/json
    """
    doi = _is_doi(DOI_PATTERN_PHENOTYPE, q)
    try:
        id = doi if doi else int(q)
        phenotype = Phenotype.objects.published().get(pk=id)
    except:
        return HttpResponse(status=404)

    if request.method == "GET":
        data = calculate_phenotype_transformations(phenotype, transformation)
        return Response(data)
Exemplo n.º 2
0
def transformation_results(request, pk):
    """
    SHow transformation result
    """
    phenotype = Phenotype.objects.get(id=pk)
    data = calculate_phenotype_transformations(phenotype)
    data['object'] = phenotype
    return render(request, 'phenotypedb/transformation_results.html', data)
Exemplo n.º 3
0
def rnaseq_transformation_results(request, pk):
    """
    SHow transformation result
    """
    rnaseq = RNASeq.objects.get(id=pk)
    data = calculate_phenotype_transformations(rnaseq, rnaseq=True)
    data['object'] = rnaseq
    return render(request, 'phenotypedb/rnaseq_transformation_results.html',
                  data)