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
Align boxes
[jalview.git]
/
src
/
jalview
/
schemes
/
PIDColourScheme.java
diff --git
a/src/jalview/schemes/PIDColourScheme.java
b/src/jalview/schemes/PIDColourScheme.java
index
9dc4c66
..
8061e67
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) 2006 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
@@
-21,6
+21,7
@@
package jalview.schemes;
import java.awt.*;
\r
\r
import jalview.datamodel.*;
\r
import java.awt.*;
\r
\r
import jalview.datamodel.*;
\r
+import jalview.analysis.AAFrequency;
\r
\r
public class PIDColourScheme
\r
extends ResidueColourScheme
\r
\r
public class PIDColourScheme
\r
extends ResidueColourScheme
\r
@@
-40,40
+41,50
@@
public class PIDColourScheme
char res = s.charAt(0);
\r
if ('a' <= res && res <= 'z')
\r
{
\r
char res = s.charAt(0);
\r
if ('a' <= res && res <= 'z')
\r
{
\r
- s = Character.toString(res -= ('a' - 'A'));
\r
+ s = String.valueOf(res -= ('a' - 'A'));
\r
}
\r
\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(s, j))
\r
{
\r
return Color.white;
\r
}
\r
\r
\r
if ( (threshold != 0) && !aboveThreshold(s, j))
\r
{
\r
return Color.white;
\r
}
\r
\r
-
\r
-
\r
- Color c = Color.white;
\r
+ currentColour = Color.white;
\r
\r
double sc = 0;
\r
\r
\r
double sc = 0;
\r
\r
- if ( (Integer.parseInt(consensus[j].get("maxCount").toString()) != -1) &&
\r
- consensus[j].contains(s))
\r
- {
\r
- sc = ((Float)consensus[j].get(ignoreGaps)).floatValue();
\r
+ if(consensus.length<=j)
\r
+ return Color.white;
\r
\r
\r
- if (!jalview.util.Comparison.isGap( res ))
\r
+ if ( (Integer.parseInt(consensus[j].get(AAFrequency.MAXCOUNT).toString()) != -1) &&
\r
+ consensus[j].contains(s))
\r
{
\r
{
\r
- for (int i = 0; i < thresholds.length; i++)
\r
+ sc = ( (Float) consensus[j].get(ignoreGaps)).floatValue();
\r
+
\r
+ if (!jalview.util.Comparison.isGap(res))
\r
{
\r
{
\r
- if (sc > thresholds[i])
\r
+ for (int i = 0; i < thresholds.length; i++)
\r
{
\r
{
\r
- c = pidColours[i];
\r
+ if (sc > thresholds[i])
\r
+ {
\r
+ currentColour = pidColours[i];
\r
\r
\r
- break;
\r
+ break;
\r
+ }
\r
}
\r
}
\r
}
\r
}
\r
}
\r
}
\r
- }
\r
\r
\r
- return c;
\r
+ if(conservationColouring)
\r
+ applyConservation(j);
\r
+
\r
+ return currentColour;
\r
}
\r
}
\r
}
\r
}
\r