From 3a2eea48af60359b187c5dd0b95cbd29a64cb62b Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 20 Oct 2014 09:34:15 +0100 Subject: [PATCH] JAL-1551 source formatting --- src/jalview/datamodel/AlignmentAnnotation.java | 29 ++++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index 012ecb3..c0d911e 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -22,17 +22,13 @@ package jalview.datamodel; import jalview.analysis.Rna; import jalview.analysis.SecStrConsensus.SimpleBP; - import jalview.analysis.WUSSParseException; import java.util.ArrayList; import java.util.Enumeration; import java.util.Hashtable; -import java.util.Map; import java.util.Map.Entry; -import fr.orsay.lri.varna.models.rna.RNA; - /** * DOCUMENT ME! * @@ -261,7 +257,8 @@ public class AlignmentAnnotation // Check for RNA secondary structure { // System.out.println(annotations[i].secondaryStructure); - // TODO: 2.8.2 should this ss symbol validation check be a function in RNA/ResidueProperties ? + // TODO: 2.8.2 should this ss symbol validation check be a function in + // RNA/ResidueProperties ? if (annotations[i].secondaryStructure == '(' || annotations[i].secondaryStructure == '[' || annotations[i].secondaryStructure == '<' @@ -604,7 +601,9 @@ public class AlignmentAnnotation { this.label = new String(annotation.label); if (annotation.description != null) + { this.description = new String(annotation.description); + } this.graphMin = annotation.graphMin; this.graphMax = annotation.graphMax; this.graph = annotation.graph; @@ -659,7 +658,7 @@ public class AlignmentAnnotation { // could optimise this! p = (Integer) pos.nextElement(); - Annotation a = (Annotation) annotation.sequenceMapping.get(p); + Annotation a = annotation.sequenceMapping.get(p); if (a == null) { continue; @@ -702,13 +701,21 @@ public class AlignmentAnnotation return; } if (startRes < 0) + { startRes = 0; + } if (startRes >= annotations.length) + { startRes = annotations.length - 1; + } if (endRes >= annotations.length) + { endRes = annotations.length - 1; + } if (annotations == null) + { return; + } Annotation[] temp = new Annotation[endRes - startRes + 1]; if (startRes < annotations.length) { @@ -870,7 +877,9 @@ public class AlignmentAnnotation public void adjustForAlignment() { if (sequenceRef == null) + { return; + } if (annotations == null) { @@ -896,7 +905,7 @@ public class AlignmentAnnotation { position = sequenceRef.findIndex(a) - 1; - temp[position] = (Annotation) sequenceMapping.get(index); + temp[position] = sequenceMapping.get(index); } } @@ -917,8 +926,10 @@ public class AlignmentAnnotation if (annotations[i] == null) { if (i + 1 < iSize) + { System.arraycopy(annotations, i + 1, annotations, i, iSize - i - 1); + } iSize--; } else @@ -1056,11 +1067,15 @@ public class AlignmentAnnotation for (int i = 0; i < annotations.length; i++) { if (annotations[i] == null) + { annotations[i] = new Annotation(String.valueOf(gapchar), null, ' ', 0f, null); + } else if (annotations[i].displayCharacter == null || annotations[i].displayCharacter.equals(" ")) + { annotations[i].displayCharacter = String.valueOf(gapchar); + } } } } -- 1.7.10.2