*/
package jalview.schemes;
-import jalview.analysis.AAFrequency;
import jalview.analysis.Conservation;
+import jalview.analysis.Profile;
import jalview.datamodel.AnnotatedCollectionI;
import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceI;
import jalview.util.MessageManager;
import java.awt.Color;
-import java.util.Hashtable;
import java.util.Map;
/**
int threshold = 0;
/* Set when threshold colouring to either pid_gaps or pid_nogaps */
- protected String ignoreGaps = AAFrequency.PID_GAPS;
+ protected boolean ignoreGaps = false;
/** Consenus as a hashtable array */
- Hashtable[] consensus;
+ Profile[] consensus;
/** Conservation string as a char array */
char[] conservation;
/**
* Find a colour without an index in a sequence
*/
+ @Override
public Color findColour(char c)
{
return colors == null ? Color.white : colors[symbolIndex[c]];
*
* @return Returns the percentage threshold
*/
+ @Override
public int getThreshold()
{
return threshold;
* @param ct
* DOCUMENT ME!
*/
+ @Override
public void setThreshold(int ct, boolean ignoreGaps)
{
threshold = ct;
- if (ignoreGaps)
- {
- this.ignoreGaps = AAFrequency.PID_NOGAPS;
- }
- else
- {
- this.ignoreGaps = AAFrequency.PID_GAPS;
- }
+ this.ignoreGaps = ignoreGaps;
}
/**
return false;
}
- if ((((Integer) consensus[j].get(AAFrequency.MAXCOUNT)).intValue() != -1)
- && consensus[j].contains(String.valueOf(c)))
+ if (consensus[j].getMaxCount() > 0) // != -1))
{
- if (((Float) consensus[j].get(ignoreGaps)).floatValue() >= threshold)
+ if (consensus[j].getPercentageIdentity(ignoreGaps) >= threshold)
{
return true;
}
return false;
}
+ @Override
public boolean conservationApplied()
{
return conservationColouring;
conservationColouring = conservationApplied;
}
+ @Override
public void setConservationInc(int i)
{
inc = i;
}
+ @Override
public int getConservationInc()
{
return inc;
* @param consensus
* DOCUMENT ME!
*/
- public void setConsensus(Hashtable[] consensus)
+ @Override
+ public void setConsensus(Profile[] consensus)
{
if (consensus == null)
{
this.consensus = consensus;
}
+ @Override
public void setConservation(Conservation cons)
{
if (cons == null)