import jalview.datamodel.AnnotatedCollectionI;
import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceI;
+import jalview.util.Comparison;
import java.awt.Color;
import java.util.List;
@Override
protected Color findColour(char c, int j, SequenceI seq)
{
- Color currentColour;
-
// TODO why the test for includeGaps here?
- if (cons2.length <= j
+ if (cons2.length <= j || Comparison.isGap(c)
/*|| (includeGaps && threshold != 0 && !aboveThreshold(c, j))*/)
{
return Color.white;
int i = ResidueProperties.aaIndex[c];
- currentColour = Color.white;
+ Color colour = Color.white;
if (i > 19)
{
- return currentColour;
+ return colour;
}
for (int k = 0; k < residueColour[i].cons.length; k++)
if (residueColour[i].cons[k].isConserved(cons2, j, size,
includeGaps))
{
- currentColour = residueColour[i].c;
+ colour = residueColour[i].c;
}
}
*/
if (conses[27].isConserved(cons2, j, size, includeGaps))
{
- currentColour = ClustalColour.PINK.colour;
+ colour = ClustalColour.PINK.colour;
}
}
- return currentColour;
+ return colour;
}
/**
import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceI;
-import java.awt.Color;
import java.util.Map;
/**
super(ResidueProperties.nucleotideIndex, ResidueProperties.nucleotide);
}
- /**
- * DOCUMENT ME!
- *
- * @param n
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- @Override
- public Color findColour(char c)
- {
- return colors[ResidueProperties.nucleotideIndex[c]];
- }
-
@Override
public boolean isNucleotideSpecific()
{
c -= ('a' - 'A');
}
- if (consensusResidue == null)
+ if (consensusResidue == null || Comparison.isGap(c))
{
return Color.white;
}
String.valueOf(c));
if (matchesConsensus)
{
- if (!Comparison.isGap(c))
+ for (int i = 0; i < thresholds.length; i++)
{
- for (int i = 0; i < thresholds.length; i++)
+ if (pid > thresholds[i])
{
- if (pid > thresholds[i])
- {
- colour = pidColours[i];
- break;
- }
+ colour = pidColours[i];
+ break;
}
}
}
import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceI;
-import java.awt.Color;
import java.util.Map;
/**
ResidueProperties.purinepyrimidine);
}
- /**
- * Finds the corresponding color for the type of character inputed
- *
- * @param c
- * Character in sequence
- *
- * @return Color from purinepyrimidineIndex in
- * jalview.schemes.ResidueProperties
- */
- @Override
- public Color findColour(char c)
- {
- return colors[ResidueProperties.purinepyrimidineIndex[c]];
- }
-
@Override
public boolean isNucleotideSpecific()
{
import jalview.datamodel.AnnotatedCollectionI;
import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceI;
+import jalview.util.Comparison;
import java.awt.Color;
import java.util.Map;
@Override
public Color findColour(char c)
{
- return colors == null ? Color.white : colors[symbolIndex[c]];
+ Color colour = Color.white;
+
+ if (!Comparison.isGap(c) && colors != null && symbolIndex != null
+ && c < symbolIndex.length
+ && symbolIndex[c] < colors.length)
+ {
+ colour = colors[symbolIndex[c]];
+ }
+
+ return colour;
}
/**
return findColour(c, j, seq);
}
+ /**
+ * Default implementation looks up the residue colour in a fixed scheme, or
+ * returns White if not found. Override this method for a colour scheme that
+ * depends on the column position or sequence.
+ *
+ * @param c
+ * @param j
+ * @param seq
+ * @return
+ */
protected Color findColour(char c, int j, SequenceI seq)
{
- Color colour = Color.white;
-
- if (colors != null && symbolIndex != null && c < symbolIndex.length
- && symbolIndex[c] < colors.length)
- {
- colour = colors[symbolIndex[c]];
- }
- // colour = adjustColour(c, j, colour);
-
- return colour;
+ return findColour(c);
}
@Override
import jalview.datamodel.AnnotatedCollectionI;
import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceI;
-import jalview.util.Comparison;
import java.awt.Color;
import java.util.Map;
/**
* DOCUMENT ME!
*
- * @param s
- * DOCUMENT ME!
- * @param j
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- @Override
- public Color findColour(char c, int j, SequenceI seq)
- {
- if (Comparison.isGap(c))
- {
- return Color.white;
- }
-
- return colors[ResidueProperties.aaIndex[c]];
- }
-
- /**
- * DOCUMENT ME!
- *
* @param c
* DOCUMENT ME!
*
}
- @Override
- public Color findColour(char c, int j, SequenceI seq)
- {
- Color colour;
- int index = ResidueProperties.aaIndex[c];
-
- if (lowerCaseColours != null && 'a' <= c && c <= 'z')
- {
- colour = lowerCaseColours[index];
- }
- else
- {
- colour = colors[index];
- }
-
- return colour;
- }
-
public void setLowerCaseColours(Color[] lcolours)
{
lowerCaseColours = lcolours;