import jalview.datamodel.Annotation;
import jalview.datamodel.ColumnSelection;
import jalview.schemes.ColourSchemeI;
+import jalview.schemes.ResidueProperties;
import java.awt.BasicStroke;
import java.awt.Color;
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)
profcolour = av.getAlignment().isNucleotide() ? new jalview.schemes.NucleotideColourScheme()
: new jalview.schemes.ZappoColourScheme();
}
+ boolean rna = av.getAlignment().isNucleotide();
columnSelection = av.getColumnSelection();
hconsensus = av.getSequenceConsensusHash();// hconsensus;
hStrucConsensus = av.getRnaStructureConsensusHash(); // hStrucConsensus;
- av_ignoreGapsConsensus = av.getIgnoreGapsConsensus();
+ av_ignoreGapsConsensus = av.isIgnoreGapsConsensus();
}
public int[] getProfileFor(AlignmentAnnotation aa, int column)
return null;
}
+ boolean rna = false;
+
/**
* Render the annotation rows associated with an alignment.
*
AlignmentAnnotation consensusAnnot = av
.getAlignmentConsensusAnnotation(), structConsensusAnnot = av
.getAlignmentStrucConsensusAnnotation();
- boolean renderHistogram = true, renderProfile = true, normaliseProfile = false;
+ boolean renderHistogram = true, renderProfile = true, normaliseProfile = false, isRNA = rna;
BitSet graphGroupDrawn = new BitSet();
int charOffset = 0; // offset for a label
for (int i = 0; i < aa.length; i++)
{
AlignmentAnnotation row = aa[i];
+ isRNA = row.isRNA();
{
// check if this is a consensus annotation row and set the display
// settings appropriately
}
}
}
- 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
charOffset = (int) ((charWidth - fmWidth) / 2f);
if (row_annotations[column].colour == null)
+ {
g.setColor(Color.black);
+ }
else
+ {
g.setColor(row_annotations[column].colour);
+ }
if (column == 0 || row.graph > 0)
{
// System.out.println("\t type :"+lastSS+"\t x :"+x+"\t nbre annot :"+nb_annot);
switch (lastSS)
{
-
- case '$':
- drawHelixAnnot(g, row_annotations, lastSSX, x, y,
- iconOffset, startRes, column, validRes, validEnd);
- break;
-
- case 0xCE:
- drawSheetAnnot(g, row_annotations, lastSSX, x, y,
- iconOffset, startRes, column, validRes, validEnd);
- break;
-
case '(': // Stem case for RNA secondary structure
case ')': // and opposite direction
drawStemAnnot(g, row_annotations, lastSSX, x, y,
iconOffset, startRes, column, validRes, validEnd);
temp = x;
break;
+
+ case 'H':
+ if (!isRNA)
+ {
+ drawHelixAnnot(g, row_annotations, lastSSX, x, y,
+ iconOffset, startRes, column, validRes,
+ validEnd);
+ break;
+ }
+
+ case 'E':
+ if (!isRNA)
+ {
+ drawSheetAnnot(g, row_annotations, lastSSX, x, y,
+ iconOffset, startRes, column, validRes,
+ validEnd);
+ break;
+ }
+
case '{':
case '}':
case '[':
case 'c':
case 'D':
case 'd':
- case 'E':
case 'e':
case 'F':
case 'f':
case 'G':
case 'g':
- case 'H':
case 'h':
case 'I':
case 'i':
{
switch (lastSS)
{
- case '$':
- drawHelixAnnot(g, row_annotations, lastSSX, x, y, iconOffset,
- startRes, column, validRes, validEnd);
- break;
- case '�':
- drawSheetAnnot(g, row_annotations, lastSSX, x, y, iconOffset,
- startRes, column, validRes, validEnd);
- break;
- case 's':
- case 'S': // Stem case for RNA secondary structure
+ case 'H':
+ if (!isRNA)
+ {
+ drawHelixAnnot(g, row_annotations, lastSSX, x, y, iconOffset,
+ startRes, column, validRes, validEnd);
+ break;
+ }
+
+ case 'E':
+ if (!isRNA)
+ {
+ drawSheetAnnot(g, row_annotations, lastSSX, x, y, iconOffset,
+ startRes, column, validRes, validEnd);
+ break;
+ }
+
+ case '(':
+ case ')': // Stem case for RNA secondary structure
drawStemAnnot(g, row_annotations, lastSSX, x, y, iconOffset,
startRes, column, validRes, validEnd);
case 'c':
case 'D':
case 'd':
- case 'E':
case 'e':
case 'F':
case 'f':
case 'G':
case 'g':
- case 'H':
case 'h':
case 'I':
case 'i':
return !usedFaded;
}
- private final Color GLYPHLINE_COLOR = Color.gray;
+ public static final Color GLYPHLINE_COLOR = Color.gray;
- private final Color SHEET_COLOUR = Color.green;
+ public static final Color SHEET_COLOUR = Color.green;
- private final Color HELIX_COLOUR = Color.red;
+ public static final Color HELIX_COLOUR = Color.red;
- private final Color STEM_COLOUR = Color.blue;
+ public static final Color STEM_COLOUR = Color.blue;
private Color sdNOTCANONICAL_COLOUR;
}
if (aa_annotations[column].colour == null)
+ {
g.setColor(Color.black);
+ }
else
+ {
g.setColor(aa_annotations[column].colour);
+ }
y1 = y
- (int) (((aa_annotations[column - 1].value - min) / range) * graphHeight);
continue;
}
if (aa_annotations[column].colour == null)
+ {
g.setColor(Color.black);
+ }
else
+ {
g.setColor(aa_annotations[column].colour);
+ }
y1 = y
- (int) (((aa_annotations[column].value - min) / (range)) * _aa.graphHeight);
if (aa_annotations[j] != null)
{
if (aa_annotations[j].colour == null)
+ {
g.setColor(Color.black);
+ }
else
+ {
g.setColor(aa_annotations[j].colour);
+ }
height = (int) ((aa_annotations[j].value / _aa.graphMax) * y);
if (height > y)