kmerLength = config.getInt(KMER_LEN_ATTR, DEF_KMER_LEN);
}
@Override
protected LongWritable compareItems(Text a, Text b) {
Alignment alignment;
switch (compareType) {
case LOCAL:
alignment = LocalAlignment.getLocalAlignment(
a, b, matchScore, mismatchScore, gapScore, gapExtScore);
break;
case GLOBAL:
alignment = GlobalAlignment.getGlobalAlignment(
a, b, matchScore, mismatchScore, gapScore);
break;
case KMER:
// Drop through.
default:
alignment = KmerDistance.getKmerAlignment(a, b, kmerLength);
}
return new LongWritable(alignment.getDistance());
}