Example #1
0
def list_matches(taboo_store, rsnumber_stream, sample_id):
    """Run the matching pipeline."""
    logger.debug('compare SNPs against all samples')
    comparisons = match_sample(taboo_store, rsnumber_stream, sample_id,
                               experiment='sequencing',
                               alt_experiment='genotyping')
    logger.debug('sort the results by score')
    ranked_comparisons = sort_scores(comparisons)

    logger.debug('extract best match')
    return ranked_comparisons
Example #2
0
def top_match(taboo_store, rsnumber_stream, sample_id):
    """Run the matching pipeline."""
    logger.debug('compare SNPs against all samples')
    comparisons = match_sample(taboo_store, rsnumber_stream, sample_id,
                               experiment='sequencing',
                               alt_experiment='genotyping')
    logger.debug('sort the results by score')
    ranked_comparisons = sort_scores(comparisons)

    logger.debug('extract best match')
    top_sample, results = ranked_comparisons[0]

    return {
        'sample_id': top_sample.sample_id,
        'matches': results['match'],
        'mismatches': results['mismatch'],
        'unknowns': results['unknown']
    }