X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FJPredFile.java;h=4a07c9a7ae69bcebe3519861fd8efe6e79a8273a;hb=04011072920c5e2587a8d549869ee47e28ad7d81;hp=cadf1535555db4ded65a52c50ea3a29d3003d587;hpb=f24dacb1da56fccf05d684e2f4899facec2aecf7;p=jalview.git diff --git a/src/jalview/io/JPredFile.java b/src/jalview/io/JPredFile.java index cadf153..4a07c9a 100755 --- a/src/jalview/io/JPredFile.java +++ b/src/jalview/io/JPredFile.java @@ -24,12 +24,11 @@ */ package jalview.io; -import jalview.datamodel.*; - import java.io.*; - import java.util.*; +import jalview.datamodel.*; + /** * DOCUMENT ME! @@ -45,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. @@ -198,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); @@ -221,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 @@ -264,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(); @@ -283,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()) @@ -339,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