import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
-import jalview.schemes.CollectionColourSchemeI;
+import jalview.renderer.ResidueShaderI;
import jalview.schemes.ColourSchemeI;
import java.awt.Color;
ColourSchemeI getGlobalColourScheme();
- CollectionColourSchemeI getViewportColourScheme();
+ ResidueShaderI getViewportColourScheme();
AlignmentI getAlignment();
import jalview.io.FileFormatI;
import jalview.io.FileFormats;
import jalview.io.SequenceAnnotationReport;
+import jalview.renderer.ResidueShader;
+import jalview.renderer.ResidueShaderI;
import jalview.schemes.Blosum62ColourScheme;
import jalview.schemes.BuriedColourScheme;
import jalview.schemes.ClustalxColourScheme;
-import jalview.schemes.CollectionColourScheme;
-import jalview.schemes.CollectionColourSchemeI;
import jalview.schemes.HelixColourScheme;
import jalview.schemes.HydrophobicColourScheme;
import jalview.schemes.JalviewColourScheme;
*
* @param cs
*/
- protected void setSelectedColour(CollectionColourSchemeI cs)
+ protected void setSelectedColour(ResidueShaderI cs)
{
if (cs == null || cs.getColourScheme() == null)
{
protected void clustalColour_actionPerformed()
{
SequenceGroup sg = getGroup();
- sg.cs = new CollectionColourScheme(new ClustalxColourScheme(sg,
+ sg.cs = new ResidueShader(new ClustalxColourScheme(sg,
ap.av.getHiddenRepSequences()));
refresh();
}
protected void zappoColour_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(new ZappoColourScheme());
+ getGroup().cs = new ResidueShader(new ZappoColourScheme());
refresh();
}
protected void taylorColour_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(new TaylorColourScheme());
+ getGroup().cs = new ResidueShader(new TaylorColourScheme());
refresh();
}
protected void hydrophobicityColour_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(new HydrophobicColourScheme());
+ getGroup().cs = new ResidueShader(new HydrophobicColourScheme());
refresh();
}
protected void helixColour_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(new HelixColourScheme());
+ getGroup().cs = new ResidueShader(new HelixColourScheme());
refresh();
}
protected void strandColour_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(new StrandColourScheme());
+ getGroup().cs = new ResidueShader(new StrandColourScheme());
refresh();
}
protected void turnColour_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(new TurnColourScheme());
+ getGroup().cs = new ResidueShader(new TurnColourScheme());
refresh();
}
protected void buriedColour_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(new BuriedColourScheme());
+ getGroup().cs = new ResidueShader(new BuriedColourScheme());
refresh();
}
public void nucleotideMenuItem_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(new NucleotideColourScheme());
+ getGroup().cs = new ResidueShader(new NucleotideColourScheme());
refresh();
}
public void purinePyrimidineColour_actionPerformed()
{
- getGroup().cs = new CollectionColourScheme(
+ getGroup().cs = new ResidueShader(
new PurinePyrimidineColourScheme());
refresh();
}
protected void PIDColour_actionPerformed()
{
SequenceGroup sg = getGroup();
- sg.cs = new CollectionColourScheme(new PIDColourScheme());
+ sg.cs = new ResidueShader(new PIDColourScheme());
sg.cs.setConsensus(AAFrequency.calculate(sg.getSequences(ap.av
.getHiddenRepSequences()), 0, ap.av.getAlignment().getWidth()));
refresh();
{
SequenceGroup sg = getGroup();
- sg.cs = new CollectionColourScheme(new Blosum62ColourScheme());
+ sg.cs = new ResidueShader(new Blosum62ColourScheme());
sg.cs.setConsensus(AAFrequency.calculate(sg.getSequences(ap.av
.getHiddenRepSequences()), 0, ap.av.getAlignment().getWidth()));
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
-import jalview.schemes.CollectionColourScheme;
+import jalview.renderer.ResidueShader;
import jalview.schemes.ColourSchemeProperty;
import jalview.schemes.UserColourScheme;
import jalview.structure.CommandListener;
if (colour != null)
{
- globalColourScheme = new CollectionColourScheme(
+ globalColourScheme = new ResidueShader(
ColourSchemeProperty.getColourScheme(alignment, colour));
if (globalColourScheme != null)
{
if (applet.getParameter("userDefinedColour") != null)
{
- globalColourScheme = new CollectionColourScheme(
+ globalColourScheme = new ResidueShader(
new UserColourScheme(
applet.getParameter("userDefinedColour")));
}
import jalview.api.FeatureRenderer;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
-import jalview.schemes.CollectionColourSchemeI;
+import jalview.renderer.ResidueShaderI;
import java.awt.Color;
import java.awt.Font;
return col;
}
- void getBoxColour(CollectionColourSchemeI collectionColourSchemeI,
- SequenceI seq, int i)
+ void getBoxColour(ResidueShaderI shader, SequenceI seq, int i)
{
- if (collectionColourSchemeI != null)
+ if (shader != null)
{
- resBoxColour = collectionColourSchemeI.findColour(seq.getCharAt(i),
- i, seq);
+ resBoxColour = shader.findColour(seq.getCharAt(i), i, seq);
}
else if (forOverview
&& !jalview.util.Comparison.isGap(seq.getCharAt(i)))
package jalview.appletgui;
import jalview.datamodel.SequenceGroup;
-import jalview.schemes.CollectionColourSchemeI;
+import jalview.renderer.ResidueShaderI;
import jalview.util.MessageManager;
import java.awt.BorderLayout;
boolean forConservation = true;
- CollectionColourSchemeI cs;
+ ResidueShaderI cs;
static Frame conservationSlider;
static Frame PIDSlider;
public static int setConservationSlider(AlignmentPanel ap,
- CollectionColourSchemeI ccs, String source)
+ ResidueShaderI ccs, String source)
{
SliderPanel sp = null;
}
public static int setPIDSliderSource(AlignmentPanel ap,
- CollectionColourSchemeI ccs, String source)
+ ResidueShaderI ccs, String source)
{
SliderPanel pid = null;
if (PIDSlider == null)
}
}
public SliderPanel(AlignmentPanel ap, int value, boolean forConserve,
- CollectionColourSchemeI collectionColourSchemeI)
+ ResidueShaderI shader)
{
try
{
e.printStackTrace();
}
this.ap = ap;
- this.cs = collectionColourSchemeI;
+ this.cs = shader;
forConservation = forConserve;
undoButton.setVisible(false);
applyButton.setVisible(false);
return;
}
- CollectionColourSchemeI toChange = cs;
+ ResidueShaderI toChange = cs;
Iterator<SequenceGroup> allGroups = null;
if (allGroupsCheck.getState())
import jalview.api.FeatureColourI;
import jalview.datamodel.SequenceGroup;
-import jalview.schemes.CollectionColourScheme;
+import jalview.renderer.ResidueShader;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.FeatureColour;
import jalview.schemes.ResidueProperties;
{
if (seqGroup != null)
{
- seqGroup.cs = new CollectionColourScheme(ucs);
+ seqGroup.cs = new ResidueShader(ucs);
seqGroup.getGroupColourScheme().setThreshold(0,
ap.av.isIgnoreGapsConsensus());
}
{
if (seqGroup != null)
{
- seqGroup.cs = new CollectionColourScheme(ucs);
+ seqGroup.cs = new ResidueShader(ucs);
}
else
{
import jalview.analysis.AAFrequency;
import jalview.analysis.Conservation;
-import jalview.schemes.CollectionColourScheme;
-import jalview.schemes.CollectionColourSchemeI;
+import jalview.renderer.ResidueShader;
+import jalview.renderer.ResidueShaderI;
import jalview.schemes.ColourSchemeI;
import java.awt.Color;
/**
* Colourscheme applied to group if any
*/
- public CollectionColourSchemeI cs;
+ public ResidueShaderI cs;
// start column (base 0)
int startRes = 0;
public SequenceGroup()
{
groupName = "JGroup:" + this.hashCode();
- cs = new CollectionColourScheme();
+ cs = new ResidueShader();
}
/**
this.displayBoxes = displayBoxes;
this.displayText = displayText;
this.colourText = colourText;
- this.cs = new CollectionColourScheme(scheme);
+ this.cs = new ResidueShader(scheme);
startRes = start;
endRes = end;
recalcConservation();
{
if (cs == null)
{
- cs = new CollectionColourScheme();
+ cs = new ResidueShader();
}
cs.setColourScheme(scheme);
}
- public void setGroupColourScheme(CollectionColourSchemeI scheme)
+ public void setGroupColourScheme(ResidueShaderI scheme)
{
cs = scheme;
}
return cs == null ? null : cs.getColourScheme();
}
- public CollectionColourSchemeI getGroupColourScheme()
+ public ResidueShaderI getGroupColourScheme()
{
return cs;
}
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
-import jalview.schemes.CollectionColourScheme;
+import jalview.renderer.ResidueShader;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.ColourSchemeProperty;
import jalview.schemes.UserColourScheme;
{
ColourSchemeI colourScheme = ColourSchemeProperty.getColourScheme(
alignment, propertyValue);
- globalColourScheme = new CollectionColourScheme(colourScheme);
+ globalColourScheme = new ResidueShader(colourScheme);
if (colourScheme instanceof UserColourScheme)
{
- globalColourScheme = new CollectionColourScheme(
+ globalColourScheme = new ResidueShader(
UserDefinedColours.loadDefaultColours());
globalColourScheme.setThreshold(0, isIgnoreGapsConsensus());
}
import jalview.gui.StructureViewer.ViewerType;
import jalview.io.DataSourceType;
import jalview.io.FileFormat;
+import jalview.renderer.ResidueShaderI;
import jalview.schemabinding.version2.AlcodMap;
import jalview.schemabinding.version2.AlcodonFrame;
import jalview.schemabinding.version2.Annotation;
import jalview.schemabinding.version2.UserColours;
import jalview.schemabinding.version2.Viewport;
import jalview.schemes.AnnotationColourGradient;
-import jalview.schemes.CollectionColourSchemeI;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.ColourSchemeProperty;
import jalview.schemes.FeatureColour;
ColourSchemeI colourScheme = sg.getColourScheme();
if (colourScheme != null)
{
- CollectionColourSchemeI groupColourScheme = sg
+ ResidueShaderI groupColourScheme = sg
.getGroupColourScheme();
if (groupColourScheme.conservationApplied())
{
.getGlobalColourScheme()));
}
- CollectionColourSchemeI vcs = av.getViewportColourScheme();
+ ResidueShaderI vcs = av.getViewportColourScheme();
ColourSchemeI cs = av.getGlobalColourScheme();
if (cs != null)
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.io.SequenceAnnotationReport;
-import jalview.schemes.CollectionColourSchemeI;
+import jalview.renderer.ResidueShaderI;
import jalview.schemes.ResidueProperties;
import jalview.structure.SelectionListener;
import jalview.structure.SelectionSource;
stretchGroup.cs.alignmentChanged(stretchGroup,
av.getHiddenRepSequences());
- CollectionColourSchemeI groupColourScheme = stretchGroup.getGroupColourScheme();
+ ResidueShaderI groupColourScheme = stretchGroup.getGroupColourScheme();
String name = stretchGroup.getName();
if (stretchGroup.cs.conservationApplied())
{
import jalview.api.FeatureRenderer;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
-import jalview.schemes.CollectionColourSchemeI;
+import jalview.renderer.ResidueShaderI;
import jalview.util.Comparison;
import java.awt.Color;
/**
* DOCUMENT ME!
*
- * @param collectionColourSchemeI
+ * @param shader
* DOCUMENT ME!
* @param seq
* DOCUMENT ME!
* @param i
* DOCUMENT ME!
*/
- void getBoxColour(CollectionColourSchemeI collectionColourSchemeI,
- SequenceI seq, int i)
+ void getBoxColour(ResidueShaderI shader, SequenceI seq, int i)
{
- if (collectionColourSchemeI != null)
+ if (shader != null)
{
- resBoxColour = collectionColourSchemeI.findColour(seq.getCharAt(i),
+ resBoxColour = shader.findColour(seq.getCharAt(i),
i, seq);
}
else if (forOverview && !Comparison.isGap(seq.getCharAt(i)))
import jalview.datamodel.SequenceGroup;
import jalview.jbgui.GSliderPanel;
-import jalview.schemes.CollectionColourSchemeI;
+import jalview.renderer.ResidueShaderI;
import jalview.util.MessageManager;
import java.awt.event.MouseAdapter;
boolean forConservation = true;
- CollectionColourSchemeI cs;
+ ResidueShaderI cs;
private static SliderPanel sliderPanel;
* DOCUMENT ME!
*/
public SliderPanel(final AlignmentPanel ap, int value,
- boolean forConserve, CollectionColourSchemeI scheme)
+ boolean forConserve, ResidueShaderI scheme)
{
this.ap = ap;
this.cs = scheme;
* @return DOCUMENT ME!
*/
public static int setConservationSlider(AlignmentPanel ap,
- CollectionColourSchemeI ccs, String source)
+ ResidueShaderI ccs, String source)
{
sliderPanel = null;
* @return DOCUMENT ME!
*/
public static int setPIDSliderSource(AlignmentPanel ap,
- CollectionColourSchemeI ccs, String source)
+ ResidueShaderI ccs, String source)
{
int threshold = ccs.getThreshold();
* @param percent
* @param scheme
*/
- protected void updateColourScheme(int percent, CollectionColourSchemeI scheme)
+ protected void updateColourScheme(int percent, ResidueShaderI scheme)
{
if (scheme == null)
{
import jalview.datamodel.Annotation;
import jalview.datamodel.ColumnSelection;
import jalview.datamodel.ProfilesI;
-import jalview.schemes.CollectionColourScheme;
-import jalview.schemes.CollectionColourSchemeI;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.NucleotideColourScheme;
import jalview.schemes.ResidueProperties;
boolean av_renderHistogram = true, av_renderProfile = true,
av_normaliseProfile = false;
- CollectionColourSchemeI profcolour = null;
+ ResidueShaderI profcolour = null;
private ColumnSelection columnSelection;
*/
ColourSchemeI col = av.getAlignment().isNucleotide() ? new NucleotideColourScheme()
: new ZappoColourScheme();
- profcolour = new CollectionColourScheme(col);
+ profcolour = new ResidueShader(col);
}
columnSelection = av.getColumnSelection();
hconsensus = av.getSequenceConsensusHash();
-package jalview.schemes;
+package jalview.renderer;
import jalview.analysis.Conservation;
import jalview.datamodel.AnnotatedCollectionI;
import jalview.datamodel.ProfilesI;
import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceI;
+import jalview.schemes.ColourSchemeI;
import jalview.util.ColorUtils;
import jalview.util.Comparison;
* @author gmcarstairs
*
*/
-public class CollectionColourScheme implements CollectionColourSchemeI
+public class ResidueShader implements ResidueShaderI
{
private ColourSchemeI colourScheme;
private int inc;
- public CollectionColourScheme(ColourSchemeI cs)
+ public ResidueShader(ColourSchemeI cs)
{
colourScheme = cs;
}
/**
* Default constructor
*/
- public CollectionColourScheme()
+ public ResidueShader()
{
}
/**
- * @see jalview.schemes.CollectionColourSchemeI#setConsensus(jalview.datamodel.ProfilesI)
+ * @see jalview.renderer.ResidueShaderI#setConsensus(jalview.datamodel.ProfilesI)
*/
@Override
public void setConsensus(ProfilesI cons)
}
/**
- * @see jalview.schemes.CollectionColourSchemeI#conservationApplied()
+ * @see jalview.renderer.ResidueShaderI#conservationApplied()
*/
@Override
public boolean conservationApplied()
}
/**
- * @see jalview.schemes.CollectionColourSchemeI#setConservationApplied(boolean)
+ * @see jalview.renderer.ResidueShaderI#setConservationApplied(boolean)
*/
@Override
public void setConservationApplied(boolean conservationApplied)
}
/**
- * @see jalview.schemes.CollectionColourSchemeI#setConservation(jalview.analysis.Conservation)
+ * @see jalview.renderer.ResidueShaderI#setConservation(jalview.analysis.Conservation)
*/
@Override
public void setConservation(Conservation cons)
}
/**
- * @see jalview.schemes.CollectionColourSchemeI#alignmentChanged(jalview.datamodel.AnnotatedCollectionI,
+ * @see jalview.renderer.ResidueShaderI#alignmentChanged(jalview.datamodel.AnnotatedCollectionI,
* java.util.Map)
*/
@Override
}
/**
- * @see jalview.schemes.CollectionColourSchemeI#setThreshold(int, boolean)
+ * @see jalview.renderer.ResidueShaderI#setThreshold(int, boolean)
*/
@Override
public void setThreshold(int consensusThreshold, boolean ignoreGaps)
}
/**
- * @see jalview.schemes.CollectionColourSchemeI#setConservationInc(int)
+ * @see jalview.renderer.ResidueShaderI#setConservationInc(int)
*/
@Override
public void setConservationInc(int i)
}
/**
- * @see jalview.schemes.CollectionColourSchemeI#getConservationInc()
+ * @see jalview.renderer.ResidueShaderI#getConservationInc()
*/
@Override
public int getConservationInc()
}
/**
- * @see jalview.schemes.CollectionColourSchemeI#getThreshold()
+ * @see jalview.renderer.ResidueShaderI#getThreshold()
*/
@Override
public int getThreshold()
}
/**
- * @see jalview.schemes.CollectionColourSchemeI#findColour(char, int,
+ * @see jalview.renderer.ResidueShaderI#findColour(char, int,
* jalview.datamodel.SequenceI)
*/
@Override
}
/**
- * @see jalview.schemes.CollectionColourSchemeI#getColourScheme()
+ * @see jalview.renderer.ResidueShaderI#getColourScheme()
*/
@Override
public ColourSchemeI getColourScheme()
}
/**
- * @see jalview.schemes.CollectionColourSchemeI#setColourScheme(jalview.schemes.ColourSchemeI)
+ * @see jalview.renderer.ResidueShaderI#setColourScheme(jalview.schemes.ColourSchemeI)
*/
@Override
public void setColourScheme(ColourSchemeI cs)
-package jalview.schemes;
+package jalview.renderer;
import jalview.analysis.Conservation;
import jalview.datamodel.AnnotatedCollectionI;
import jalview.datamodel.ProfilesI;
import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceI;
+import jalview.schemes.ColourSchemeI;
import java.awt.Color;
import java.util.Map;
-public interface CollectionColourSchemeI
+public interface ResidueShaderI
{
public abstract void setConsensus(ProfilesI cons);
import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
+import jalview.renderer.ResidueShader;
+import jalview.renderer.ResidueShaderI;
import jalview.schemes.Blosum62ColourScheme;
-import jalview.schemes.CollectionColourScheme;
-import jalview.schemes.CollectionColourSchemeI;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.PIDColourScheme;
import jalview.structure.CommandListener;
protected boolean ignoreGapsInConsensusCalculation = false;
- protected CollectionColourSchemeI globalColourScheme;
+ protected ResidueShaderI globalColourScheme;
@Override
public void setGlobalColourScheme(ColourSchemeI cs)
*/
if (globalColourScheme == null)
{
- globalColourScheme = new CollectionColourScheme();
+ globalColourScheme = new ResidueShader();
}
globalColourScheme.setColourScheme(cs);
}
@Override
- public CollectionColourSchemeI getViewportColourScheme()
+ public ResidueShaderI getViewportColourScheme()
{
return globalColourScheme;
}
*/
void resetAllColourSchemes()
{
- CollectionColourSchemeI cs = globalColourScheme;
+ ResidueShaderI cs = globalColourScheme;
if (cs != null)
{
cs.alignmentChanged(alignment, hiddenRepSequences);
import jalview.datamodel.Annotation;
import jalview.datamodel.ProfilesI;
import jalview.datamodel.SequenceI;
-import jalview.schemes.CollectionColourSchemeI;
+import jalview.renderer.ResidueShaderI;
public class ConsensusThread extends AlignCalcWorker
{
*/
protected void setColourSchemeConsensus(ProfilesI hconsensus)
{
- CollectionColourSchemeI cs = alignViewport.getViewportColourScheme();
+ ResidueShaderI cs = alignViewport.getViewportColourScheme();
if (cs != null)
{
cs.setConsensus(hconsensus);
-package jalview.schemes;
+package jalview.renderer;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertFalse;
import jalview.datamodel.Profiles;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
+import jalview.schemes.PIDColourScheme;
import java.awt.Color;
import java.util.Collections;
import org.testng.annotations.Test;
-public class CollectionColourSchemeTest
+public class ResidueShaderTest
{
@Test(groups = "Functional")
profiles[1] = new Profile(4, 0, 4, "R");
profiles[2] = new Profile(4, 4, 0, "");
profiles[3] = new Profile(4, 1, 2, "T");
- CollectionColourScheme ccs = new CollectionColourScheme(
- new PIDColourScheme());
+ ResidueShader ccs = new ResidueShader(new PIDColourScheme());
ccs.setConsensus(new Profiles(profiles));
-
+
/*
* no threshold
*/
assertTrue(ccs.aboveThreshold('W', 2));
assertTrue(ccs.aboveThreshold('t', 3));
assertTrue(ccs.aboveThreshold('Q', 3));
-
+
/*
* with threshold, include gaps
*/
assertTrue(ccs.aboveThreshold('R', 1));
assertFalse(ccs.aboveThreshold('W', 2));
assertFalse(ccs.aboveThreshold('t', 3)); // 50% < 60%
-
+
/*
* with threshold, ignore gaps
*/
@Test(groups = "Functional")
public void testApplyConservation()
{
- CollectionColourScheme ccs = new CollectionColourScheme(
- new PIDColourScheme());
-
+ ResidueShader ccs = new ResidueShader(new PIDColourScheme());
+
// no conservation present - no fading
assertEquals(Color.RED, ccs.applyConservation(Color.RED, 12));
-
+
/*
* stub Conservation to return a given consensus string
*/
Collections.<SequenceI> emptyList(), 0, 0)
{
@Override
- public SequenceI getConsSequence() {
+ public SequenceI getConsSequence()
+ {
return new Sequence("seq", consSequence);
}
};
ccs.setConservation(cons);
-
+
// column out of range:
assertEquals(Color.RED,
ccs.applyConservation(Color.RED, consSequence.length()));
-
+
/*
* with 100% threshold, 'fade factor' is
* (11-score)/10 * 100/20 = (11-score)/2
assertEquals(Color.RED, ccs.applyConservation(Color.RED, 10));
assertEquals(Color.RED, ccs.applyConservation(Color.RED, 11));
assertEquals(Color.WHITE, ccs.applyConservation(Color.RED, 12));
-
+
/*
* with 0% threshold, there should be no fading
*/
assertEquals(Color.RED, ccs.applyConservation(Color.RED, 10));
assertEquals(Color.RED, ccs.applyConservation(Color.RED, 11));
assertEquals(Color.WHITE, ccs.applyConservation(Color.RED, 12)); // gap
-
+
/*
* with 40% threshold, 'fade factor' is
* (11-score)/10 * 40/20 = (11-score)/5