From: janengelhardt Date: Mon, 15 Aug 2011 09:02:14 +0000 (+0200) Subject: JAL-891; Sorting of Structure logo implemented; bug that caused X-Git-Tag: Jalview_2_9~576^2~8 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=1cf86680f3af423e29529855da07896501ce9f91 JAL-891; Sorting of Structure logo implemented; bug that caused exception after editing a structure solved (sequences have different lengths after editing); Change-Id: If2cb0ea0c683dc99a5df7002a4f9907283ce27cb --- diff --git a/src/jalview/analysis/StructureFrequency.java b/src/jalview/analysis/StructureFrequency.java index 9bdaa10..c253dce 100644 --- a/src/jalview/analysis/StructureFrequency.java +++ b/src/jalview/analysis/StructureFrequency.java @@ -96,8 +96,11 @@ public class StructureFrequency values = new int[255]; pairs = new int[255][255]; bpEnd = -1; - - s = struc[i]; + if(i 0) - { - rtnval[rtnval[0]++] = j; - rtnval[rtnval[0]++] = k; - rtnval[rtnval[0]++] = (int) ((float) pairs[j][k] * 100f / (float) profile[1][ignoreGapsInConsensusCalculation ? 1 - : 0]); - } + ca[x] = new int[]{ c, d}; + vl[x] = (float) pairs[c][d]; + x++; } } - + jalview.util.QuickSort.sort(vl, ca); + + rtnval[0] = 1; + for (int c=624; c>0; c--) + { + if (vl[c]>0) + { + rtnval[rtnval[0]++] = ((int[]) ca[c])[0]; + rtnval[rtnval[0]++] = ((int[]) ca[c])[1]; + rtnval[rtnval[0]++] = (int) ((float) vl[c] * 100f / (float) profile[1][ignoreGapsInConsensusCalculation ? 1 + : 0]); + } + } + return rtnval; } diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index a2392b1..0537723 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -840,6 +840,7 @@ public class Alignment implements AlignmentI } public boolean hasRNAStructure(){ + //TODO can it happen that structure is removed from alignment? return hasRNAStructure; } diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 0e90a5e..85b9465 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -1557,14 +1557,6 @@ public class AnnotationPanel extends JPanel implements MouseListener, if (profl != null) { - /* - * if (profl != null) { - * - * for (int i = 0; i < profl.length; i++) { System.out.print(profl[i] - * + ","); } - * - * } - */ int ht = y1, htn = y2 - y1;// aa.graphHeight; float wdth; double ht2 = 0;