From: Jim Procter Date: Sun, 23 Nov 2014 16:43:54 +0000 (+0000) Subject: employ test and secondary structure character for determining base pairing direction... X-Git-Tag: Jalview_2_9~148^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9bc6fd9d86db21bda68daa57376d2c879e395f6c;p=jalview.git employ test and secondary structure character for determining base pairing direction for rendering rna annotation --- diff --git a/src/jalview/renderer/AnnotationRenderer.java b/src/jalview/renderer/AnnotationRenderer.java index 5348aaa..d5b2f49 100644 --- a/src/jalview/renderer/AnnotationRenderer.java +++ b/src/jalview/renderer/AnnotationRenderer.java @@ -27,6 +27,7 @@ import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.Annotation; import jalview.datamodel.ColumnSelection; import jalview.schemes.ColourSchemeI; +import jalview.schemes.ResidueProperties; import java.awt.BasicStroke; import java.awt.Color; @@ -77,17 +78,17 @@ public class AnnotationRenderer int x2 = (x * charWidth); Regex closeparen = new Regex("(\\))"); - String dc = (column == 0 || row_annotations[column - 1] == null) ? "" - : row_annotations[column - 1].displayCharacter; + char dc = (column == 0 || row_annotations[column - 1] == null) ? ' ' + : row_annotations[column - 1].secondaryStructure; boolean diffupstream = sCol == 0 || row_annotations[sCol - 1] == null - || !dc.equals(row_annotations[sCol - 1].displayCharacter); + || dc != row_annotations[sCol - 1].secondaryStructure; boolean diffdownstream = !validRes || !validEnd || row_annotations[column] == null - || !dc.equals(row_annotations[column].displayCharacter); + || dc != row_annotations[column].secondaryStructure; // System.out.println("Column "+column+" diff up: "+diffupstream+" down:"+diffdownstream); // If a closing base pair half of the stem, display a backward arrow - if (column > 0 && closeparen.search(dc)) + if (column > 0 && ResidueProperties.isCloseParenRNA(dc)) { if (diffupstream) @@ -574,11 +575,15 @@ public class AnnotationRenderer } } } - if (!row.isValidStruc()) + if (row.getInvalidStrucPos() > x) { g.setColor(Color.orange); - g.fillRect((int) row.getInvalidStrucPos() * charWidth, y, - charWidth, charHeight); + g.fillRect(x * charWidth, y, charWidth, charHeight); + } + else if (row.getInvalidStrucPos() == x) + { + g.setColor(Color.orange.darker()); + g.fillRect(x * charWidth, y, charWidth, charHeight); } if (validCharWidth && validRes