@Override
public String print(SequenceI[] s, boolean jvSuffix)
{
- String string = print(s, jvSuffix, false);
- return string;
- }
-
- public String print(SequenceI[] s, boolean jvSuffix,
- boolean removeAnnotations)
- {
out = new StringBuffer();
out.append("# STOCKHOLM 1.0");
out.append(newline);
while (i < s.length && s[i] != null)
{
AlignmentAnnotation[] alAnot = s[i].getAnnotation();
- if (alAnot != null && !removeAnnotations)
+ if (alAnot != null)
{
Annotation[] ann;
for (int j = 0; j < alAnot.length; j++)
i++;
}
- if (!removeAnnotations)
+ // alignment annotation
+ AlignmentAnnotation aa;
+ if (al.getAlignmentAnnotation() != null)
{
- // alignment annotation
- AlignmentAnnotation aa;
- if (al.getAlignmentAnnotation() != null)
+ for (int ia = 0; ia < al.getAlignmentAnnotation().length; ia++)
{
- for (int ia = 0; ia < al.getAlignmentAnnotation().length; ia++)
+ aa = al.getAlignmentAnnotation()[ia];
+ if (aa.autoCalculated || !aa.visible || aa.sequenceRef != null)
{
- aa = al.getAlignmentAnnotation()[ia];
- if (aa.autoCalculated || !aa.visible || aa.sequenceRef != null)
- {
- continue;
- }
- String seq = "";
- String label;
- String key = "";
- if (aa.label.equals("seq"))
+ continue;
+ }
+ String seq = "";
+ String label;
+ String key = "";
+ if (aa.label.equals("seq"))
+ {
+ label = "seq_cons";
+ }
+ else
+ {
+ key = type2id(aa.label.toLowerCase());
+ if (key == null)
{
- label = "seq_cons";
+ label = aa.label;
}
else
{
- key = type2id(aa.label.toLowerCase());
- if (key == null)
- {
- label = aa.label;
- }
- else
- {
- label = key + "_cons";
- }
+ label = key + "_cons";
}
- if (label == null)
- {
- label = aa.label;
- }
- label = label.replace(" ", "_");
+ }
+ if (label == null)
+ {
+ label = aa.label;
+ }
+ label = label.replace(" ", "_");
- out.append(new Format("%-" + maxid + "s")
- .form("#=GC " + label + " "));
- boolean isrna = aa.isValidStruc();
- for (int j = 0; j < aa.annotations.length; j++)
- {
- seq += outputCharacter(key, j, isrna, aa.annotations, null);
- }
- out.append(seq);
- out.append(newline);
+ out.append(
+ new Format("%-" + maxid + "s").form("#=GC " + label + " "));
+ boolean isrna = aa.isValidStruc();
+ for (int j = 0; j < aa.annotations.length; j++)
+ {
+ seq += outputCharacter(key, j, isrna, aa.annotations, null);
}
+ out.append(seq);
+ out.append(newline);
}
}
+
out.append("//");
out.append(newline);