Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(3)  |  Derive(0)  |  Import(1)
It returns the list of scores for all results.

For instance, for a blast a generator with all e-values can be generated.
By default, the results with the same query and subject will be filtered
out.
The scores can be a single one or a list of them.

        def alignment_results_scores(results, scores, filter_same_query_subject=True):
    '''It returns the list of scores for all results.

    For instance, for a blast a generator with all e-values can be generated.
    By default, the results with the same query and subject will be filtered
    out.
    The scores can be a single one or a list of them.
    '''
    # for each score we want a list to gather the results
    score_res = []
    for score in scores:
        score_res.append([])
    for result in results:
        query = result['query']
        for match in result['matches']:
            subject = match['subject']
            if (filter_same_query_subject and query is not None and subject is
                not None and query['name'] == subject['name']):
                continue
            # all the scores for this match
            score_values = get_match_scores(match, scores, query, subject)
            # we append each score to the corresponding result list
            for index, value in enumerate(score_values):
                score_res[index].append(value)
    if len(score_res) == 1:
        return score_res[0]
    else:
        return score_res
        


src/s/e/seq_crumbs-HEAD/test/test_alignment_result.py   seq_crumbs(Download)
 
 
from crumbs.alignment_result import (BlastParser, TabularBlastParser,
                                     alignment_results_scores, ExonerateParser,
                                     filter_alignments,
        results = [result1]
        #filtering the query-subj with the same names
        scores = alignment_results_scores(results, ['similarity'])
        assert scores == [90.0]
        #without the filtering
        scores = alignment_results_scores(results, ['similarity'],
 
        #we can ask for several scores at once
        scores = alignment_results_scores(results,
                                          ['similarity', 'similarity'],
                                          filter_same_query_subject=False)