private char[] sequence;
+ int previousPosition;
+
String description;
int start;
int end;
+ boolean hasInfo;
+
+ HiddenMarkovModel hmm;
+
+ boolean isHMMConsensusSequence = false;
+
Vector<PDBEntry> pdbIds;
String vamsasId;
this.addPDBId(new PDBEntry(pdb));
}
}
+ if (seq.isHMMConsensusSequence())
+ {
+ this.isHMMConsensusSequence = true;
+ }
+ if (seq.getHMM() != null)
+ {
+ this.hmm = new HiddenMarkovModel(seq.getHMM());
+ }
+
}
@Override
{
if (pdbIds == null)
{
- pdbIds = new Vector<PDBEntry>();
+ pdbIds = new Vector<>();
pdbIds.add(entry);
return true;
}
@Override
public Vector<PDBEntry> getAllPDBEntries()
{
- return pdbIds == null ? new Vector<PDBEntry>() : pdbIds;
+ return pdbIds == null ? new Vector<>() : pdbIds;
}
/**
@Override
public List<int[]> getInsertions()
{
- ArrayList<int[]> map = new ArrayList<int[]>();
+ ArrayList<int[]> map = new ArrayList<>();
int lastj = -1, j = 0;
int pos = start;
int seqlen = sequence.length;
{
if (this.annotation == null)
{
- this.annotation = new Vector<AlignmentAnnotation>();
+ this.annotation = new Vector<>();
}
if (!this.annotation.contains(annotation))
{
return null;
}
- Vector<AlignmentAnnotation> subset = new Vector<AlignmentAnnotation>();
+ Vector<AlignmentAnnotation> subset = new Vector<>();
Enumeration<AlignmentAnnotation> e = annotation.elements();
while (e.hasMoreElements())
{
public List<AlignmentAnnotation> getAlignmentAnnotations(String calcId,
String label)
{
- List<AlignmentAnnotation> result = new ArrayList<AlignmentAnnotation>();
+ List<AlignmentAnnotation> result = new ArrayList<>();
if (this.annotation != null)
{
for (AlignmentAnnotation ann : annotation)
}
synchronized (dbrefs)
{
- List<DBRefEntry> primaries = new ArrayList<DBRefEntry>();
+ List<DBRefEntry> primaries = new ArrayList<>();
DBRefEntry[] tmp = new DBRefEntry[1];
for (DBRefEntry ref : dbrefs)
{
}
}
+ @Override
+ public HiddenMarkovModel getHMM()
+ {
+ return hmm;
+ }
+
+ @Override
+ public void setHMM(HiddenMarkovModel hmm)
+ {
+ this.hmm = hmm;
+ }
+
+ @Override
+ public void updateHMMMapping()
+ {
+ int node = 1;
+ int column = 0;
+ hmm.emptyNodeLookup();
+ for (char residue : sequence)
+ {
+ if (!Comparison.isGap(residue))
+ {
+ hmm.setAlignmentColumn(node, column);
+ node++;
+ }
+ column++;
+ }
+ }
+
+ /**
+ * Maps the HMM sequence to the reference annotation.
+ *
+ * @param rf
+ */
+ @Override
+ public void mapToReference(AlignmentAnnotation rf)
+ {
+ if (this.isHMMConsensusSequence)
+ {
+ int node = 1;
+ hmm.emptyNodeLookup();
+ for (int i = 0; i < getLength(); i++)
+ {
+ if (rf.annotations[i].displayCharacter.equals("x")
+ || rf.annotations[i].displayCharacter.equals("X"))
+ {
+ if (i < hmm.getNodeAlignmentColumn(node))
+ {
+ this.deleteChars(i, hmm.getNodeAlignmentColumn(node));
+ updateHMMMapping();
+ }
+ else if (i > hmm.getNodeAlignmentColumn(node))
+ {
+ int length = i - hmm.getNodeAlignmentColumn(node);
+ this.insertCharAt(hmm.getNodeAlignmentColumn(node), length,
+ '-');
+ updateHMMMapping();
+ }
+ node++;
+ }
+ }
+ }
+ }
+
+ @Override
+ public boolean isHMMConsensusSequence()
+ {
+ return isHMMConsensusSequence;
+ }
+
+ @Override
+ public void setIsHMMConsensusSequence(boolean isHMMConsensusSequence)
+ {
+ this.isHMMConsensusSequence = isHMMConsensusSequence;
+ }
+
+ @Override
+ public boolean hasHMMAnnotation()
+ {
+ return hasInfo;
+ }
+
+ @Override
+ public void setHasInfo(boolean status)
+ {
+ hasInfo = true;
+ }
+
+ @Override
+ public int getPreviousPosition()
+ {
+ return previousPosition;
+ }
+
+ @Override
+ public void setPreviousPosition(int previousPosition)
+ {
+ this.previousPosition = previousPosition;
+ }
+
/**
* {@inheritDoc}
*/