{
if (annotation)
{
- Annotation[] anots = new Annotation[sb.length()];
- String anotString = sb.toString();
- for (int i = 0; i < sb.length(); i++)
- {
- anots[i] = new Annotation(anotString.substring(i, i + 1),
- null, ' ', 0);
- }
- AlignmentAnnotation aa = new AlignmentAnnotation(seq
- .getName().substring(2), seq.getDescription(), anots);
-
- annotations.addElement(aa);
+ annotations.addElement(makeAnnotation(seq, sb));
}
}
else
if (annotation)
{
- Annotation[] anots = new Annotation[sb.length()];
- String anotString = sb.toString();
- for (int i = 0; i < sb.length(); i++)
- {
- anots[i] = new Annotation(anotString.substring(i, i + 1), null,
- ' ', 0);
- }
- AlignmentAnnotation aa = new AlignmentAnnotation(seq.getName()
- .substring(2), seq.getDescription(), anots);
-
- annotations.addElement(aa);
+ annotations.addElement(makeAnnotation(seq, sb));
}
else if (!firstLine)
seqs.addElement(seq);
}
}
-
+ private AlignmentAnnotation makeAnnotation(SequenceI seq, StringBuffer sb)
+ {
+ Annotation[] anots = new Annotation[sb.length()];
+ char cb;
+ for (int i=0;i<anots.length;i++)
+ {
+ char cn = sb.charAt(i);
+ if (cn != ' ')
+ {
+ anots[i] = new Annotation(""+cn, null,
+ ' ', Float.NaN);
+ }
+ }
+ AlignmentAnnotation aa = new AlignmentAnnotation(seq.getName()
+ .substring(2), seq.getDescription(), anots);
+ return aa;
+ }
/**
* called by AppletFormatAdapter to generate an annotated alignment, rather
* than bare sequences.