HiddenMarkovModel hmm;
boolean isHMMConsensusSequence = false;
-
private DBModList<DBRefEntry> dbrefs; // controlled access
/**
}
/**
+ * Create a new sequence object from a characters array using default values
+ * of 1 and -1 for start and end. The array used to create the sequence is
+ * copied and is not stored internally.
+ *
+ * @param name
+ * sequence name
+ * @param sequence
+ * list of residues
+ */
+ public Sequence(String name, char[] sequence)
+ {
+ this(name, Arrays.copyOf(sequence, sequence.length), 1, -1);
+ }
+
+ /**
* Creates a new Sequence object with new AlignmentAnnotations but inherits
* any existing dataset sequence reference. If non exists, everything is
* copied.
{
this.hmm = new HiddenMarkovModel(seq.getHMM(), this);
}
-
}
@Override
@Override
public void addDBRef(DBRefEntry entry)
{
+ // TODO JAL-3980 maintain as sorted list
if (datasetSequence != null)
{
datasetSequence.addDBRef(entry);
{
dbrefs = new DBModList<>();
}
+ // TODO JAL-3979 LOOK UP RATHER THAN SWEEP FOR EFFICIENCY
for (int ib = 0, nb = dbrefs.size(); ib < nb; ib++)
{
public List<AlignmentAnnotation> getAlignmentAnnotations(String calcId,
String label)
{
+ return getAlignmentAnnotations(calcId, label, null, true);
+ }
+
+ @Override
+ public List<AlignmentAnnotation> getAlignmentAnnotations(String calcId,
+ String label, String description)
+ {
+ return getAlignmentAnnotations(calcId, label, description, false);
+ }
+
+ private List<AlignmentAnnotation> getAlignmentAnnotations(String calcId,
+ String label, String description, boolean ignoreDescription)
+ {
List<AlignmentAnnotation> result = new ArrayList<>();
if (this.annotation != null)
{
for (AlignmentAnnotation ann : annotation)
{
String id = ann.getCalcId();
- if (id != null && id.equals(calcId)
- && ann.label != null && ann.label.equals(label))
+ if ((id != null && id.equals(calcId))
+ && (ann.label != null && ann.label.equals(label))
+ && ((ignoreDescription && description == null)
+ || (ann.description != null
+ && ann.description.equals(description))))
{
result.add(ann);
}
}
return false;
}
-
/**
* {@inheritDoc}
*/