+ if (isNa != matrix.isDNA())
+ {
+ throw new InvalidSequenceTypeException("matrix "
+ + matrix.getClass().getCanonicalName()
+ + " is not a valid matrix for "
+ + (isNa ? "nucleotide" : "protein") + "sequences");
+ }
+ matrixEncode(matrix.isDNA() ? ResidueProperties.nucleotideIndex
+ : ResidueProperties.aaIndex, matrix.getMatrix());