seq1end = i + 1;
seq2end = j + 1;
-
aseq1 = new int[seq1.length + seq2.length];
aseq2 = new int[seq1.length + seq2.length];
j--;
}
-
while (i > 0 && j > 0)
{
aseq1[count] = seq1[i];
seq1start = i + 1;
seq2start = j + 1;
- if (aseq1[count] != GAP_INDEX)
- {
- aseq1[count] = seq1[i];
- sb1.append(s1str.charAt(i));
- }
-
- if (aseq2[count] != GAP_INDEX)
- {
- aseq2[count] = seq2[j];
- sb2.append(s2str.charAt(j));
- }
+ aseq1[count] = seq1[i];
+ sb1.append(s1str.charAt(i));
+ aseq2[count] = seq2[j];
+ sb2.append(s2str.charAt(j));
//get initial gaps
while (j > 0 || i > 0)
*/
public void meanScore()
{
- //int length = (indelfreeAstr1.length() > indelfreeAstr2.length()) ? indelfreeAstr1.length() : indelfreeAstr2.length();
int length = indelfreeAstr1.length(); //both have the same length
//create HashMap for counting residues in each sequence
HashMap<Character, Integer> seq1ResCount = new HashMap<Character, Integer>();
* if preprescore < 1 ~ alignmentScore = Float.NaN >
* alignmentScore = ((preprescore - meanScore) / (hypotheticMaxScore - meanScore)) * coverage
*/
- public void scoreAlignment() throws RuntimeException
+ public void scoreAlignment()
{
getIndelfreeAstr();
// cannot calculate score because denominator would be zero
if (this.hypotheticMaxScore == this.meanScore)
{
- throw new IllegalArgumentException(String.format("hypotheticMaxScore (%8.2f) == meanScore (%8.2f) - division by 0", hypotheticMaxScore, meanScore));
+ this.alignmentScore = Float.NaN;
+ return;
}
- //int n = (astr1.length() > astr2.length()) ? astr1.length() : astr2.length();
int n = indelfreeAstr1.length();
float score = 0;
float prescore = score; // only debug
score *= coverage;
- System.out.println(String.format("prepre-score: %f, pre-score: %f, longlength: %d\nscore: %1.16f, mean: %f, max: %d", preprescore, prescore, _max[1], score, this.meanScore, this.hypotheticMaxScore));
+ //System.out.println(String.format("prepre-score: %f, pre-score: %f, longlength: %d\nscore: %1.16f, mean: %f, max: %d", preprescore, prescore, _max[1], score, this.meanScore, this.hypotheticMaxScore));
float minScore = 1f;
this.alignmentScore = (preprescore < minScore) ? Float.NaN : score;
}
int width = pasimap.getWidth();
int height = pasimap.getHeight();
- top = height;
+ top = width;
points = new Vector<>();
Point[] scores = pasimap.getComponents(width - 1, width - 2, width - 3, 1);
- for (int i = 0; i < top; i++)
+ for (int i = 0; i < height; i++)
{
SequencePoint sp = new SequencePoint(seqs[i], scores[i]);
points.add(sp);
// note: actual indices for components are dim1-1, etc (patch for JAL-1123)
Point[] scores = pasimap.getComponents(dim1 - 1, dim2 - 1, dim3 - 1, 1);
- for (int i = 0; i < pasimap.getWidth(); i++)
+ for (int i = 0; i < pasimap.getHeight(); i++)
{
points.get(i).coord = scores[i];
}