X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FFastaFile.java;h=3a7197fb92560bae173cf32b76cada7753998b61;hb=474a52c5afda08ff9edbb6dda7a37c87be83f0d3;hp=f866928c9969ead06b8e7f364b01a63528006a4e;hpb=c2dd5464538291087fffb47809c108ace0b236cc;p=jalview.git diff --git a/src/jalview/io/FastaFile.java b/src/jalview/io/FastaFile.java index f866928..3a7197f 100755 --- a/src/jalview/io/FastaFile.java +++ b/src/jalview/io/FastaFile.java @@ -92,17 +92,7 @@ public class FastaFile extends AlignFile { 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 @@ -139,17 +129,7 @@ public class FastaFile extends AlignFile 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) @@ -158,7 +138,23 @@ public class FastaFile extends AlignFile seqs.addElement(seq); } } - + private AlignmentAnnotation makeAnnotation(SequenceI seq, StringBuffer sb) + { + Annotation[] anots = new Annotation[sb.length()]; + char cb; + for (int i=0;i