*/
package jalview.io;
+import java.util.Locale;
+
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Sequence;
/**
* Creates a new JPredFile object.
*
+ * BH allows File or String
+ *
* @param inFile
* DOCUMENT ME!
* @param sourceType
* @throws IOException
* DOCUMENT ME!
*/
- public JPredFile(String inFile, DataSourceType sourceType)
+ public JPredFile(Object inFile, DataSourceType sourceType)
throws IOException
{
super(inFile, sourceType);
@Override
public void parse() throws IOException
{
- // JBPNote log.System.out.println("all read in ");
+ // JBPNote log.jalview.bin.Console.outPrintln("all read in ");
String line;
QuerySeqPosition = -1;
noSeqs = 0;
{
ascore = symbols.nextToken();
- Float score = new Float(ascore);
+ Float score = Float.valueOf(ascore);
scores.addElement(score);
}
for (int j = 0; j < i; j++)
{
- scores.setElementAt(
- ((Float) scores.elementAt(j)).toString(), j);
+ scores.setElementAt(((Float) scores.elementAt(j)).toString(),
+ j);
}
scores.addElement(ascore);
}
else if (id.equals("jnetconf"))
{
- // log.debug System.out.println("here");
+ // log.debug jalview.bin.Console.outPrintln("here");
id = "Prediction Confidence";
this.conf = new Vector(numSymbols);
seq_entries.addElement(newseq.toString());
ids.addElement(id);
- Symscores.put(id, new Integer(ids.size() - 1));
+ Symscores.put(id, Integer.valueOf(ids.size() - 1));
}
}
}
{
// Add all sequence like objects
Sequence newSeq = new Sequence(ids.elementAt(i).toString(),
- seq_entries.elementAt(i).toString(), 1, seq_entries
- .elementAt(i).toString().length());
+ seq_entries.elementAt(i).toString(), 1,
+ seq_entries.elementAt(i).toString().length());
if (maxLength != seq_entries.elementAt(i).toString().length())
{
- throw new IOException(
- MessageManager
- .formatMessage(
- "exception.jpredconcide_entry_has_unexpected_number_of_columns",
- new String[] { ids.elementAt(i).toString() }));
+ throw new IOException(MessageManager.formatMessage(
+ "exception.jpredconcide_entry_has_unexpected_number_of_columns",
+ new String[]
+ { ids.elementAt(i).toString() }));
}
- if ((newSeq.getName().startsWith("QUERY") || newSeq.getName()
- .startsWith("align;")) && (QuerySeqPosition == -1))
+ if ((newSeq.getName().startsWith("QUERY")
+ || newSeq.getName().startsWith("align;"))
+ && (QuerySeqPosition == -1))
{
QuerySeqPosition = seqs.size();
}
} catch (Exception e)
{
tal = null;
- IOException ex = new IOException(
- MessageManager
- .formatMessage(
- "exception.couldnt_parse_concise_annotation_for_prediction",
- new String[] { e.getMessage() }));
+ IOException ex = new IOException(MessageManager.formatMessage(
+ "exception.couldnt_parse_concise_annotation_for_prediction",
+ new String[]
+ { e.getMessage() }));
e.printStackTrace(); // java 1.1 does not have :
// ex.setStackTrace(e.getStackTrace());
throw ex;
}
/**
- * DOCUMENT ME!
*
* @param args
- * DOCUMENT ME!
+ * @j2sIgnore
*/
public static void main(String[] args)
{
for (int i = 0; i < jpred.seqs.size(); i++)
{
- System.out.println(((Sequence) jpred.seqs.elementAt(i)).getName()
+ jalview.bin.Console.outPrintln(((Sequence) jpred.seqs.elementAt(i)).getName()
+ "\n"
+ ((Sequence) jpred.seqs.elementAt(i)).getSequenceAsString()
+ "\n");
}
} catch (java.io.IOException e)
{
- System.err.println("Exception " + e);
+ jalview.bin.Console.errPrintln("Exception " + e);
// e.printStackTrace(); not java 1.1 compatible!
}
}
// check that no stray annotations have been added at the end.
{
SequenceI sq = seqs.elementAt(j - 1);
- if (sq.getName().toUpperCase().startsWith("JPRED"))
+ if (sq.getName().toUpperCase(Locale.ROOT).startsWith("JPRED"))
{
annotSeqs.addElement(sq);
seqs.removeElementAt(--j);
* out = BLCFile.print(s);
*
* AlignFrame af = new AlignFrame(null, s); af.resize(700, 500); af.show();
- * System.out.println(out); } catch (java.io.IOException e) {
- * System.out.println("Exception " + e); } } }
+ * jalview.bin.Console.outPrintln(out); } catch (java.io.IOException e) {
+ * jalview.bin.Console.outPrintln("Exception " + e); } } }
*/