Exemple #1
0
def post_pedigree(cust_id, case_id):
    """Write pedigree to correct location."""
    logger.debug('gather information from LIMS')
    samples_res = glue.get('lims', 'samples', params={'cust_id': cust_id,
                                                      'case_id': case_id})
    analysis_type = utils.get_analysis_type(samples_res.json['analysis_types'])
    ped_content = get_pedigree(cust_id, case_id)
    docase_res = glue.post('assemble', 'cases', 'prepare', cust_id, case_id,
                           data={'analysis_type': analysis_type,
                                 'ped_content': ped_content})
    return docase_res.json
Exemple #2
0
def post_start_analysis(cust_id, case_id, gene_list=None, mip_config=None,
                        add_only=False):
    """Start analysis for a case."""
    filters = {'cust_id': cust_id, 'case_id': case_id}
    samples_res = glue.get('lims', 'samples', params=filters)
    analysis_types = samples_res.json['analysis_types']
    analysis_type = get_analysis_type(analysis_types)

    if add_only:
        case_res = glue.get('analyze', 'analyses', cust_id, case_id)
    else:
        start_payload = {'seq_type': analysis_type, 'gene_list': gene_list,
                         'mip_config': mip_config}
        case_res = glue.post('analyze', 'analyses', 'start', cust_id, case_id,
                             data=start_payload)

    logger.debug('persist the analysis to the database')
    analyzed_at = case_res.json['analyzed_at']
    add_payload = {'cust_id': cust_id, 'case_id': case_id,
                   'analysis_type': analysis_type, 'analyzed_at': analyzed_at}
    add_res = glue.post('moneypenny', 'analyses', data=add_payload)
    return add_res.json