| 1 |
|
package jalview.ws.slivkaws; |
| 2 |
|
|
| 3 |
|
|
| 4 |
|
import jalview.datamodel.AlignmentI; |
| 5 |
|
import jalview.datamodel.SequenceI; |
| 6 |
|
import jalview.io.DataSourceType; |
| 7 |
|
import jalview.io.FileFormat; |
| 8 |
|
import jalview.io.FormatAdapter; |
| 9 |
|
import jalview.ws.api.JobId; |
| 10 |
|
import jalview.ws.api.MultipleSequenceAlignmentI; |
| 11 |
|
import jalview.ws.params.ArgumentI; |
| 12 |
|
import jalview.ws.params.InvalidArgumentException; |
| 13 |
|
import jalview.ws.params.WsParamSetI; |
| 14 |
|
import java.io.IOError; |
| 15 |
|
import java.io.IOException; |
| 16 |
|
import java.rmi.ServerError; |
| 17 |
|
import java.util.Collection; |
| 18 |
|
import java.util.List; |
| 19 |
|
|
| 20 |
|
import uk.ac.dundee.compbio.slivkaclient.RemoteFile; |
| 21 |
|
import uk.ac.dundee.compbio.slivkaclient.SlivkaClient; |
| 22 |
|
import uk.ac.dundee.compbio.slivkaclient.SlivkaService; |
| 23 |
|
|
| |
|
| 0% |
Uncovered Elements: 20 (20) |
Complexity: 6 |
Complexity Density: 0.46 |
|
| 24 |
|
public class SlivkaMsaServiceInstance extends SlivkaWSInstance implements MultipleSequenceAlignmentI |
| 25 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 26 |
0 |
SlivkaMsaServiceInstance(SlivkaClient client, SlivkaService service, String category) {... |
| 27 |
0 |
super(client, service, category); |
| 28 |
0 |
style = ServiceClient.MSAWSCLIENT; |
| 29 |
|
} |
| 30 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 31 |
0 |
@Override... |
| 32 |
|
public JobId align(List<SequenceI> toalign, WsParamSetI parameters, List<ArgumentI> list) throws Throwable |
| 33 |
|
{ |
| 34 |
0 |
return super.submit(toalign, parameters, list); |
| 35 |
|
} |
| 36 |
|
|
| |
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 4 |
Complexity Density: 0.4 |
|
| 37 |
0 |
@Override... |
| 38 |
|
public AlignmentI getAlignmentFor(JobId jobId) throws InvalidArgumentException, ServerError, IOError |
| 39 |
|
{ |
| 40 |
0 |
Collection<RemoteFile> files; |
| 41 |
0 |
try |
| 42 |
|
{ |
| 43 |
0 |
files = client.fetchFilesList(jobId.getJobId()); |
| 44 |
0 |
for (RemoteFile f : files) |
| 45 |
|
{ |
| 46 |
0 |
if (f.getMediaType().equals("application/clustal")) |
| 47 |
|
{ |
| 48 |
0 |
return new FormatAdapter().readFile(f.getContentUrl().toString(), DataSourceType.URL, FileFormat.Clustal); |
| 49 |
|
} |
| 50 |
0 |
else if (f.getMediaType().equals("application/fasta")) |
| 51 |
|
{ |
| 52 |
0 |
return new FormatAdapter().readFile(f.getContentUrl().toString(), DataSourceType.URL, FileFormat.Fasta); |
| 53 |
|
} |
| 54 |
|
} |
| 55 |
|
} catch (IOException e) |
| 56 |
|
{ |
| 57 |
0 |
throw new IOError(e); |
| 58 |
|
} |
| 59 |
0 |
return null; |
| 60 |
|
} |
| 61 |
|
} |