Commit ffe6406d authored by Alexis  CRISCUOLO's avatar Alexis CRISCUOLO
Browse files

1.993

parent 896c849f
This diff is collapsed.
......@@ -37,9 +37,9 @@ import java.util.BitSet;
public abstract class MSA {
private int size;
private int length;
private String[] lbl;
private final int size;
private final int length;
private final String[] lbl;
public MSA(final int size, final int length) {
this.size = size;
......@@ -47,19 +47,19 @@ public abstract class MSA {
lbl = new String[size];
}
public int size() {
public final int size() {
return size;
}
public int length() {
public final int length() {
return length;
}
public void setLabel(final int row, final String label) {
public final void setLabel(final int row, final String label) {
lbl[row] = label;
}
public String getLabel(final int row) {
public final String getLabel(final int row) {
return lbl[row];
}
......
......@@ -90,8 +90,8 @@ public class MSAaa extends MSA {
final static byte RY = (byte) 18; // Tyrosine
final static byte RV = (byte) 19; // Valine
private byte[][] msa;
private int[] rid;
private final byte[][] msa;
private final int[] rid;
public MSAaa(final int size, final int length) {
super(size, length);
......@@ -99,37 +99,37 @@ public class MSAaa extends MSA {
rid = IntStream.range(0, size).toArray();
}
private static byte charCode(final char cs) {
byte c = (byte) Arrays.binarySearch(ALPHABET, Character.toUpperCase(cs));
private static final byte charCode(final char cs) {
final byte c = (byte) Arrays.binarySearch(ALPHABET, Character.toUpperCase(cs));
return (c < 0) ? UNK : c;
}
public void setSequence(final int row, final String aaseq) {
public final void setSequence(final int row, final String aaseq) {
int p = aaseq.length();
while ( --p >= 0 ) setCharCode(row, p, charCode(aaseq.charAt(p)));
}
public void setCharCode(final int row, final int col, final byte code) {
public final void setCharCode(final int row, final int col, final byte code) {
msa[row][col] = code;
}
public byte getCharCode(final int row, final int col) {
public final byte getCharCode(final int row, final int col) {
return msa[row][col];
}
public String getCharState(final int row, final int col) {
public final String getCharState(final int row, final int col) {
return String.valueOf(ALPHABET[getCharCode(row,col)]);
}
public String getSequence(final int row) {
StringBuilder sb = new StringBuilder("x".repeat(length()));
public final String getSequence(final int row) {
final StringBuilder sb = new StringBuilder("x".repeat(length()));
int p = -1; for (byte c: msa[row]) sb.setCharAt(++p, ALPHABET[c]);
return sb.toString();
}
public double[] getFreq(final int col) { //## WARNING: should be in the same order as the blosum matrices
public final double[] getFreq(final int col) { //## WARNING: should be in the same order as the blosum matrices
int r = RESIDUE_NUMBER;
double[] freq = new double[r];
final double[] freq = new double[r];
int total = size();
for (int i: rid)
switch ( getCharCode(i, col) ) {
......@@ -164,8 +164,8 @@ public class MSAaa extends MSA {
return freq;
}
public String getMajorityCharState(final int col) {
int[] freq = new int[ALPHABET_SIZE];
public final String getMajorityCharState(final int col) {
final int[] freq = new int[ALPHABET_SIZE];
byte maj = UNK; int max = 0;
for (int i: rid)
switch ( getCharCode(i, col) ) {
......@@ -196,32 +196,34 @@ public class MSAaa extends MSA {
return String.valueOf(ALPHABET[maj]);
}
public double gapFreq(final int col) {
public final double gapFreq(final int col) {
double g = 0; for (int i: rid) g += ( getCharCode(i, col) == GAP ) ? 1 : 0;
return g / size();
}
public MSA trim(final BitSet mask) {
MSAaa tmsa = new MSAaa(size(), mask.cardinality());
int b, p;
public final MSA trim(final BitSet mask) {
final MSAaa tmsa = new MSAaa(size(), mask.cardinality());
int p;
for (int i: rid) {
tmsa.setLabel(i, getLabel(i));
b = p = -1; while ( (b=mask.nextSetBit(++b)) != -1 ) tmsa.setCharCode(i, ++p, getCharCode(i, b));
//b = p = -1; while ( (b=mask.nextSetBit(++b)) != -1 ) tmsa.setCharCode(i, ++p, getCharCode(i, b));
p = -1; for (int b: mask.stream().toArray()) tmsa.setCharCode(i, ++p, getCharCode(i, b));
}
return tmsa;
}
public MSAaa toMSAaa() {
MSAaa aa = new MSAaa(size(), length());
public final MSAaa toMSAaa() {
final MSAaa aa = new MSAaa(size(), length());
int p;
for (int i: rid) {
aa.setLabel(i, getLabel(i));
int p = -1; for (byte c: msa[i]) aa.setCharCode(i, ++p, c);
p = -1; for (byte c: msa[i]) aa.setCharCode(i, ++p, c);
}
return aa;
}
public MSAco toMSAco() {
MSAco co = new MSAco(size(), length());
public final MSAco toMSAco() {
final MSAco co = new MSAco(size(), length());
int p;
for (int i: rid) {
co.setLabel(i, getLabel(i));
......@@ -257,12 +259,12 @@ public class MSAaa extends MSA {
return co;
}
public MSAnt toMSAnt() {
public final MSAnt toMSAnt() {
return toMSAco().toMSAnt();
}
public MSAry toMSAry() {
MSAry ry = new MSAry(size(), 3*length());
public final MSAry toMSAry() {
final MSAry ry = new MSAry(size(), 3*length());
int b, p;
for (int i: rid) {
ry.setLabel(i, getLabel(i));
......
......@@ -314,9 +314,9 @@ public class MSAco extends MSA {
final static short YUY = (short) 270; // L
private final static byte[] CO2AA = {MSAaa.GAP,MSAaa.UNK,MSAaa.K,MSAaa.N,MSAaa.K,MSAaa.K,MSAaa.N,MSAaa.N,MSAaa.N,MSAaa.T,MSAaa.T,MSAaa.T,MSAaa.T,MSAaa.T,MSAaa.T,MSAaa.T,MSAaa.T,MSAaa.T,MSAaa.T,MSAaa.T,MSAaa.T,MSAaa.T,MSAaa.T,MSAaa.T,MSAaa.T,MSAaa.R,MSAaa.S,MSAaa.R,MSAaa.R,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.I,MSAaa.I,MSAaa.M,MSAaa.I,MSAaa.I,MSAaa.I,MSAaa.I,MSAaa.M,MSAaa.I,MSAaa.I,MSAaa.Q,MSAaa.H,MSAaa.Q,MSAaa.Q,MSAaa.H,MSAaa.H,MSAaa.H,MSAaa.P,MSAaa.P,MSAaa.P,MSAaa.P,MSAaa.P,MSAaa.P,MSAaa.P,MSAaa.P,MSAaa.P,MSAaa.P,MSAaa.P,MSAaa.P,MSAaa.P,MSAaa.P,MSAaa.P,MSAaa.P,MSAaa.R,MSAaa.R,MSAaa.R,MSAaa.R,MSAaa.R,MSAaa.R,MSAaa.R,MSAaa.R,MSAaa.R,MSAaa.R,MSAaa.R,MSAaa.R,MSAaa.R,MSAaa.R,MSAaa.R,MSAaa.R,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.E,MSAaa.D,MSAaa.E,MSAaa.E,MSAaa.D,MSAaa.D,MSAaa.D,MSAaa.A,MSAaa.A,MSAaa.A,MSAaa.A,MSAaa.A,MSAaa.A,MSAaa.A,MSAaa.A,MSAaa.A,MSAaa.A,MSAaa.A,MSAaa.A,MSAaa.A,MSAaa.A,MSAaa.A,MSAaa.A,MSAaa.G,MSAaa.G,MSAaa.G,MSAaa.G,MSAaa.G,MSAaa.G,MSAaa.G,MSAaa.G,MSAaa.G,MSAaa.G,MSAaa.G,MSAaa.G,MSAaa.G,MSAaa.G,MSAaa.G,MSAaa.G,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.V,MSAaa.R,MSAaa.Y,MSAaa.Y,MSAaa.Y,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.C,MSAaa.W,MSAaa.C,MSAaa.C,MSAaa.L,MSAaa.F,MSAaa.L,MSAaa.L,MSAaa.F,MSAaa.F,MSAaa.Y,MSAaa.Y,MSAaa.Y,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.C,MSAaa.W,MSAaa.C,MSAaa.C,MSAaa.L,MSAaa.F,MSAaa.L,MSAaa.L,MSAaa.F,MSAaa.F,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.S,MSAaa.X,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L,MSAaa.L};
private short[][] msa;
private byte[][] msaa;
private int[] rid;
private final short[][] msa;
private final byte[][] msaa;
private final int[] rid;
public MSAco(final int size, final int length) { //## WARNING: length = no. codons
super(size, length);
......@@ -325,38 +325,38 @@ public class MSAco extends MSA {
rid = IntStream.range(0, size).toArray();
}
private static short charCode(final String cod) {
short c = (short) Arrays.binarySearch(ALPHABET, cod.toUpperCase());
private final static short charCode(final String cod) {
final short c = (short) Arrays.binarySearch(ALPHABET, cod.toUpperCase());
return (c < 0) ? UNK : c;
}
public void setSequence(final int row, final String coseq) {
public final void setSequence(final int row, final String coseq) {
int p = coseq.length() / 3;
while ( --p >= 0 ) setCharCode(row, p, charCode(coseq.substring(3*p,3*(p+1))));
}
public void setCharCode(final int row, final int col, final short code) {
public final void setCharCode(final int row, final int col, final short code) {
msa[row][col] = code;
msaa[row][col] = CO2AA[code];
}
public short getCharCode(final int row, final int col) {
public final short getCharCode(final int row, final int col) {
return msa[row][col];
}
public String getCharState(final int row, final int col) {
public final String getCharState(final int row, final int col) {
return ALPHABET[getCharCode(row,col)];
}
public String getSequence(final int row) {
public final String getSequence(final int row) {
StringBuilder sb = new StringBuilder(3*length());
for (short c: msa[row]) sb = sb.append(ALPHABET[c]);
return sb.toString();
}
public double[] getFreq(final int col) { //## WARNING: returns aa freq
public final double[] getFreq(final int col) { //## WARNING: returns aa freq
int r = MSAaa.RESIDUE_NUMBER;
double[] freq = new double[r];
final double[] freq = new double[r];
int total = size();
for (int i: rid)
switch ( msaa[i][col] ) {
......@@ -391,8 +391,8 @@ public class MSAco extends MSA {
return freq;
}
public String getMajorityCharState(final int col) {
int[] freq = new int[ALPHABET_SIZE];
public final String getMajorityCharState(final int col) {
final int[] freq = new int[ALPHABET_SIZE];
short r, maj = UNK;
for (int i: rid) if ( (r=getCharCode(i, col)) > UNK ) ++freq[r];
r = ALPHABET_SIZE; int max = 0;
......@@ -400,23 +400,24 @@ public class MSAco extends MSA {
return ALPHABET[maj];
}
public double gapFreq(final int col) {
public final double gapFreq(final int col) {
double g = 0; for (int i: rid) g += ( getCharCode(i, col) == GAP ) ? 1 : 0;
return g / size();
}
public MSA trim(final BitSet mask) {
MSAco tmsa = new MSAco(size(), mask.cardinality());
int b, p;
public final MSA trim(final BitSet mask) {
final MSAco tmsa = new MSAco(size(), mask.cardinality());
int p;
for (int i: rid) {
tmsa.setLabel(i, getLabel(i));
b = p = -1; while ( (b=mask.nextSetBit(++b)) != -1 ) tmsa.setCharCode(i, ++p, getCharCode(i, b));
//b = p = -1; while ( (b=mask.nextSetBit(++b)) != -1 ) tmsa.setCharCode(i, ++p, getCharCode(i, b));
p = -1; for (int b: mask.stream().toArray()) tmsa.setCharCode(i, ++p, getCharCode(i, b));
}
return tmsa;
}
public MSAaa toMSAaa() {
MSAaa aa = new MSAaa(size(), length());
public final MSAaa toMSAaa() {
final MSAaa aa = new MSAaa(size(), length());
int p;
for (int i: rid) {
aa.setLabel(i, getLabel(i));
......@@ -425,17 +426,18 @@ public class MSAco extends MSA {
return aa;
}
public MSAco toMSAco() {
MSAco co = new MSAco(size(), length());
public final MSAco toMSAco() {
final MSAco co = new MSAco(size(), length());
int p;
for (int i: rid) {
co.setLabel(i, getLabel(i));
int p = -1; for (short c: msa[i]) co.setCharCode(i, ++p, c);
p = -1; for (short c: msa[i]) co.setCharCode(i, ++p, c);
}
return co;
}
public MSAnt toMSAnt() {
MSAnt nt = new MSAnt(size(), 3*length());
public final MSAnt toMSAnt() {
final MSAnt nt = new MSAnt(size(), 3*length());
for (int i: rid) {
nt.setLabel(i, getLabel(i));
nt.setSequence(i, getSequence(i));
......@@ -443,7 +445,7 @@ public class MSAco extends MSA {
return nt;
}
public MSAry toMSAry() {
public final MSAry toMSAry() {
return toMSAnt().toMSAry();
}
}
......
......@@ -71,8 +71,8 @@ public class MSAnt extends MSA {
private final static double THD = 1.0 / 3.0;
private final static double FTH = 0.25;
private byte[][] msa;
private int[] rid;
private final byte[][] msa;
private final int[] rid;
public MSAnt(final int size, final int length) {
super(size, length);
......@@ -80,37 +80,37 @@ public class MSAnt extends MSA {
rid = IntStream.range(0, size).toArray();
}
private static byte charCode(final char cs) {
byte c = (byte) Arrays.binarySearch(ALPHABET, Character.toUpperCase(cs));
private final static byte charCode(final char cs) {
final byte c = (byte) Arrays.binarySearch(ALPHABET, Character.toUpperCase(cs));
return (c < 0) ? UNK : c;
}
public void setSequence(final int row, final String seq) {
public final void setSequence(final int row, final String seq) {
int p = seq.length();
while ( --p >= 0 ) setCharCode(row, p, charCode(seq.charAt(p)));
}
public void setCharCode(final int row, final int col, final byte code) {
public final void setCharCode(final int row, final int col, final byte code) {
msa[row][col] = code;
}
public byte getCharCode(final int row, final int col) {
public final byte getCharCode(final int row, final int col) {
return msa[row][col];
}
public String getCharState(final int row, final int col) {
public final String getCharState(final int row, final int col) {
return String.valueOf(ALPHABET[getCharCode(row,col)]);
}
public String getSequence(final int row) {
StringBuilder sb = new StringBuilder("x".repeat(length()));
public final String getSequence(final int row) {
final StringBuilder sb = new StringBuilder("x".repeat(length()));
int p = -1; for (byte c: msa[row]) sb.setCharAt(++p, ALPHABET[c]);
return sb.toString();
}
public double[] getFreq(final int col) {
public final double[] getFreq(final int col) {
int r = RESIDUE_NUMBER;
double[] freq = new double[r];
final double[] freq = new double[r];
int total = size();
for (int i: rid)
switch ( getCharCode(i, col) ) {
......@@ -138,10 +138,10 @@ public class MSAnt extends MSA {
return freq;
}
public String getMajorityCharState(final int col) {
public final String getMajorityCharState(final int col) {
byte maj = UNK;
int max = ALPHABET_SIZE;
int[] freq = new int[max];
final int[] freq = new int[max];
for (int i: rid)
switch ( getCharCode(i, col) ) {
case A: max = ( max < (++freq[A])) ? freq[maj=A] : max; continue;
......@@ -165,28 +165,29 @@ public class MSAnt extends MSA {
return String.valueOf(ALPHABET[maj]);
}
public double gapFreq(final int col) {
public final double gapFreq(final int col) {
double g = 0; for (int i: rid) g += ( getCharCode(i, col) == GAP ) ? 1 : 0;
return g / size();
}
public MSA trim(final BitSet mask) {
MSAnt tmsa = new MSAnt(size(), mask.cardinality());
int b, p;
public final MSA trim(final BitSet mask) {
final MSAnt tmsa = new MSAnt(size(), mask.cardinality());
int p;
for (int i: rid) {
tmsa.setLabel(i, getLabel(i));
b = p = -1; while ( (b=mask.nextSetBit(++b)) != -1 ) tmsa.setCharCode(i, ++p, getCharCode(i, b));
//b = p = -1; while ( (b=mask.nextSetBit(++b)) != -1 ) tmsa.setCharCode(i, ++p, getCharCode(i, b));
p = -1; for (int b: mask.stream().toArray()) tmsa.setCharCode(i, ++p, getCharCode(i, b));
}
return tmsa;
}
public MSAaa toMSAaa() {
public final MSAaa toMSAaa() {
return toMSAco().toMSAaa();
}
public MSAco toMSAco() {
public final MSAco toMSAco() {
int l = length() / 3;
MSAco co = new MSAco(size(), l);
final MSAco co = new MSAco(size(), l);
for (int i: rid) {
co.setLabel(i, getLabel(i));
co.setSequence(i, getSequence(i).substring(0, 3*l));
......@@ -194,8 +195,8 @@ public class MSAnt extends MSA {
return co;
}
public MSAnt toMSAnt() {
MSAnt nt = new MSAnt(size(), length());
public final MSAnt toMSAnt() {
final MSAnt nt = new MSAnt(size(), length());
for (int i: rid) {
nt.setLabel(i, getLabel(i));
int p = -1; for (byte c: msa[i]) nt.setCharCode(i, ++p, c);
......@@ -203,8 +204,8 @@ public class MSAnt extends MSA {
return nt;
}
public MSAry toMSAry() {
MSAry ry = new MSAry(size(), length());
public final MSAry toMSAry() {
final MSAry ry = new MSAry(size(), length());
int p;
for (int i: rid) {
ry.setLabel(i, getLabel(i));
......
......@@ -53,8 +53,8 @@ public class MSAry extends MSA {
final static byte RR = (byte) 0; // A or G
final static byte RY = (byte) 1; // C or T
private byte[][] msa;
private int[] rid;
final private byte[][] msa;
final private int[] rid;
public MSAry(final int size, final int length) {
super(size, length);
......@@ -62,37 +62,37 @@ public class MSAry extends MSA {
rid = IntStream.range(0, size).toArray();
}
private static byte charCode(final char cs) {
byte c = (byte) Arrays.binarySearch(ALPHABET, Character.toUpperCase(cs));
private final static byte charCode(final char cs) {
final byte c = (byte) Arrays.binarySearch(ALPHABET, Character.toUpperCase(cs));
return (c < 0) ? UNK : c;
}
public void setSequence(final int row, final String ryseq) {
public final void setSequence(final int row, final String ryseq) {
int p = ryseq.length();
while ( --p >= 0 ) setCharCode(row, p, charCode(ryseq.charAt(p)));
}
public void setCharCode(final int row, final int col, final byte code) {
public final void setCharCode(final int row, final int col, final byte code) {
msa[row][col] = code;
}
public byte getCharCode(final int row, final int col) {
public final byte getCharCode(final int row, final int col) {
return msa[row][col];
}
public String getCharState(final int row, final int col) {
public final String getCharState(final int row, final int col) {
return String.valueOf(ALPHABET[getCharCode(row,col)]);
}
public String getSequence(final int row) {
StringBuilder sb = new StringBuilder("x".repeat(length()));
public final String getSequence(final int row) {
final StringBuilder sb = new StringBuilder("x".repeat(length()));
int p = -1; for (byte c: msa[row]) sb.setCharAt(++p, ALPHABET[c]);
return sb.toString();
}
public double[] getFreq(final int col) {
public final double[] getFreq(final int col) {
int r = RESIDUE_NUMBER;
double[] freq = new double[r];
final double[] freq = new double[r];
int total = size();
for (int i: rid)
switch ( getCharCode(i, col) ) {
......@@ -107,10 +107,10 @@ public class MSAry extends MSA {
return freq;
}
public String getMajorityCharState(final int col) {
public final String getMajorityCharState(final int col) {
byte maj = UNK;
int max = ALPHABET_SIZE;
int[] freq = new int[max];
final int[] freq = new int[max];
for (int i: rid)
switch ( getCharCode(i, col) ) {
case N: max = ( max < (++freq[N])) ? freq[maj=N] : max; continue;
......@@ -121,28 +121,29 @@ public class MSAry extends MSA {
return String.valueOf(ALPHABET[maj]);
}
public double gapFreq(final int col) {
public final double gapFreq(final int col) {
double g = 0; for (int i: rid) g += ( getCharCode(i, col) == GAP ) ? 1 : 0;
return g / size();
}
public MSA trim(final BitSet mask) {
MSAry tmsa = new MSAry(size(), mask.cardinality());
int b, p;
public final MSA trim(final BitSet mask) {
final MSAry tmsa = new MSAry(size(), mask.cardinality());
int p;
for (int i: rid) {
tmsa.setLabel(i, getLabel(i));
b = p = -1; while ( (b=mask.nextSetBit(++b)) != -1 ) tmsa.setCharCode(i, ++p, getCharCode(i, b));
//b = p = -1; while ( (b=mask.nextSetBit(++b)) != -1 ) tmsa.setCharCode(i, ++p, getCharCode(i, b));
p = -1; for (int b: mask.stream().toArray()) tmsa.setCharCode(i, ++p, getCharCode(i, b));
}
return tmsa;
}
public MSAaa toMSAaa() {
public final MSAaa toMSAaa() {
return toMSAco().toMSAaa();
}
public MSAco toMSAco() {
public final MSAco toMSAco() {
int l = length() / 3;
MSAco co = new MSAco(size(), l);
final MSAco co = new MSAco(size(), l);
for (int i: rid) {
co.setLabel(i, getLabel(i));
co.setSequence(i, getSequence(i).substring(0, 3*l));
......@@ -150,8 +151,8 @@ public class MSAry extends MSA {
return co;
}
public MSAnt toMSAnt() {
MSAnt nt = new MSAnt(size(), length());
public final MSAnt toMSAnt() {
final MSAnt nt = new MSAnt(size(), length());
int p;
for (int i: rid) {
nt.setLabel(i, getLabel(i));
......@@ -160,8 +161,8 @@ public class MSAry extends MSA {
return nt;
}
public MSAry toMSAry() {
MSAry ry = new MSAry(size(), length());
public final MSAry toMSAry() {
final MSAry ry = new MSAry(size(), length());
for (int i: rid) {
ry.setLabel(i, getLabel(i));
int p = -1; for (byte c: msa[i]) ry.setCharCode(i, ++p, c);
......
......@@ -39,9 +39,9 @@ import java.util.Locale;
public class SMatrix {
private int size;
private double[][] mat;
private int[] id;
private final int size;
private final double[][] mat;
private final int[] id;
// square matrix of size 0
public SMatrix() {
......@@ -81,16 +81,16 @@ public class SMatrix {
/