// stores background frequencies of alignment from which this model came
private Map<Character, Float> backgroundFrequencies;
+ private SeqCigar hmmCigar;
+
/**
* Constructor
*/
lastResNo = resNo;
}
+ // TODO: check that gap accounting is correct here
Sequence seq = new Sequence(getName(), sequence, start,
lastResNo - gapCount);
seq.createDatasetSequence();
seq.setHMM(this);
- this.hmmSeq = seq;
-
+
+ this.hmmSeq = seq.getDatasetSequence();
+ this.hmmCigar = new SeqCigar(seq);
/*
* construct and store Mapping of nodes to residues
* note as constructed this is just an identity mapping,
List<int[]> fromNodes = new ArrayList<>();
fromNodes.add(new int[] { 1, getLength() });
toResidues.add(new int[] { seq.getStart(), seq.getEnd() });
+
MapList mapList = new MapList(fromNodes, toResidues, 1, 1);
mapToHmmConsensus = new Mapping(seq.getDatasetSequence(), mapList);
}
*/
public SequenceI getConsensusSequence()
{
- return hmmSeq;
+ return hmmCigar.getSeq('-');
}
/**
datasetSequence.addAlignmentAnnotation(_aa);
}
}
+ datasetSequence.setHMM(hmm);
+ hmm=null;
}
return datasetSequence;
}
@Override
public HiddenMarkovModel getHMM()
{
+ if (datasetSequence!=null)
+ {
+ return datasetSequence.getHMM();
+ }
return hmm;
}
@Override
public void setHMM(HiddenMarkovModel hmm)
{
- this.hmm = hmm;
+ if (datasetSequence!=null)
+ {
+ datasetSequence.setHMM(hmm);
+ } else {
+ this.hmm=hmm;
+ }
+
}
@Override
@Override
public boolean hasHMMProfile()
{
- return hmm != null;
+ return hmm != null || (datasetSequence!=null && datasetSequence.hasHMMProfile());
}
}