*/
package jalview.analysis;
+import java.awt.Color;
+import java.util.List;
import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.Vector;
import jalview.analysis.scoremodels.ScoreMatrix;
import jalview.analysis.scoremodels.ScoreModels;
+import jalview.bin.Cache;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Annotation;
import jalview.datamodel.ResidueCount;
import jalview.util.Comparison;
import jalview.util.Format;
-import java.awt.Color;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.SortedMap;
-import java.util.TreeMap;
-import java.util.Vector;
-
/**
* Calculates conservation values for a given set of sequences
*/
*/
private static final int THRESHOLD_PERCENT = 3;
+ public static final String THRESHOLD_PERCENT_PREFERENCE = "CONSERVATION_THRESHOLD_PERCENT";
+
+ public static final String CONSERVATION_GAP_PERCENT_PREFERENCE = "CONSERVATION_GAP_PERCENT";
+
private static final int TOUPPERCASE = 'a' - 'A';
private static final int GAP_INDEX = -1;
public Conservation(String name, List<SequenceI> sequences, int start,
int end)
{
- this(name, THRESHOLD_PERCENT, sequences, start, end);
+ this(name, Cache.getDefault(THRESHOLD_PERCENT_PREFERENCE,
+ THRESHOLD_PERCENT), sequences, start, end);
}
/**
total = new Map[maxLength];
+ /*
+ * percentage count at or below which we ignore residues
+ */
+ int thresh = (threshold * height) / 100;
for (int column = start; column <= end; column++)
{
ResidueCount values = countResidues(column);
/*
- * percentage count at or below which we ignore residues
- */
- int thresh = (threshold * height) / 100;
-
- /*
* check observed residues in column and record whether each
* physico-chemical property is conserved (+1), absence conserved (0),
* or not conserved (-1)
import jalview.api.AlignmentViewPanel;
import jalview.api.FeaturesDisplayedI;
import jalview.api.ViewStyleI;
+import jalview.bin.Cache;
import jalview.bin.Console;
import jalview.commands.CommandI;
import jalview.datamodel.AlignedCodonFrame;
@Override
public int getConsPercGaps()
{
- return ConsPercGaps;
+ return Cache.getDefault(
+ Conservation.CONSERVATION_GAP_PERCENT_PREFERENCE, ConsPercGaps);
}
@Override