X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webservices%2Fcompbio%2Fws%2Fclient%2FJws2Client.java;h=ae38d9f7771360f81f582b2f82409751a283aab7;hb=7522ace91fc0804a9719dbac9f68bc8154da3132;hp=18424f6d4d29137294d4dc4e99e7acf45021023c;hpb=7dc4e39ab68dfe70e50dbf27452e9dfebca6eb62;p=jabaws.git diff --git a/webservices/compbio/ws/client/Jws2Client.java b/webservices/compbio/ws/client/Jws2Client.java index 18424f6..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; @@ -176,6 +175,9 @@ 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, @@ -529,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 *