X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webservices%2Fcompbio%2Fws%2Fclient%2FJws2Client.java;h=ae38d9f7771360f81f582b2f82409751a283aab7;hb=7522ace91fc0804a9719dbac9f68bc8154da3132;hp=a06a6fa35b6aebed0f154019e9b9e977de7c8b21;hpb=9072bd850138bedbd005509e5b14bb5e104574b4;p=jabaws.git diff --git a/webservices/compbio/ws/client/Jws2Client.java b/webservices/compbio/ws/client/Jws2Client.java index a06a6fa..ae38d9f 100644 --- a/webservices/compbio/ws/client/Jws2Client.java +++ b/webservices/compbio/ws/client/Jws2Client.java @@ -50,7 +50,6 @@ import compbio.data.msa.RegistryWS; import compbio.data.msa.SequenceAnnotation; import compbio.data.sequence.Alignment; import compbio.data.sequence.FastaSequence; -import compbio.data.sequence.RNAstruct; import compbio.data.sequence.ScoreManager; import compbio.data.sequence.ClustalAlignmentUtil; import compbio.data.sequence.SequenceUtil; @@ -150,7 +149,6 @@ public class Jws2Client { String presetName = CmdHelper.getPresetName(cmd); Metadata msaws = (Metadata) connect(hostname, service); - Metadata foldws = (Metadata) connect(hostname, service); Preset preset = null; if (presetName != null) { preset = MetadataHelper.getPreset(msaws, presetName); @@ -164,7 +162,6 @@ public class Jws2Client { // System.out.println("The Options read from the command line: " + customOptions); Alignment alignment = null; - String rnastruct = null; if (inputFile != null) { Writer writer = null; if (outFile != null) { @@ -178,17 +175,14 @@ public class Jws2Client { ScoreManager result = analize(inputFile, ((SequenceAnnotation) msaws), preset, customOptions); + // A System.out.println just for testing! + System.out.println(result.toString()); + IOHelper.writeOut(writer, result); } else if (service.getServiceType() == MsaWS.class) { alignment = align(inputFile, (MsaWS) msaws, preset, customOptions); IOHelper.writeOut(writer, alignment); - } else if (service.getServiceType() == FoldWS.class) { - rnastruct = fold(inputFile, (FoldWS) foldws, preset, customOptions); - // No IOHelper method for rnastruct/String yet - if (writer != null) { - writer.write(rnastruct); - } } writer.close(); } @@ -537,60 +531,60 @@ public class Jws2Client { * @return String */ - static String fold(File file, FoldWS foldws, Preset preset, - List> customOptions) { - FileInputStream instream = null; - Alignment alignment = null; - String rnastruct = null; - try { - instream = new FileInputStream(file); - alignment = ClustalAlignmentUtil.readClustalFile(instream); - instream.close(); - String jobId = null; - if (customOptions != null && preset != null) { - System.out.println("WARN: Parameters (-f) are defined together" - + "with a preset (-r), ignoring preset! "); - } - if (customOptions != null) { - jobId = foldws.customFold(alignment, customOptions); - } else if (preset != null) { - jobId = foldws.presetFold(alignment, preset); - } else { - jobId = foldws.fold(alignment); - } - System.out.println("\n\ncalling fold........."); - Thread.sleep(1000); - rnastruct = foldws.getResult(jobId); - - } catch (IOException e) { - System.err.println("Exception while reading the input file. Exception details: "); - e.printStackTrace(); - } catch (UnknownFileFormatException e) { - System.err.println("Exception while reading input file. Doesnt look like a Clustal format file"); - e.printStackTrace(); - } catch (JobSubmissionException e) { - System.err.println("Exception while submitting job to the web server. "); - e.printStackTrace(); - } catch (ResultNotAvailableException e) { - System.err.println("Exception while waiting for results. Exception details: "); - e.printStackTrace(); - } catch (InterruptedException ignored) { - // ignore and propagate an interruption - Thread.currentThread().interrupt(); - } catch (WrongParameterException e) { - e.printStackTrace(); - } finally { - if (instream != null) { - try { - instream.close(); - } catch (IOException ignored) { - // ignore - } - } - } - return rnastruct; - } - +// static String fold(File file, FoldWS foldws, Preset preset, +// List> customOptions) { +// FileInputStream instream = null; +// Alignment alignment = null; +// String rnastruct = null; +// try { +// instream = new FileInputStream(file); +// alignment = ClustalAlignmentUtil.readClustalFile(instream); +// instream.close(); +// String jobId = null; +// if (customOptions != null && preset != null) { +// System.out.println("WARN: Parameters (-f) are defined together" +// + "with a preset (-r), ignoring preset! "); +// } +// if (customOptions != null) { +// jobId = foldws.customFold(alignment, customOptions); +// } else if (preset != null) { +// jobId = foldws.presetFold(alignment, preset); +// } else { +// jobId = foldws.fold(alignment); +// } +// System.out.println("\n\ncalling fold........."); +// Thread.sleep(1000); +// rnastruct = foldws.getResult(jobId); +// +// } catch (IOException e) { +// System.err.println("Exception while reading the input file. Exception details: "); +// e.printStackTrace(); +// } catch (UnknownFileFormatException e) { +// System.err.println("Exception while reading input file. Doesnt look like a Clustal format file"); +// e.printStackTrace(); +// } catch (JobSubmissionException e) { +// System.err.println("Exception while submitting job to the web server. "); +// e.printStackTrace(); +// } catch (ResultNotAvailableException e) { +// System.err.println("Exception while waiting for results. Exception details: "); +// e.printStackTrace(); +// } catch (InterruptedException ignored) { +// // ignore and propagate an interruption +// Thread.currentThread().interrupt(); +// } catch (WrongParameterException e) { +// e.printStackTrace(); +// } finally { +// if (instream != null) { +// try { +// instream.close(); +// } catch (IOException ignored) { +// // ignore +// } +// } +// } +// return rnastruct; +// } +// /** * Prints Jws2Client usage information to standard out *