*/
package jalview.schemes;
-import java.awt.*;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.GraphLine;
-import jalview.datamodel.*;
+import java.awt.Color;
public class AnnotationColourGradient extends ResidueColourScheme
{
*
* @return DOCUMENT ME!
*/
- public Color findColour(char c, int j)
+ @Override
+ public Color findColour(char c, int j, int sequenceIndex)
{
Color currentColour = Color.white;
if (colourScheme != null)
{
- currentColour = colourScheme.findColour(c, j);
+ currentColour = colourScheme.findColour(c, j, sequenceIndex);
}
else if (range != 0)
{
*/
package jalview.schemes;
-import java.awt.*;
+import jalview.analysis.AAFrequency;
-import jalview.analysis.*;
+import java.awt.Color;
public class Blosum62ColourScheme extends ResidueColourScheme
{
super();
}
- public Color findColour(char res, int j)
+ @Override
+ public Color findColour(char res, int j, int sequenceIndex)
{
if ('a' <= res && res <= 'z')
{
*/
package jalview.schemes;
-import java.util.*;
+import jalview.datamodel.SequenceI;
-import java.awt.*;
-
-import jalview.datamodel.*;
+import java.awt.Color;
+import java.util.Hashtable;
+import java.util.Vector;
public class ClustalxColourScheme extends ResidueColourScheme // implements
// IParameterizable
ResidueColour[19] = colours[0]; // V
}
+ @Override
public Color findColour(char c)
{
return Color.pink;
}
- public Color findColour(char c, int j)
+ @Override
+ public Color findColour(char c, int j, int sequenceIndex)
{
Color currentColour;
*/
package jalview.schemes;
-import java.awt.*;
+import java.awt.Color;
public interface ColourSchemeI
{
public Color findColour(char c);
- public Color findColour(char c, int j);
+ public Color findColour(char c, int j, int sequenceIndex);
public void setConsensus(java.util.Hashtable[] h);
*/
package jalview.schemes;
-import java.awt.*;
+import java.awt.Color;
/**
* ColourSchemeProperty Binds names to hardwired colourschemes and tries to deal
public static final int PURINEPYRIMIDINE = 13;
public static final int COVARIATION = 14;
+
+ public static final int TCOFFEE = 15;
+
/**
* index of first colourscheme (includes 'None')
{
ret = NUCLEOTIDE;
}
+ else if (name.equalsIgnoreCase("T-Coffee scores"))
+ {
+ ret = TCOFFEE;
+ }
+
else if (name.equalsIgnoreCase("User Defined"))
{
ret = USER_DEFINED;
*/
package jalview.schemes;
-import java.awt.*;
+import java.awt.Color;
/**
* DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
+ @Override
public Color findColour(char c)
{
// System.out.println("called"); log.debug
*
* @return DOCUMENT ME!
*/
- public Color findColour(char c, int j)
+ @Override
+ public Color findColour(char c, int j, int sequenceIndex)
{
Color currentColour;
if ((threshold == 0) || aboveThreshold(c, j))
*/
package jalview.schemes;
-import java.awt.*;
+import jalview.analysis.AAFrequency;
+import jalview.datamodel.SequenceGroup;
-import jalview.analysis.*;
-import jalview.datamodel.*;
+import java.awt.Color;
public class PIDColourScheme extends ResidueColourScheme
{
this.thresholds = ResidueProperties.pidThresholds;
}
- public Color findColour(char c, int j)
+
+ @Override
+ public Color findColour(char c, int j, int sequenceIndex)
{
if ('a' <= c && c <= 'z')
{
*/
package jalview.schemes;
-import java.util.*;
+import jalview.analysis.AAFrequency;
+import jalview.analysis.Conservation;
-import java.awt.*;
-
-import jalview.analysis.*;
+import java.awt.Color;
+import java.util.Hashtable;
/**
* DOCUMENT ME!
: colors[ResidueProperties.aaIndex[c]];
}
- public Color findColour(char c, int j)
+ @Override
+ public Color findColour(char c, int j, int sequenceIndex)
{
Color currentColour;
*/
package jalview.schemes;
-import java.awt.*;
+import java.awt.Color;
/**
* DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
- public Color findColour(char c, int j)
+ @Override
+ public Color findColour(char c, int j, int sequenceIndex)
{
if (threshold > 0)
{
--- /dev/null
+package jalview.schemes;
+
+import jalview.io.TCoffeeScoreFile;
+
+import java.awt.Color;
+
+/**
+ * Defines the color score for T-Coffee MSA
+ * <p>
+ * See http://tcoffee.org
+ *
+ *
+ * @author Paolo Di Tommaso
+ *
+ */
+public class TCoffeeColourScheme extends ResidueColourScheme {
+
+ static final Color[] colors = {
+ new Color( 102, 102, 255 ), // #6666FF
+ new Color( 0, 255, 0), // #00FF00
+ new Color( 102, 255, 0), // #66FF00
+ new Color( 204, 255, 0), // #CCFF00
+ new Color( 255, 255, 0), // #FFFF00
+ new Color( 255, 204, 0), // #FFCC00
+ new Color( 255, 153, 0), // #FF9900
+ new Color( 255, 102, 0), // #FF6600
+ new Color( 255, 51, 0), // #FF3300
+ new Color( 255, 34, 0) // #FF2000
+ };
+
+
+ byte[][] scoreMatrix = null;
+
+ /**
+ * Initialize the color sheme based on the content of the T-Coffee score file
+ *
+ * @param scoreFile
+ */
+ public TCoffeeColourScheme(TCoffeeScoreFile scoreFile) {
+
+ scoreMatrix = scoreFile != null ? scoreFile.getScoresArray() : null;
+
+ }
+
+ @Override
+ public Color findColour(char c, int j, int sequenceIndex) {
+
+ if( scoreMatrix == null ) {
+ return Color.white;
+ }
+
+ if( sequenceIndex<0 || sequenceIndex >= scoreMatrix.length ) {
+ System.out.printf("Sequence index out of range for the T-Coffee color scheme. Index: %s\n", sequenceIndex);
+ return Color.white;
+ }
+
+ byte[] seqScores = scoreMatrix[sequenceIndex];
+ if( j < 0 || j>= seqScores.length ) {
+ System.out.printf("Residue index out of range for the T-Coffee color scheme. Sequence %s - residue: %s\n", sequenceIndex, j);
+ return Color.white;
+ }
+
+ byte val = seqScores[j];
+ return val >= 0 && val < colors.length ? colors[val] : Color.white;
+ }
+}
*/
package jalview.schemes;
-import java.util.*;
-
-import java.awt.*;
+import java.awt.Color;
+import java.util.StringTokenizer;
public class UserColourScheme extends ResidueColourScheme
{
}
- public Color findColour(char c, int j)
+ @Override
+ public Color findColour(char c, int j, int sequenceIndex)
{
Color currentColour;
int index = ResidueProperties.aaIndex[c];