git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor change to output of main method for testing file IO
[jalview.git]
/
src
/
jalview
/
schemes
/
PIDColourScheme.java
diff --git
a/src/jalview/schemes/PIDColourScheme.java
b/src/jalview/schemes/PIDColourScheme.java
index
cfc9f94
..
e1dbf46
100755
(executable)
--- a/
src/jalview/schemes/PIDColourScheme.java
+++ b/
src/jalview/schemes/PIDColourScheme.java
@@
-1,6
+1,6
@@
/*
\r
* Jalview - A Sequence Alignment Editor and Viewer
\r
/*
\r
* Jalview - A Sequence Alignment Editor and Viewer
\r
- * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
+ * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
*
\r
* This program is free software; you can redistribute it and/or
\r
* modify it under the terms of the GNU General Public License
\r
*
\r
* This program is free software; you can redistribute it and/or
\r
* modify it under the terms of the GNU General Public License
\r
@@
-18,10
+18,9
@@
*/
\r
package jalview.schemes;
\r
\r
*/
\r
package jalview.schemes;
\r
\r
-import java.util.*;
\r
-
\r
import java.awt.*;
\r
\r
import java.awt.*;
\r
\r
+import jalview.analysis.*;
\r
import jalview.datamodel.*;
\r
\r
public class PIDColourScheme
\r
import jalview.datamodel.*;
\r
\r
public class PIDColourScheme
\r
@@
-37,33
+36,47
@@
public class PIDColourScheme
this.thresholds = ResidueProperties.pidThresholds;
\r
}
\r
\r
this.thresholds = ResidueProperties.pidThresholds;
\r
}
\r
\r
- public Color findColour(String s, int j)
\r
+ public Color findColour(char c, int j)
\r
{
\r
{
\r
- if ( (threshold != 0) && !aboveThreshold(s, j))
\r
+ if ('a' <= c && c <= 'z')
\r
+ {
\r
+ c -= ('a' - 'A');
\r
+ }
\r
+
\r
+ if (consensus == null
\r
+ || j >= consensus.length
\r
+ || consensus[j] == null)
\r
+ {
\r
+ return Color.white;
\r
+ }
\r
+
\r
+ if ( (threshold != 0) && !aboveThreshold(c, j))
\r
{
\r
return Color.white;
\r
}
\r
\r
{
\r
return Color.white;
\r
}
\r
\r
- Color c = Color.white;
\r
- Hashtable hash = (Hashtable) consensus.elementAt(j);
\r
+ Color currentColour = Color.white;
\r
\r
double sc = 0;
\r
\r
\r
double sc = 0;
\r
\r
- if ( (Integer.parseInt(hash.get("maxCount").toString()) != -1) &&
\r
- hash.contains(s))
\r
+ if (consensus.length <= j)
\r
{
\r
{
\r
- sc = ( ( (Integer) hash.get(s)).intValue() * 100.0) /
\r
- ( (Integer) hash.get(
\r
- "size")).intValue();
\r
+ return Color.white;
\r
+ }
\r
+
\r
+ if ( (Integer.parseInt(consensus[j].get(AAFrequency.MAXCOUNT).toString()) !=
\r
+ -1) &&
\r
+ consensus[j].contains(String.valueOf(c)))
\r
+ {
\r
+ sc = ( (Float) consensus[j].get(ignoreGaps)).floatValue();
\r
\r
\r
- // MC Should be isGap
\r
- if (!jalview.util.Comparison.isGap( (s.charAt(0))))
\r
+ if (!jalview.util.Comparison.isGap(c))
\r
{
\r
for (int i = 0; i < thresholds.length; i++)
\r
{
\r
if (sc > thresholds[i])
\r
{
\r
{
\r
for (int i = 0; i < thresholds.length; i++)
\r
{
\r
if (sc > thresholds[i])
\r
{
\r
- c = pidColours[i];
\r
+ currentColour = pidColours[i];
\r
\r
break;
\r
}
\r
\r
break;
\r
}
\r
@@
-71,6
+84,11
@@
public class PIDColourScheme
}
\r
}
\r
\r
}
\r
}
\r
\r
- return c;
\r
+ if (conservationColouring)
\r
+ {
\r
+ currentColour = applyConservation(currentColour, j);
\r
+ }
\r
+
\r
+ return currentColour;
\r
}
\r
}
\r
}
\r
}
\r