*/
public Sequence(String name, String sequence, int start, int end)
{
- this.name = name;
- this.sequence = sequence.toCharArray();
- this.start = start;
- this.end = end;
- parseId();
- checkValidRange();
+ initSeqAndName(name, sequence.toCharArray(), start, end);
}
public Sequence(String name, char[] sequence, int start, int end)
{
- this.name = name;
- this.sequence = sequence;
- this.start = start;
- this.end = end;
+ initSeqAndName(name, sequence, start, end);
+ }
+
+ /**
+ * Stage 1 constructor - assign name, sequence, and set start and end fields.
+ * start and end are updated values from name2 if it ends with /start-end
+ *
+ * @param name2
+ * @param sequence2
+ * @param start2
+ * @param end2
+ */
+ protected void initSeqAndName(String name2, char[] sequence2, int start2,
+ int end2)
+ {
+ this.name = name2;
+ this.sequence = sequence2;
+ this.start = start2;
+ this.end = end2;
parseId();
checkValidRange();
}
*/
public Sequence(SequenceI seq, AlignmentAnnotation[] alAnnotation)
{
- this(seq.getName(), seq.getSequence(), seq.getStart(), seq.getEnd());
+ initSeqFrom(seq, alAnnotation);
+
+ }
+
+ protected void initSeqFrom(SequenceI seq,
+ AlignmentAnnotation[] alAnnotation)
+ {
+ initSeqAndName(seq.getName(), seq.getSequence(), seq.getStart(),
+ seq.getEnd());
description = seq.getDescription();
if (seq.getSequenceFeatures() != null)
{
{
super(sequenceId, "THISAPLACEHOLDER");
}
+
+ private boolean dummy = true;
+ /**
+ * become a proxy for mseq, merging any existing annotation on this sequence
+ *
+ * @param mseq
+ */
+ public void become(SequenceI mseq)
+ {
+ initSeqFrom(mseq, null);
+ dummy=false;
+ }
+
+ /**
+ * Test if the SequenceDummy has been promoted to a real sequence via
+ * SequenceDummy.become
+ *
+ * @return true if this is a placeholder and contains no actual sequence data
+ */
+ public boolean isDummy()
+ {
+ return dummy;
+ }
}