{
int nores = (isNa) ? ResidueProperties.maxNucleotideIndex
: ResidueProperties.maxProteinIndex;
- // Set all matrix to 0
- dbinary = new double[getSequence().length * nores];
- for (int i = 0; i < dbinary.length; i++)
- {
- dbinary[i] = 0.0;
- }
+ dbinary = new double[getLength() * nores];
+
return nores;
}
{
int nores = initMatrixGetNoRes();
final int[] sindex = getSymbolmatrix();
- for (int i = 0; i < getSequence().length; i++)
+ for (int i = 0; i < getLength(); i++)
{
int aanum = nores - 1;
{
if (isNa != smtrx.isDNA())
{
- throw new InvalidSequenceTypeException("matrix "
- + smtrx.getClass().getCanonicalName()
- + " is not a valid matrix for "
- + (isNa ? "nucleotide" : "protein") + "sequences");
+ throw new InvalidSequenceTypeException(
+ "matrix " + smtrx.getClass().getCanonicalName()
+ + " is not a valid matrix for "
+ + (isNa ? "nucleotide" : "protein") + "sequences");
}
matrixEncode(smtrx.isDNA() ? ResidueProperties.nucleotideIndex
: ResidueProperties.aaIndex, smtrx.getMatrix());
private void matrixEncode(final int[] aaIndex, final float[][] matrix)
{
- // Set all matrix to 0
- // dbinary = new double[getSequence().length * 21];
-
int nores = initMatrixGetNoRes();
- // for (int i = 0; i < dbinary.length; i++) {
- // dbinary[i] = 0.0;
- // }
- for (int i = 0, iSize = getSequence().length; i < iSize; i++)
+ for (int i = 0, iSize = getLength(); i < iSize; i++)
{
int aanum = nores - 1;
for (int i = 0; i < binary.length; i++)
{
- out += (new Integer(binary[i])).toString();
+ out += (Integer.valueOf(binary[i])).toString();
if (i < (binary.length - 1))
{