def pedigree(case_id):
    """Fetch the contents of a pedigree file."""
    root = current_app.config['MIP_ANALYSIS_ROOT']
    case_obj = db.case(case_id)
    analysis = analysis_info(root, case_obj)
    if analysis['pedigree']:
        with open(analysis['pedigree']) as handle:
            content = handle.read()
        return Response(content, mimetype='text/plain')
    else:
        return abort(404)
def pedigree(case_id):
    """Create pedigree from LIMS."""
    case_obj = db.case(case_id)
    cust_id, family_id = case_obj.customer.id, case_obj.name
    ped_content = analyze.pedigree(lims_api, cust_id, family_id)
    return Response(ped_content, mimetype='text/plain')
def case(case_id):
    """Show details for a case."""
    root = current_app.config['MIP_ANALYSIS_ROOT']
    case_obj = db.case(case_id)
    analysis = analysis_info(root, case_obj)
    return render_template('case.html', case=case_obj, analysis=analysis)