X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FJPredFile.java;h=0734ccd1de228f665d2c95e6d78baf7004caf9f4;hb=4f24ef0848cf3c43ba0467f31fce1baa5c57aad5;hp=5483f94c82707c3bbffb867a4dd43db46dfdcd1d;hpb=0b49125cd94fa3b7ebe7fada108e8b549ffe540e;p=jalview.git diff --git a/src/jalview/io/JPredFile.java b/src/jalview/io/JPredFile.java index 5483f94..0734ccd 100755 --- a/src/jalview/io/JPredFile.java +++ b/src/jalview/io/JPredFile.java @@ -24,14 +24,11 @@ */ package jalview.io; -import jalview.datamodel.*; - -import jalview.util.*; - import java.io.*; - import java.util.*; +import jalview.datamodel.*; + /** * DOCUMENT ME! @@ -200,8 +197,8 @@ public class JPredFile extends AlignFile for (int j = 0; j < i; j++) { - scores.set(j, - (Object) ((Float) scores.get(j)).toString()); + scores.setElementAt( + (Object) ((Float) scores.elementAt(j)).toString(), j); } scores.addElement((Object) ascore); @@ -223,7 +220,7 @@ public class JPredFile extends AlignFile for (int i = 0; i < numSymbols; i++) { - conf.set(i, (Object) symbols.nextToken()); + conf.setElementAt( symbols.nextToken(), i); } } else @@ -266,12 +263,12 @@ public class JPredFile extends AlignFile } } } - + /* leave it to the parser user to actually check this. if (noSeqs < 1) { throw new IOException( "JpredFile Parser: No sequence in the prediction!"); - } + }*/ maxLength = seq_entries.elementAt(0).toString().length(); @@ -285,9 +282,9 @@ public class JPredFile extends AlignFile if (!Symscores.containsKey(ids.elementAt(i)) && !isValidProteinSequence(newSeq.getSequence())) { - throw new IOException( - "JPredConcise: Not a valid protein sequence - (" + - ids.elementAt(i).toString() + ")"); + throw new IOException("JPredConcise: " + +AppletFormatAdapter.INVALID_CHARACTERS +" : " + +ids.elementAt(i).toString() + ")"); } if (maxLength != seq_entries.elementAt(i).toString().length()) @@ -341,6 +338,34 @@ public class JPredFile extends AlignFile e.printStackTrace(); } } + Vector annotSeqs=null; + /** + * removeNonSequences + */ + public void removeNonSequences() + { + if (annotSeqs!=null) + return; + annotSeqs = new Vector(); + Vector newseqs = new Vector(); + int i=0; + int j=seqs.size(); + for (; i