import java.io.PrintStream;
+import java.util.ArrayList;
import java.util.Hashtable;
import java.util.HashMap;
import java.util.HashSet;
float[][] scores = new float[nSeqs][nSeqs]; // rows, cols
int nSplits = 1;
- //while ((nSeqs / nSplits) > 300) // heap full at 341
- while (((float) nSeqs / nSplits) > 5f) // heap full at 341
+ while (((float) nSeqs / nSplits) > 300f) // heap full at 341
+ //while (((float) nSeqs / nSplits) > 5f) // heap full at 341
nSplits++;
int splitSeqs = (int) Math.ceil((float) nSeqs / nSplits);
System.out.println(String.format("%d -> %d splits into %d seqs", nSeqs, nSplits, splitSeqs));
pairwiseScores = new Matrix(scores);
pairwiseScores.print(System.out, "%1.4f ");
-/*
+*/
pairwiseScores.fillDiagonal();
eigenMatrix = pairwiseScores.copy();
ccAnalysis cc = new ccAnalysis(pairwiseScores, dim);
eigenMatrix = cc.run();
-*/
} catch (Exception q)
{
int g = 0; // group count
for (int[] group : allGroups)
{
- HashSet<SequenceI> sg = new HashSet<SequenceI>();
+ ArrayList<SequenceI> sg = new ArrayList<SequenceI>();
//SequenceGroup sg = new SequenceGroup();
for (int index : group)
{
result.put(new int[]{s1 + g * s, s1 + g * s}, Float.NaN); // self score = Float.NaN
for (int s2 = 0; s2 < s1; s2++) // col
{
+System.out.println(String.format("%s x %s -> [%d][%d] (%f)", sgArray[s1].getName(), sgArray[s2].getName(), s1+g*s, s2+g*s, scores[s1][s2]));
result.put(new int[]{s1 + g * s, s2 + g * s}, scores[s1][s2]);
}
}
// align each subsplit with subsplits from other split groups
for (int subsplitN = 0; subsplitN < newGroups.length; subsplitN++)
{
- int c = 1; // current split block
+ int c = 1; // current subsplit block
while (newGroups[subsplitN][0] > smallS * c)
{
c++;
}
for (int nextSplit = subsplitN + 1; nextSplit < newGroups.length; nextSplit++)
{
- if (newGroups[nextSplit][0] >= s * c) // if next subsplit of next split group -> align seqs
+System.out.println(String.format("subsplitN %d, nextSplit %d, %d > %d * %d", subsplitN, nextSplit, allGroups[(int) Math.floor((float) nextSplit / 2)][0], smallS, c));
+ if (allGroups[(int) Math.floor((float) nextSplit / 2)][0] > smallS * c)
{
- HashSet<SequenceI> sg = new HashSet<SequenceI>();
+ ArrayList<SequenceI> sg = new ArrayList<SequenceI>();
//SequenceGroup sg = new SequenceGroup();
for (int index : newGroups[subsplitN])
{
for (int s2 = 0; s2 < s1; s2++) // col
{
if (s1 >= smallS && s2 < smallS)
+System.out.println(String.format("%s x %s -> [%d][%d] (%f)", sgArray[s1].getName(), sgArray[s2].getName(), s1+(nextSplit-1)*smallS, s2+subsplitN*smallS, scores[s1][s2]));
result.put(new int[]{s1 + (nextSplit-1) * smallS, s2 + subsplitN * smallS}, scores[s1][s2]);
}
}