X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignmentAnnotation.java;h=e137225e1920aec2c477fae897bb38024e85f5a8;hb=341e759bcdf94d50e58217f55a87f25a44eeef54;hp=0207575aea6f9c2dda68a4e6de94f6ba03428c9d;hpb=7d3c15518c8a237ff2ef0c135b6553891485462d;p=jalview.git diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index 0207575..e137225 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -75,9 +75,10 @@ public class AlignmentAnnotation public SequenceFeature[] _rnasecstr = null; /** - * position of annotation resulting in invalid WUSS parsing or -1 + * position of annotation resulting in invalid WUSS parsing or -1. -2 means + * there was no RNA structure in this annotation */ - private long invalidrnastruc = -1; + private long invalidrnastruc = -2; /** * Updates the _rnasecstr field Determines the positions that base pair and @@ -118,6 +119,7 @@ public class AlignmentAnnotation private void _markRnaHelices() { + int mxval = 0; // Figure out number of helices // Length of rnasecstr is the number of pairs of positions that base pair // with each other in the secondary structure @@ -133,6 +135,10 @@ public class AlignmentAnnotation try { val = Integer.valueOf(_rnasecstr[x].getFeatureGroup()); + if (mxval < val) + { + mxval = val; + } } catch (NumberFormatException q) { } @@ -141,9 +147,10 @@ public class AlignmentAnnotation annotations[_rnasecstr[x].getBegin()].value = val; annotations[_rnasecstr[x].getEnd()].value = val; - annotations[_rnasecstr[x].getBegin()].displayCharacter = "" + val; - annotations[_rnasecstr[x].getEnd()].displayCharacter = "" + val; + // annotations[_rnasecstr[x].getBegin()].displayCharacter = "" + val; + // annotations[_rnasecstr[x].getEnd()].displayCharacter = "" + val; } + setScore(mxval); } /** * map of positions in the associated annotation @@ -486,11 +493,10 @@ public class AlignmentAnnotation @Override public char charAt(int index) { - String dc; return ((index + offset < 0) || (index + offset) >= max - || annotations[index + offset] == null || (dc = annotations[index - + offset].displayCharacter.trim()).length() < 1) ? '.' : dc - .charAt(0); + || annotations[index + offset] == null || (annotations[index + + offset].secondaryStructure < ' ') ? ' ' + : annotations[index + offset].secondaryStructure); } public String toString() @@ -500,9 +506,8 @@ public class AlignmentAnnotation for (int i = offset; i < mx; i++) { - String dc; - string[i] = (annotations[i] == null || (dc = annotations[i].displayCharacter - .trim()).length() < 1) ? '.' : dc.charAt(0); + string[i] = (annotations[i] == null || (annotations[i].secondaryStructure < 32)) ? ' ' + : annotations[i].secondaryStructure; } return new String(string); }