*/
public BuriedColourScheme()
{
- super(ResidueProperties.buried, ResidueProperties.buriedmin,
+ super(ResidueProperties.aaIndex, ResidueProperties.buried, ResidueProperties.buriedmin,
ResidueProperties.buriedmax);
}
{
public HelixColourScheme()
{
- super(ResidueProperties.helix, ResidueProperties.helixmin,
+ super(ResidueProperties.aaIndex, ResidueProperties.helix, ResidueProperties.helixmin,
ResidueProperties.helixmax);
}
*/
public HydrophobicColourScheme()
{
- super(ResidueProperties.hyd, ResidueProperties.hydmin,
+ super(ResidueProperties.aaIndex, ResidueProperties.hyd, ResidueProperties.hydmin,
ResidueProperties.hydmax);
}
*/
public NucleotideColourScheme()
{
- super(ResidueProperties.nucleotide, 0);
+ super(ResidueProperties.nucleotideIndex, ResidueProperties.nucleotide, 0);
}
/**
*/
public PurinePyrimidineColourScheme()
{
- super(ResidueProperties.purinepyrimidine, 0);
+ super(ResidueProperties.purinepyrimidineIndex, ResidueProperties.purinepyrimidine, 0);
}
/**
*/
public class ResidueColourScheme implements ColourSchemeI
{
-
+ final int[] symbolIndex;
boolean conservationColouring = false;
Color[] colors = null;
/**
* Creates a new ResidueColourScheme object.
- *
+ * @param final int[] index table into colors (ResidueProperties.naIndex or ResidueProperties.aaIndex)
* @param colors
- * DOCUMENT ME!
+ * colours for symbols in sequences
* @param threshold
- * DOCUMENT ME!
+ * threshold for conservation shading
*/
- public ResidueColourScheme(Color[] colours, int threshold)
+ public ResidueColourScheme(int[] aaOrnaIndex, Color[] colours, int threshold)
{
+ symbolIndex = aaOrnaIndex;
this.colors = colours;
this.threshold = threshold;
}
/**
- * Creates a new ResidueColourScheme object.
+ * Creates a new ResidueColourScheme object with a lookup table for indexing the colour map
+ */
+ public ResidueColourScheme(int[] aaOrNaIndex)
+ {
+ symbolIndex = aaOrNaIndex;
+ }
+ /**
+ * Creates a new ResidueColourScheme object - default constructor for non-sequence dependent colourschemes
*/
public ResidueColourScheme()
{
+ symbolIndex = null;
}
/**
public Color findColour(char c)
{
return colors == null ? Color.white
- : colors[ResidueProperties.aaIndex[c]];
+ : colors[symbolIndex[c]];
}
@Override
{
Color currentColour;
- if ((threshold == 0) || aboveThreshold(c, j))
+ if (colors!=null && symbolIndex!=null && (threshold == 0) || aboveThreshold(c, j))
{
- currentColour = colors[ResidueProperties.aaIndex[c]];
+ currentColour = colors[symbolIndex[c]];
}
else
{
* @param max
* DOCUMENT ME!
*/
- public ScoreColourScheme(double[] scores, double min, double max)
+ public ScoreColourScheme(int symbolIndex[], double[] scores, double min, double max)
{
- super();
+ super(symbolIndex);
this.scores = scores;
this.min = min;
*/
public StrandColourScheme()
{
- super(ResidueProperties.strand, ResidueProperties.strandmin,
+ super(ResidueProperties.aaIndex, ResidueProperties.strand, ResidueProperties.strandmin,
ResidueProperties.strandmax);
}
{
public TaylorColourScheme()
{
- super(ResidueProperties.taylor, 0);
+ super(ResidueProperties.aaIndex, ResidueProperties.taylor, 0);
}
}
*/
public TurnColourScheme()
{
- super(ResidueProperties.turn, ResidueProperties.turnmin,
+ super(ResidueProperties.aaIndex,ResidueProperties.turn, ResidueProperties.turnmin,
ResidueProperties.turnmax);
}
*/
public ZappoColourScheme()
{
- super(ResidueProperties.zappo, 0);
+ super(ResidueProperties.aaIndex, ResidueProperties.zappo, 0);
}
}