X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FFastaFile.java;h=9acd7da00ccc95a15a5170dc1635cbd65c4dd4bf;hb=3d0101179759ef157b088ea135423cd909512d9f;hp=4c2265c90cae72ca7670ba7bcab77db678f77bc7;hpb=8dbeca869699c196f4239fb1f8909d5a4c23ee86;p=jalview.git diff --git a/src/jalview/io/FastaFile.java b/src/jalview/io/FastaFile.java index 4c2265c..9acd7da 100755 --- a/src/jalview/io/FastaFile.java +++ b/src/jalview/io/FastaFile.java @@ -55,15 +55,16 @@ public class FastaFile extends AlignFile * * @param inFile * DOCUMENT ME! - * @param type + * @param sourceType * DOCUMENT ME! * * @throws IOException * DOCUMENT ME! */ - public FastaFile(String inFile, String type) throws IOException + public FastaFile(String inFile, DataSourceType sourceType) + throws IOException { - super(inFile, type); + super(inFile, sourceType); } public FastaFile(FileParse source) throws IOException @@ -71,6 +72,11 @@ public class FastaFile extends AlignFile super(source); } + public FastaFile(SequenceI[] seqs) + { + super(seqs); + } + /** * DOCUMENT ME! * @@ -158,8 +164,8 @@ public class FastaFile extends AlignFile anots[i] = new Annotation("" + cn, null, ' ', Float.NaN); } } - AlignmentAnnotation aa = new AlignmentAnnotation(seq.getName() - .substring(2), seq.getDescription(), anots); + AlignmentAnnotation aa = new AlignmentAnnotation( + seq.getName().substring(2), seq.getDescription(), anots); return aa; } @@ -174,35 +180,21 @@ public class FastaFile extends AlignFile addProperties(al); for (int i = 0; i < annotations.size(); i++) { - AlignmentAnnotation aa = annotations - .elementAt(i); + AlignmentAnnotation aa = annotations.elementAt(i); aa.setPadGaps(true, al.getGapCharacter()); al.addAnnotation(aa); } } - /** - * DOCUMENT ME! - * - * @param s - * DOCUMENT ME! - * @param len - * DOCUMENT ME! - * @param gaps - * DOCUMENT ME! - * @param displayId - * DOCUMENT ME! - * - * @return DOCUMENT ME! - */ - public String print(SequenceI[] s) + @Override + public String print(SequenceI[] s, boolean jvsuffix) { out = new StringBuffer(); int i = 0; while ((i < s.length) && (s[i] != null)) { - out.append(">" + printId(s[i])); + out.append(">" + printId(s[i], jvsuffix)); if (s[i].getDescription() != null) { out.append(" " + s[i].getDescription()); @@ -234,15 +226,4 @@ public class FastaFile extends AlignFile return out.toString(); } - - /** - * DOCUMENT ME! - * - * @return DOCUMENT ME! - */ - @Override - public String print() - { - return print(getSeqsAsArray()); - } }