}
+
/**
* Calculate the consensus symbol(s) for each column in the given range.
*
// System.out.println(elapsed);
}
+ public static ProfilesI calculateInformation(final HiddenMarkovModel hmm,
+ int width, int start, int end, boolean saveFullProfile,
+ boolean removeBelowBackground)
+ {
+ ProfileI[] result = new ProfileI[width];
+ int symbolCount = hmm.getNumberOfSymbols();
+ String alph = hmm.getAlphabetType();
+ for (int column = start; column < end; column++)
+ {
+ ResidueCount counts = new ResidueCount();
+ for (char symbol : hmm.getSymbols())
+ {
+ int value = getAnalogueCount(hmm, column, removeBelowBackground,
+ alph, symbol);
+ counts.put(symbol, value);
+ }
+ int maxCount = counts.getModalCount();
+ String maxResidue = counts.getResiduesForCount(maxCount);
+ int gapCount = counts.getGapCount();
+ ProfileI profile = new Profile(symbolCount, gapCount, maxCount,
+ maxResidue);
+
+ if (saveFullProfile)
+ {
+ profile.setCounts(counts);
+ }
+
+ result[column] = profile;
+ }
+ return new Profiles(result);
+ }
+
/**
* Make an estimate of the profile size we are going to compute i.e. how many
* different characters may be present in it. Overestimating has a cost of
}
/**
+ * Derive the information annotations to be added to the alignment for
+ * display. This does not recompute the raw data, but may be called on a
+ * change in display options, such as 'ignore below background frequency',
+ * which may in turn result in a change in the derived values.
+ *
+ * @param information
+ * the annotation row to add annotations to
+ * @param profiles
+ * the source information data
+ * @param startCol
+ * start column (inclusive)
+ * @param endCol
+ * end column (exclusive)
+ * @param ignoreGaps
+ * if true, normalise residue percentages
+ * @param showSequenceLogo
+ * if true include all information symbols, else just show modal
+ * residue
+ * @param nseq
+ * number of sequences
+ */
+ public static void completeInformation(AlignmentAnnotation information,
+ ProfilesI profiles, int startCol, int endCol,
+ boolean ignoreBelowBackground,
+ boolean showSequenceLogo, long nseq)
+ {
+ // long now = System.currentTimeMillis();
+ if (information == null || information.annotations == null
+ || information.annotations.length < endCol)
+ {
+ /*
+ * called with a bad alignment annotation row
+ * wait for it to be initialised properly
+ */
+ return;
+ }
+
+ Float max = 0f;
+
+ for (int i = startCol; i < endCol; i++)
+ {
+ ProfileI profile = profiles.get(i);
+ if (profile == null)
+ {
+ /*
+ * happens if sequences calculated over were
+ * shorter than alignment width
+ */
+ information.annotations[i] = null;
+ return;
+ }
+
+ HiddenMarkovModel hmm;
+
+ SequenceI hmmSeq = information.sequenceRef;
+
+ hmm = hmmSeq.getHMM();
+
+ Float value = getInformationContent(i, hmm);
+
+ if (value > max)
+ {
+ max = value;
+ }
+
+ String description = value + " bits";
+
+ information.annotations[i] = new Annotation(" ", description,
+ ' ', value);
+ }
+ information.graphMax = max;
+ // long elapsed = System.currentTimeMillis() - now;
+ // System.out.println(-elapsed);
+ }
+
+ /**
* Derive the gap count annotation row.
*
* @param gaprow
}
/**
+ * Returns the information content at a specified column.
+ *
+ * @param column
+ * Index of the column, starting from 0.
+ * @return
+ */
+ public static float getInformationContent(int column,
+ HiddenMarkovModel hmm)
+ {
+ float informationContent = 0f;
+
+ for (char symbol : hmm.getSymbols())
+ {
+ float freq = 0f;
+ if ("amino".equals(hmm.getAlphabetType()))
+ {
+ freq = ResidueProperties.aminoBackgroundFrequencies.get(symbol);
+ }
+ if ("DNA".equals(hmm.getAlphabetType()))
+ {
+ freq = ResidueProperties.dnaBackgroundFrequencies.get(symbol);
+ }
+ if ("RNA".equals(hmm.getAlphabetType()))
+ {
+ freq = ResidueProperties.rnaBackgroundFrequencies.get(symbol);
+ }
+ Double hmmProb = hmm.getMatchEmissionProbability(column, symbol);
+ float prob = hmmProb.floatValue();
+ informationContent += prob * (Math.log(prob / freq) / Math.log(2));
+
+ }
+
+ return informationContent;
+ }
+
+ /**
* Produces a HMM profile for a column in an alignment
*
* @param aa
* less than their background frequencies.
* @return
*/
- public static int[] getHMMProfileFor(HiddenMarkovModel hmm, int column,
+ public static int[] extractHMMProfile(HiddenMarkovModel hmm, int column,
boolean removeBelowBackground)
{
{
char symbol = charList.get(i);
symbols[i] = symbol;
- Double value;
-
- value = hmm.getMatchEmissionProbability(column, symbol);
- double freq;
-
- if (AMINO.equals(alph) && removeBelowBackground)
- {
- freq = ResidueProperties.aminoBackgroundFrequencies.get(symbol);
- if (value < freq)
- {
- value = 0d;
- }
- }
- else if (DNA.equals(alph) && removeBelowBackground)
- {
- freq = ResidueProperties.dnaBackgroundFrequencies.get(symbol);
- if (value < freq)
- {
- value = 0d;
- }
- }
- else if (RNA.equals(alph) && removeBelowBackground)
- {
- freq = ResidueProperties.rnaBackgroundFrequencies
- .get(symbol);
- if (value < freq)
- {
- value = 0d;
- }
- }
- value = value * 10000;
- values[i] = value.intValue();
- totalCount += value.intValue();
+ int value = getAnalogueCount(hmm, column, removeBelowBackground,
+ alph, symbol);
+ values[i] = value;
+ totalCount += value;
}
QuickSort.sort(values, symbols);
}
return null;
}
+
+ private static int getAnalogueCount(HiddenMarkovModel hmm, int column,
+ boolean removeBelowBackground, String alph, char symbol)
+ {
+ Double value;
+
+ value = hmm.getMatchEmissionProbability(column, symbol);
+ double freq;
+
+ if (AMINO.equals(alph) && removeBelowBackground)
+ {
+ freq = ResidueProperties.aminoBackgroundFrequencies.get(symbol);
+ if (value < freq)
+ {
+ value = 0d;
+ }
+ }
+ else if (DNA.equals(alph) && removeBelowBackground)
+ {
+ freq = ResidueProperties.dnaBackgroundFrequencies.get(symbol);
+ if (value < freq)
+ {
+ value = 0d;
+ }
+ }
+ else if (RNA.equals(alph) && removeBelowBackground)
+ {
+ freq = ResidueProperties.rnaBackgroundFrequencies.get(symbol);
+ if (value < freq)
+ {
+ value = 0d;
+ }
+ }
+ value = value * 10000;
+ return value.intValue();
+ }
}
ProfilesI getSequenceConsensusHash();
+ ProfilesI getSequenceInformationHash();
+
/**
* Get consensus data table for the cDNA complement of this alignment (if any)
*
void setSequenceConsensusHash(ProfilesI hconsensus);
/**
+ * set the information result object for the viewport
+ *
+ * @param hconsensus
+ */
+ void setSequenceInformationHash(ProfilesI hinformation);
+
+ /**
* Set the cDNA complement consensus for the viewport
*
* @param hconsensus
*/
@Override
void setProteinFontAsCdna(boolean b);
+
+ ProfilesI setSequenceInformationHash();
}
alignPanel);
viewport.updateConservation(alignPanel);
viewport.updateConsensus(alignPanel);
+ viewport.updateInformation(alignPanel);
displayNonconservedMenuItem.setState(viewport.getShowUnconserved());
followMouseOverFlag.setState(viewport.isFollowHighlight());
import jalview.datamodel.AlignmentI;
import jalview.datamodel.ColumnSelection;
import jalview.datamodel.HiddenColumns;
+import jalview.datamodel.ProfilesI;
import jalview.datamodel.SearchResults;
import jalview.datamodel.SearchResultsI;
import jalview.datamodel.Sequence;
return normaliseHMMSequenceLogo;
}
+ @Override
+ public ProfilesI getSequenceInformationHash()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setSequenceInformationHash(ProfilesI hinformation)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
public static final int CDNA_PROFILE = 2;
- HiddenMarkovModel hmm;
-
private static long counter = 0;
/**
return graphMin < graphMax;
}
- public void setHMM(HiddenMarkovModel markov)
- {
- hmm = markov;
- }
-
- public HiddenMarkovModel getHMM()
- {
- return hmm;
- }
}
package jalview.datamodel;
import jalview.gui.AlignFrame;
-import jalview.schemes.ResidueProperties;
import java.util.ArrayList;
import java.util.HashMap;
}
}
- /**
- * Creates the HMM Logo alignment annotation, and populates it with
- * information content data.
- *
- * @return The alignment annotation.
- */
- public AlignmentAnnotation createAnnotation(int length)
- {
- Annotation[] annotations = new Annotation[length];
- float max = 0f;
- for (int alignPos = 0; alignPos < length; alignPos++)
- {
- Float content = getInformationContent(alignPos);
- if (content > max)
- {
- max = content;
- }
-
- Character cons;
-
- cons = getConsensusAtAlignColumn(alignPos);
-
- cons = Character.toUpperCase(cons);
-
- String description = String.format("%.3f", content);
- description += " bits";
- annotations[alignPos] = new Annotation(cons.toString(), description,
- ' ',
- content);
-
- }
- AlignmentAnnotation annotation = new AlignmentAnnotation(
- "Information",
- "The information content of each column, measured in bits",
- annotations,
- 0f, max, AlignmentAnnotation.BAR_GRAPH);
- annotation.setHMM(this);
- return annotation;
- }
-
- /**
- * Returns the information content at a specified column.
- *
- * @param column
- * Index of the column, starting from 0.
- * @return
- */
- public float getInformationContent(int column)
- {
- float informationContent = 0f;
- for (char symbol : symbols)
- {
- float freq = 0f;
- if ("amino".equals(getAlphabetType()))
- {
- freq = ResidueProperties.aminoBackgroundFrequencies.get(symbol);
- }
- if ("DNA".equals(getAlphabetType()))
- {
- freq = ResidueProperties.dnaBackgroundFrequencies.get(symbol);
- }
- if ("RNA".equals(getAlphabetType()))
- {
- freq = ResidueProperties.rnaBackgroundFrequencies
- .get(symbol);
- }
- Double hmmProb = getMatchEmissionProbability(column, symbol);
- float prob = hmmProb.floatValue();
- informationContent += prob * (Math.log(prob / freq) / Math.log(2));
-
- }
-
- return informationContent;
- }
/**
* Returns the consensus sequence based on the most probable symbol at each
return;
}
+ mapToReferenceAnnotation(reference);
+ af.getViewport().getAlignment().deleteAnnotation(reference);
+ }
+
+ public void mapToReferenceAnnotation(AlignmentAnnotation reference)
+ {
Annotation[] annots = reference.annotations;
{
int nodeIndex = 0;
}
}
- af.getViewport().getAlignment().deleteAnnotation(reference);
+
}
- public void initPlaceholder(AlignFrame af)
+ public SequenceI initPlaceholder(AlignFrame af)
{
AlignmentI alignment = af.getViewport().getAlignment();
int length = alignment.getWidth();
AlignmentI newAlignment = new Alignment(consensusArr);
newAlignment.append(alignment);
af.getViewport().setAlignment(newAlignment);
+ return consensus;
}
}
AlignmentAnnotation conservation = null;
- AlignmentAnnotation informationContent = null;
+ AlignmentAnnotation information = null;
private boolean showConsensusHistogram;
public boolean recalcConservation(boolean defer)
{
if (cs == null && consensus == null && conservation == null
- && informationContent == null)
+ && information == null)
{
return false;
}
{
ProfilesI cnsns = AAFrequency.calculate(sequences, startRes,
endRes + 1, showSequenceLogo);
- if (informationContent != null)
+ if (information != null)
{
// _updateInformationRow(cnsns, sequences.size()); TODO don't know what
// to do here
public ProfilesI consensusData = null;
+ public ProfilesI informationData = null;
+
private void _updateConsensusRow(ProfilesI cnsns, long nseq)
{
if (consensus == null)
private void _updateInformationRow(ProfilesI cnsns, long nseq)
{
- if (consensus == null)
+ if (information == null)
{
- getConsensus();
+ getInformation();
}
- consensus.label = "Consensus for " + getName();
- consensus.description = "Percent Identity";
- consensusData = cnsns;
+ information.label = "Information for " + getName();
+ information.description = "Percent Identity";
+ informationData = cnsns;
// preserve width if already set
- int aWidth = (consensus.annotations != null)
- ? (endRes < consensus.annotations.length
- ? consensus.annotations.length : endRes + 1)
+ int aWidth = (information.annotations != null)
+ ? (endRes < information.annotations.length
+ ? information.annotations.length : endRes + 1)
: endRes + 1;
- consensus.annotations = null;
- consensus.annotations = new Annotation[aWidth]; // should be alignment width
+ information.annotations = null;
+ information.annotations = new Annotation[aWidth]; // should be alignment
+ // width
- AAFrequency.completeConsensus(consensus, cnsns, startRes, endRes + 1,
- ignoreGapsInConsensus, showSequenceLogo, nseq); // TODO: setting
+ AAFrequency.completeInformation(information, cnsns, startRes,
+ endRes + 1, ignoreBelowBackground, showSequenceLogo, nseq); // TODO:
+ // setting
// container
// for
- // ignoreGapsInConsensusCalculation);
+ // ignoreGapsInInformationCalculation);
}
/**
}
/**
+ *
+ * @return information content annotation.
+ */
+ public AlignmentAnnotation getInformation()
+ {
+ // TODO get or calculate and get information annotation row for this group
+ int aWidth = this.getWidth();
+ // pointer
+ // possibility
+ // here.
+ if (aWidth < 0)
+ {
+ return null;
+ }
+ if (information == null)
+ {
+ information = new AlignmentAnnotation("", "", new Annotation[1], 0f,
+ 100f, AlignmentAnnotation.BAR_GRAPH);
+ information.hasText = true;
+ information.autoCalculated = true;
+ information.groupRef = this;
+ information.label = "Consensus for " + getName();
+ information.description = "Percent Identity";
+ }
+ return information;
+ }
+
+ /**
* set this alignmentAnnotation object as the one used to render consensus
* annotation
*
public void setShowInformationHistogram(boolean state)
{
- if (showInformationHistogram != state && informationContent != null)
+ if (showInformationHistogram != state && information != null)
{
this.showInformationHistogram = state;
// recalcConservation(); TODO don't know what to do here next
import jalview.util.MessageManager;
import jalview.viewmodel.AlignmentViewport;
import jalview.viewmodel.ViewportRanges;
+import jalview.workers.InformationThread;
import jalview.ws.DBRefFetcher;
import jalview.ws.DBRefFetcher.FetchFinishedListenerI;
import jalview.ws.jws1.Discoverer;
ap.av.updateConservation(ap);
ap.av.updateConsensus(ap);
ap.av.updateStrucConsensus(ap);
+ ap.av.updateInformation(ap);
}
}
HiddenMarkovModel hmm = hmmFile.getHMM();
hmm.mapToReferenceAnnotation(this);
+ SequenceI hmmSeq = hmm.initPlaceholder(this);
+ getViewport().initInformation(hmmSeq);
+ new Thread(new InformationThread(getViewport(),
+ getViewport().getAlignPanel())
+ {
+ }).start();
-
- AlignmentAnnotation annotation = hmm.createAnnotation(
- getViewport().getAlignment().getWidth());
- getViewport().getAlignment().addAnnotation(annotation);
- hmm.initPlaceholder(this);
isAnnotation = true;
alignPanel.repaint();
import jalview.datamodel.ColumnSelection;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.PDBEntry;
+import jalview.datamodel.ProfilesI;
import jalview.datamodel.SearchResults;
import jalview.datamodel.SearchResultsI;
import jalview.datamodel.Sequence;
return normaliseSequenceLogo;
}
+
public void setNormaliseSequenceLogo(boolean state)
{
normaliseSequenceLogo = state;
@Override
public boolean isNormaliseHMMSequenceLogo()
{
- // TODO Auto-generated method stub
return normaliseHMMSequenceLogo;
}
+ @Override
+ public ProfilesI getSequenceInformationHash()
+ {
+ return hinformation;
+ }
+
+ @Override
+ public void setSequenceInformationHash(ProfilesI hinformation)
+ {
+ this.hinformation = hinformation;
+
+ }
+
}
// can be
// updated.
av.setShowConsensusHistogram(chist.getState());
- ap.alignFrame.setMenusForViewport();
ap.repaint();
// ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
}
// can be
// updated.
av.setShowSequenceLogo(cprof.getState());
- ap.alignFrame.setMenusForViewport();
ap.repaint();
// ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
}
// updated.
av.setShowSequenceLogo(true);
av.setNormaliseSequenceLogo(cprofnorm.getState());
- ap.alignFrame.setMenusForViewport();
ap.repaint();
// ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
}
// can be
// updated.
av.setShowInformationHistogram(chist.getState());
- ap.alignFrame.setMenusForViewport();
ap.repaint();
// ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
}
// view
// can be
// updated.
+ av.updateInformation(ap);
av.setShowHMMSequenceLogo(cprof.getState());
- ap.alignFrame.setMenusForViewport();
ap.repaint();
// ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
}
// updated.
av.setShowHMMSequenceLogo(true);
av.setNormaliseHMMSequenceLogo(cprofnorm.getState());
- ap.alignFrame.setMenusForViewport();
ap.repaint();
// ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
}
});
pop.add(cprofnorm);
}
- final JMenuItem consclipbrd = new JMenuItem(COPYCONS_SEQ);
- consclipbrd.addActionListener(this);
- pop.add(consclipbrd);
}
}
pop.show(this, evt.getX(), evt.getY());
boolean av_renderHistogram = true, av_renderProfile = true,
av_normaliseProfile = false;
+ boolean av_renderInformationHistogram = true, av_renderHMMProfile = true,
+ av_normaliseHMMProfile = false;
+
ResidueShaderI profcolour = null;
private ColumnSelection columnSelection;
av_renderHistogram = av.isShowConsensusHistogram();
av_renderProfile = av.isShowSequenceLogo();
av_normaliseProfile = av.isNormaliseSequenceLogo();
+ av_renderInformationHistogram = av.isShowInformationHistogram();
+ av_renderHMMProfile = av.isShowHMMSequenceLogo();
+ av_normaliseHMMProfile = av.isNormaliseHMMSequenceLogo();
profcolour = av.getResidueShading();
if (profcolour == null || profcolour.getColourScheme() == null)
{
//
if (aa.label.startsWith("Information"))
{
- HiddenMarkovModel hmm = aa.getHMM();
- return AAFrequency.getHMMProfileFor(hmm, column,
+ HiddenMarkovModel hmm = aa.sequenceRef.getHMM();
+ return AAFrequency.extractHMMProfile(hmm, column,
av_ignoreBelowBackground); // TODO check if this follows standard
// pipeline
}
boolean scaleColLabel = false;
final AlignmentAnnotation consensusAnnot = av
.getAlignmentConsensusAnnotation();
+ final AlignmentAnnotation informationAnnot = av
+ .getAlignmentInformationAnnotation();
final AlignmentAnnotation structConsensusAnnot = av
.getAlignmentStrucConsensusAnnotation();
final AlignmentAnnotation complementConsensusAnnot = av
renderProfile = av_renderProfile;
normaliseProfile = av_normaliseProfile;
}
+ else if (row == informationAnnot)
+ {
+ renderHistogram = av_renderInformationHistogram;
+ renderProfile = av_renderHMMProfile;
+ normaliseProfile = av_normaliseHMMProfile;
+ }
else
{
renderHistogram = true;
{
colourScheme = cs;
}
+
+ @Override
+ public void setInformation(ProfilesI info)
+ {
+ // TODO Auto-generated method stub
+
+ }
}
public abstract void setConsensus(ProfilesI cons);
+ public abstract void setInformation(ProfilesI info);
+
public abstract boolean conservationApplied();
public abstract void setConservationApplied(boolean conservationApplied);
import jalview.workers.AlignCalcManager;
import jalview.workers.ComplementConsensusThread;
import jalview.workers.ConsensusThread;
+import jalview.workers.InformationThread;
import jalview.workers.StrucConsensusThread;
import java.awt.Color;
public boolean autoCalculateConsensus = true;
+ public boolean autoCalculateInformation = true;
+
protected boolean autoCalculateStrucConsensus = true;
protected boolean ignoreGapsInConsensusCalculation = false;
protected AlignmentAnnotation[] groupConservation;
- protected AlignmentAnnotation informationContent;
+ protected AlignmentAnnotation[] groupInformation;
+
+ protected AlignmentAnnotation information;
+
+ /**
+ * results of alignment information analysis for visible portion of view
+ */
+ protected ProfilesI hinformation = null;
/**
* results of alignment consensus analysis for visible portion of view
}
@Override
+ public ProfilesI setSequenceInformationHash()
+ {
+ return hinformation;
+ }
+
+ @Override
+ public ProfilesI getSequenceInformationHash()
+ {
+ return hinformation;
+ }
+
+ @Override
public Hashtable[] getComplementConsensusHash()
{
return hcomplementConsensus;
@Override
public AlignmentAnnotation getAlignmentInformationAnnotation()
{
- return informationContent;
+ return information;
}
@Override
}
}
+ /**
+ * trigger update of information annotation
+ */
+ public void updateInformation(final AlignmentViewPanel ap)
+ {
+ if (information == null)
+ {
+ return;
+ }
+ if (calculator
+ .getRegisteredWorkersOfClass(InformationThread.class) == null)
+ {
+ calculator.registerWorker(new InformationThread(this, ap));
+ }
+
+ }
+
// --------START Structure Conservation
public void updateStrucConsensus(final AlignmentViewPanel ap)
{
* defensively null out references to large objects in case
* this object is not garbage collected (as if!)
*/
+ information = null;
consensus = null;
complementConsensus = null;
strucConsensus = null;
if (showHMMSequenceLogo != this.showHMMSequenceLogo)
{
this.showHMMSequenceLogo = showHMMSequenceLogo;
+ calculator.updateAnnotationFor(InformationThread.class);
}
this.showHMMSequenceLogo = showHMMSequenceLogo;
}
ignoreBelowBackGroundFrequencyCalculation = b;
if (ap != null)
{
- // updateConsensus(ap);
- if (residueShading != null)
- {
- residueShading.setThreshold(residueShading.getThreshold(),
- ignoreBelowBackGroundFrequencyCalculation);
- }
+ updateInformation(ap);
}
}
{
updateStrucConsensus(ap);
}
+ if (information != null)
+ {
+ updateInformation(ap);
+ }
// Reset endRes of groups if beyond alignment width
int alWidth = alignment.getWidth();
rs.alignmentChanged(alignment, hiddenRepSequences);
rs.setConsensus(hconsensus);
+ rs.setInformation(hinformation);
if (rs.conservationApplied())
{
rs.setConservation(Conservation.calculateConservation("All",
}
}
+
/**
* If this is a protein alignment and there are mappings to cDNA, adds the
* cDNA consensus annotation and returns true, else returns false.
}
}
+ public void initInformation(SequenceI hmmSequence)
+ {
+ information = new AlignmentAnnotation("Information",
+ MessageManager.getString("label.information_description"),
+ new Annotation[1], 0f, 6.52f, AlignmentAnnotation.BAR_GRAPH);
+ information.hasText = true;
+ information.autoCalculated = true;
+ information.hasText = true;
+ information.autoCalculated = false;
+ information.sequenceRef = hmmSequence;
+ alignment.addAnnotation(information);
+ }
+
// these should be extracted from the view model - style and settings for
// derived annotation
private void initGapCounts()
boolean showprf = isShowSequenceLogo();
boolean showConsHist = isShowConsensusHistogram();
boolean normLogo = isNormaliseSequenceLogo();
+ boolean showHMMPrf = isShowHMMSequenceLogo();
+ boolean showInfoHist = isShowInformationHistogram();
+ boolean normHMMLogo = isNormaliseHMMSequenceLogo();
/**
* TODO reorder the annotation rows according to group/sequence ordering on
sg.setshowSequenceLogo(showprf);
sg.setShowConsensusHistogram(showConsHist);
sg.setNormaliseSequenceLogo(normLogo);
+ sg.setshowHMMSequenceLogo(showHMMPrf);
+ sg.setShowInformationHistogram(showInfoHist);
+ sg.setNormaliseHMMSequenceLogo(normHMMLogo);
}
if (conv)
{
.synchronizedList(new ArrayList<AlignCalcWorkerI>());
updating = Collections
.synchronizedMap(new Hashtable<Class<? extends AlignCalcWorkerI>, List<AlignCalcWorkerI>>());
- canUpdate = new HashSet<AlignCalcWorkerI>();
+ canUpdate = new HashSet<>();
}
@Override
public List<AlignCalcWorkerI> getRegisteredWorkersOfClass(
Class<? extends AlignCalcWorkerI> workerClass)
{
- List<AlignCalcWorkerI> workingClass = new ArrayList<AlignCalcWorkerI>();
+ List<AlignCalcWorkerI> workingClass = new ArrayList<>();
synchronized (canUpdate)
{
for (AlignCalcWorkerI worker : canUpdate)
public void removeRegisteredWorkersOfClass(
Class<? extends AlignCalcWorkerI> typeToRemove)
{
- List<AlignCalcWorkerI> removable = new ArrayList<AlignCalcWorkerI>();
- Set<AlignCalcWorkerI> toremovannot = new HashSet<AlignCalcWorkerI>();
+ List<AlignCalcWorkerI> removable = new ArrayList<>();
+ Set<AlignCalcWorkerI> toremovannot = new HashSet<>();
synchronized (restartable)
{
for (AlignCalcWorkerI worker : restartable)
* first just find those to remove (to avoid
* ConcurrentModificationException)
*/
- List<AlignCalcWorkerI> toRemove = new ArrayList<AlignCalcWorkerI>();
+ List<AlignCalcWorkerI> toRemove = new ArrayList<>();
for (AlignCalcWorkerI worker : restartable)
{
if (worker.involves(ann))