Convenience method to summarize the evidence for and against a variant
        using a user-specified score function.

        See also `PileupCollection.group_by_match`.

        Parameters
        ----------
        variant : Variant
            The variant. Must have fields 'locus', 'ref', and 'alt'.

        score (optional) : PileupCollection -> object
            Function to apply to summarize the evidence for each allele.
            Default: count number of reads.

        Returns
        ----------
        List of (allele, score) pairs. This list will always have at least two
        elements. The first pair in the list is the reference allele. The
        second pair is the alternate. The subsequent items give the "third"
        alleles (neither ref nor alt), if any.

def match_summary(self, variant, score=lambda x: x.num_reads()):
        '''
        Convenience method to summarize the evidence for and against a variant
        using a user-specified score function.

        See also `PileupCollection.group_by_match`.

        Parameters
        ----------
        variant : Variant
            The variant. Must have fields 'locus', 'ref', and 'alt'.

        score (optional) : PileupCollection -> object
            Function to apply to summarize the evidence for each allele.
            Default: count number of reads.

        Returns
        ----------
        List of (allele, score) pairs. This list will always have at least two
        elements. The first pair in the list is the reference allele. The
        second pair is the alternate. The subsequent items give the "third"
        alleles (neither ref nor alt), if any.
        '''
        split = self.group_by_match(variant)

        def name(allele_to_pileup_collection):
            return ",".join(allele_to_pileup_collection)

        def aggregate_and_score(pileup_collections):
            merged = PileupCollection.merge(*pileup_collections)
            return score(merged)

        result = [
            (name(split.ref), aggregate_and_score(split.ref.values())),
            (name(split.alt), aggregate_and_score(split.alt.values())),
        ]
        result.extend(
            (allele, score(collection))
            for (allele, collection) in split.other.items())
        return result