*/
private Mapping mapToHmmConsensus;
+ // stores background frequencies of alignment from which this model came
+ private Map<Character, Float> backgroundFrequencies;
+
/**
* Constructor
*/
this.symbolIndexLookup = hmm.symbolIndexLookup;
this.fileHeader = new String(hmm.fileHeader);
this.hmmSeq = sq;
+ this.backgroundFrequencies = hmm.getBackgroundFrequencies();
if (sq.getDatasetSequence() == hmm.mapToHmmConsensus.getTo())
{
// same dataset sequence e.g. after realigning search results
{
this.hmmSeq = hmmSeq;
}
+
+ public void setBackgroundFrequencies(Map<Character, Float> bkgdFreqs)
+ {
+ backgroundFrequencies = bkgdFreqs;
+ }
+
+ public void setBackgroundFrequencies(ResidueCount bkgdFreqs)
+ {
+ backgroundFrequencies = new HashMap<>();
+
+ int total = bkgdFreqs.getTotalResidueCount();
+
+ for (char c : bkgdFreqs.getSymbolCounts().symbols)
+ {
+ backgroundFrequencies.put(c, bkgdFreqs.getCount(c) * 1f / total);
+ }
+
+ }
+
+ public Map<Character, Float> getBackgroundFrequencies()
+ {
+ return backgroundFrequencies;
+ }
}
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentView;
import jalview.datamodel.AnnotatedCollectionI;
+import jalview.datamodel.ResidueCount;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
HMMFile file = new HMMFile(
new FileParse(hmmFile.getAbsolutePath(), DataSourceType.FILE));
SequenceI hmmSeq = file.getHMM().getConsensusSequence();
+ ResidueCount counts = new ResidueCount(alignment.getSequences());
+ hmmSeq.getHMM().setBackgroundFrequencies(counts);
if (hmmSeq == null)
{
TCoffee("T-Coffee Scores", TCoffeeColourScheme.class),
IdColour("Sequence ID", IdColourScheme.class),
HMMERU("HMMER-Uniprot", HmmerGlobalBackground.class),
- HMMERA("HMMER-Alignment", HmmerLocalBackground.class);
+ HMMERA("HMMER-Alignment", HmmerLocalBackground.class),
+ HMMMatchScore("HMM Match Score", HMMMatchScoreColourScheme.class);
// RNAInteraction("RNA Interaction type", RNAInteractionColourScheme.class)
private String name;