X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FJPredFile.java;h=0734ccd1de228f665d2c95e6d78baf7004caf9f4;hb=383df9f8b9361eec5ea779a22ceecc90dc7e6960;hp=cadf1535555db4ded65a52c50ea3a29d3003d587;hpb=f24dacb1da56fccf05d684e2f4899facec2aecf7;p=jalview.git diff --git a/src/jalview/io/JPredFile.java b/src/jalview/io/JPredFile.java index cadf153..0734ccd 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! @@ -198,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); @@ -221,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 @@ -264,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(); @@ -283,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()) @@ -339,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