+/*
+* Jalview - A Sequence Alignment Editor and Viewer
+* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+*/
+
/**
* PredFile.java
* JalviewX / Vamsas Project
* JPred.seq.concise reader
*/
+
package jalview.io;
import jalview.datamodel.*;
Vector conf;
Hashtable Scores; // Hash of names and score vectors
Hashtable Symscores; // indexes of symbol annotation properties in sequenceI vector
+ private int QuerySeqPosition;
+ public void setQuerySeqPosition(int QuerySeqPosition)
+ {
+ this.QuerySeqPosition = QuerySeqPosition;
+ }
+
+ public int getQuerySeqPosition()
+ {
+ return QuerySeqPosition;
+ }
+ public Hashtable getScores() {
+ return Scores;
+ }
+ public Hashtable getSymscores() {
+ return Symscores;
+ }
+
public JPredFile(String inStr)
{
super(inStr);
super.initData();
Scores = new Hashtable();
+ ids = null;
+ conf = null;
}
public JPredFile(String inFile, String type)
/**
* parse a JPred concise file into a sequence-alignment like object.
*/
-
public void parse()
throws IOException
{
-System.out.println("all read in ");
+ // JBPNote log.System.out.println("all read in ");
String line;
-
+ QuerySeqPosition = -1;
noSeqs = 0;
Vector seq_entries = new Vector();
Vector ids = new Vector();
}
else if (id.equals("jnetconf"))
{
- System.out.println("here");
+ // log.debug System.out.println("here");
id = "Prediction Confidence";
this.conf = new Vector(numSymbols);
for (int i = 0; i < numSymbols; i++)
name = id.substring(id.indexOf(";")+1)+"_"+1;
}
ids.addElement(name);
+
noSeqs++;
}
else
ids.elementAt(i).toString()
+ ") has an unexpected number of columns");
}
+ if (newSeq.getName().startsWith("QUERY") && QuerySeqPosition==-1) {
+ QuerySeqPosition = seqs.size();
+ }
+
seqs.addElement(newSeq);
}
}
catch (java.io.IOException e)
{
- System.out.println("Exception " + e);
+ System.err.println("Exception " + e);
e.printStackTrace();
}
}