static < S extends Sequence < C > , C extends Compound > PairwiseSequenceScorer < S , C > getPairwiseScorer ( S query , S target , PairwiseSequenceScorerType type , GapPenalty gapPenalty , SubstitutionMatrix < C > subMatrix ) { switch ( type ) { default : case GLOBAL : return getPairwiseAligner ( query , target , PairwiseSequenceAlignerType . GLOBAL , gapPenalty , subMatrix ) ; case GLOBAL_IDENTITIES : return new FractionalIdentityScorer < S , C > ( getPairwiseAligner ( query , target , PairwiseSequenceAlignerType . GLOBAL , gapPenalty , subMatrix ) ) ; case GLOBAL_SIMILARITIES : return new FractionalSimilarityScorer < S , C > ( getPairwiseAligner ( query , target , PairwiseSequenceAlignerType . GLOBAL , gapPenalty , subMatrix ) ) ; case LOCAL : return getPairwiseAligner ( query , target , PairwiseSequenceAlignerType . LOCAL , gapPenalty , subMatrix ) ; case LOCAL_IDENTITIES : return new FractionalIdentityScorer < S , C > ( getPairwiseAligner ( query , target , PairwiseSequenceAlignerType . LOCAL , gapPenalty , subMatrix ) ) ; case LOCAL_SIMILARITIES : return new FractionalSimilarityScorer < S , C > ( getPairwiseAligner ( query , target , PairwiseSequenceAlignerType . LOCAL , gapPenalty , subMatrix ) ) ; case KMERS : case WU_MANBER : // TODO other scoring options throw new UnsupportedOperationException ( Alignments . class . getSimpleName ( ) + " does not yet support " + type + " scoring" ) ; } }
Factory method which constructs a pairwise sequence scorer .