X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fio%2FJPredFile.java;h=4a07c9a7ae69bcebe3519861fd8efe6e79a8273a;hb=2ef43e1e505af2742f1c3a59619c8a4357ea82c4;hp=5483f94c82707c3bbffb867a4dd43db46dfdcd1d;hpb=0b49125cd94fa3b7ebe7fada108e8b549ffe540e;p=jalview.git diff --git a/src/jalview/io/JPredFile.java b/src/jalview/io/JPredFile.java index 5483f94..4a07c9a 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! @@ -47,15 +44,6 @@ public class JPredFile extends AlignFile Hashtable Symscores; // indexes of symbol annotation properties in sequenceI vector private int QuerySeqPosition; - /** - * Creates a new JPredFile object. - * - * @param inStr DOCUMENT ME! - */ - public JPredFile(String inStr) - { - super(inStr); - } /** * Creates a new JPredFile object. @@ -200,8 +188,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 +211,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 +254,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 +273,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 +329,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