git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into features/JAL-2316
[jalview.git]
/
src
/
jalview
/
ws
/
jws1
/
JPredThread.java
diff --git
a/src/jalview/ws/jws1/JPredThread.java
b/src/jalview/ws/jws1/JPredThread.java
index
30f9272
..
4e5cadc
100644
(file)
--- a/
src/jalview/ws/jws1/JPredThread.java
+++ b/
src/jalview/ws/jws1/JPredThread.java
@@
-1,6
+1,6
@@
/*
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
*
* This file is part of Jalview.
*
@@
-21,6
+21,7
@@
package jalview.ws.jws1;
import jalview.analysis.AlignSeq;
package jalview.ws.jws1;
import jalview.analysis.AlignSeq;
+import jalview.analysis.SeqsetUtils;
import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
@@
-31,7
+32,13
@@
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
import jalview.gui.Desktop;
import jalview.gui.WebserviceInfo;
import jalview.gui.AlignFrame;
import jalview.gui.Desktop;
import jalview.gui.WebserviceInfo;
+import jalview.io.DataSourceType;
+import jalview.io.FileFormatI;
import jalview.io.FormatAdapter;
import jalview.io.FormatAdapter;
+import jalview.io.IdentifyFile;
+import jalview.io.JPredFile;
+import jalview.io.JnetAnnotationMaker;
+import jalview.io.PileUpfile;
import jalview.util.Comparison;
import jalview.util.MessageManager;
import jalview.ws.AWsJob;
import jalview.util.Comparison;
import jalview.util.MessageManager;
import jalview.ws.AWsJob;
@@
-71,6
+78,7
@@
class JPredThread extends JWS1Thread implements WSClientI
* @return true if getResultSet will return a valid alignment and prediction
* result.
*/
* @return true if getResultSet will return a valid alignment and prediction
* result.
*/
+ @Override
public boolean hasResults()
{
if (subjobComplete && result != null && result.isFinished()
public boolean hasResults()
{
if (subjobComplete && result != null && result.isFinished()
@@
-82,6
+90,7
@@
class JPredThread extends JWS1Thread implements WSClientI
return false;
}
return false;
}
+ @Override
public boolean hasValidInput()
{
if (sequence != null)
public boolean hasValidInput()
{
if (sequence != null)
@@
-110,23
+119,23
@@
class JPredThread extends JWS1Thread implements WSClientI
JpredResult result = (JpredResult) this.result;
JpredResult result = (JpredResult) this.result;
- jalview.bin.Cache.log.debug("Parsing output from JNet job.");
+ Cache.log.debug("Parsing output from JNet job.");
// JPredFile prediction = new JPredFile("C:/JalviewX/files/jpred.txt",
// "File");
// JPredFile prediction = new JPredFile("C:/JalviewX/files/jpred.txt",
// "File");
- jalview.io.JPredFile prediction = new jalview.io.JPredFile(
- result.getPredfile(), "Paste");
+ JPredFile prediction = new JPredFile(
+ result.getPredfile(), DataSourceType.PASTE);
SequenceI[] preds = prediction.getSeqsAsArray();
SequenceI[] preds = prediction.getSeqsAsArray();
- jalview.bin.Cache.log.debug("Got prediction profile.");
+ Cache.log.debug("Got prediction profile.");
if ((this.msa != null) && (result.getAligfile() != null))
{
if ((this.msa != null) && (result.getAligfile() != null))
{
- jalview.bin.Cache.log.debug("Getting associated alignment.");
+ Cache.log.debug("Getting associated alignment.");
// we ignore the returned alignment if we only predicted on a single
// sequence
// we ignore the returned alignment if we only predicted on a single
// sequence
- String format = new jalview.io.IdentifyFile().Identify(
- result.getAligfile(), "Paste");
+ FileFormatI format = new IdentifyFile().identify(
+ result.getAligfile(), DataSourceType.PASTE);
- if (jalview.io.FormatAdapter.isValidFormat(format))
+ if (format != null)
{
SequenceI sqs[];
if (predMap != null)
{
SequenceI sqs[];
if (predMap != null)
@@
-140,14
+149,14
@@
class JPredThread extends JWS1Thread implements WSClientI
else
{
al = new FormatAdapter().readFile(result.getAligfile(),
else
{
al = new FormatAdapter().readFile(result.getAligfile(),
- "Paste", format);
+ DataSourceType.PASTE, format);
sqs = new SequenceI[al.getHeight()];
for (int i = 0, j = al.getHeight(); i < j; i++)
{
sqs[i] = al.getSequenceAt(i);
}
sqs = new SequenceI[al.getHeight()];
for (int i = 0, j = al.getHeight(); i < j; i++)
{
sqs[i] = al.getSequenceAt(i);
}
- if (!jalview.analysis.SeqsetUtils.deuniquify(SequenceInfo, sqs))
+ if (!SeqsetUtils.deuniquify(SequenceInfo, sqs))
{
throw (new Exception(
MessageManager
{
throw (new Exception(
MessageManager
@@
-164,7
+173,7
@@
class JPredThread extends JWS1Thread implements WSClientI
{
al.setDataset(null);
}
{
al.setDataset(null);
}
- jalview.io.JnetAnnotationMaker.add_annotation(prediction, al,
+ JnetAnnotationMaker.add_annotation(prediction, al,
FirstSeq, false, predMap);
}
FirstSeq, false, predMap);
}
@@
-172,7
+181,7
@@
class JPredThread extends JWS1Thread implements WSClientI
{
throw (new Exception(MessageManager.formatMessage(
"exception.unknown_format_for_file", new String[] {
{
throw (new Exception(MessageManager.formatMessage(
"exception.unknown_format_for_file", new String[] {
- format, result.getAligfile() })));
+ format.toString(), result.getAligfile() })));
}
}
else
}
}
else
@@
-355,8
+364,8
@@
class JPredThread extends JWS1Thread implements WSClientI
if (msf.length > 1)
{
msa = new vamsas.objects.simple.Msfalignment();
if (msf.length > 1)
{
msa = new vamsas.objects.simple.Msfalignment();
- jalview.io.PileUpfile pileup = new jalview.io.PileUpfile();
- msa.setMsf(pileup.print(msf));
+ PileUpfile pileup = new PileUpfile();
+ msa.setMsf(pileup.print(msf, true));
}
}
}
}
}
}
@@
-420,6
+429,7
@@
class JPredThread extends JWS1Thread implements WSClientI
}
}
}
}
+ @Override
public void StartJob(AWsJob j)
{
if (!(j instanceof JPredJob))
public void StartJob(AWsJob j)
{
if (!(j instanceof JPredJob))
@@
-502,6
+512,7
@@
class JPredThread extends JWS1Thread implements WSClientI
}
}
}
}
+ @Override
public void parseResult()
{
int results = 0; // number of result sets received
public void parseResult()
{
int results = 0; // number of result sets received
@@
-529,6
+540,7
@@
class JPredThread extends JWS1Thread implements WSClientI
wsInfo.showResultsNewFrame
.addActionListener(new java.awt.event.ActionListener()
{
wsInfo.showResultsNewFrame
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(java.awt.event.ActionEvent evt)
{
displayResults(true);
public void actionPerformed(java.awt.event.ActionEvent evt)
{
displayResults(true);
@@
-537,6
+549,7
@@
class JPredThread extends JWS1Thread implements WSClientI
wsInfo.mergeResults
.addActionListener(new java.awt.event.ActionListener()
{
wsInfo.mergeResults
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(java.awt.event.ActionEvent evt)
{
displayResults(false);
public void actionPerformed(java.awt.event.ActionEvent evt)
{
displayResults(false);
@@
-652,21
+665,25
@@
class JPredThread extends JWS1Thread implements WSClientI
}
}
}
}
+ @Override
public void pollJob(AWsJob job) throws Exception
{
((JPredJob) job).result = server.getresult(job.getJobId());
}
public void pollJob(AWsJob job) throws Exception
{
((JPredJob) job).result = server.getresult(job.getJobId());
}
+ @Override
public boolean isCancellable()
{
return false;
}
public boolean isCancellable()
{
return false;
}
+ @Override
public void cancelJob()
{
throw new Error(MessageManager.getString("error.implementation_error"));
}
public void cancelJob()
{
throw new Error(MessageManager.getString("error.implementation_error"));
}
+ @Override
public boolean canMergeResults()
{
return false;
public boolean canMergeResults()
{
return false;