import compbio.data.msa.SequenceAnnotation;\r
import compbio.data.sequence.Alignment;\r
import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.RNAStruct;\r
import compbio.data.sequence.ScoreManager;\r
import compbio.data.sequence.ClustalAlignmentUtil;\r
import compbio.data.sequence.SequenceUtil;\r
ScoreManager result = analize(inputFile,\r
((SequenceAnnotation<T>) msaws), preset, customOptions);\r
\r
- System.out.println(result\.asRNAStruct().toString());\r
+ // A System.out.println just for testing!\r
+ System.out.println(result.toString());\r
+ \r
IOHelper.writeOut(writer, result);\r
} else if (service.getServiceType() == MsaWS.class) {\r
alignment = align(inputFile, (MsaWS<T>) msaws, preset,\r
* @return String\r
*/\r
\r
- static <T> String fold(File file, FoldWS<T> foldws, Preset<T> preset,\r
- List<Option<T>> customOptions) {\r
- FileInputStream instream = null;\r
- Alignment alignment = null;\r
- String rnastruct = null;\r
- try {\r
- instream = new FileInputStream(file);\r
- alignment = ClustalAlignmentUtil.readClustalFile(instream);\r
- instream.close();\r
- String jobId = null;\r
- if (customOptions != null && preset != null) {\r
- System.out.println("WARN: Parameters (-f) are defined together"\r
- + "with a preset (-r), ignoring preset! ");\r
- }\r
- if (customOptions != null) {\r
- jobId = foldws.customFold(alignment, customOptions);\r
- } else if (preset != null) {\r
- jobId = foldws.presetFold(alignment, preset);\r
- } else {\r
- jobId = foldws.fold(alignment);\r
- }\r
- System.out.println("\n\ncalling fold.........");\r
- Thread.sleep(1000);\r
- rnastruct = foldws.getResult(jobId);\r
- \r
- } catch (IOException e) {\r
- System.err.println("Exception while reading the input file. Exception details: ");\r
- e.printStackTrace();\r
- } catch (UnknownFileFormatException e) {\r
- System.err.println("Exception while reading input file. Doesnt look like a Clustal format file");\r
- e.printStackTrace();\r
- } catch (JobSubmissionException e) {\r
- System.err.println("Exception while submitting job to the web server. ");\r
- e.printStackTrace();\r
- } catch (ResultNotAvailableException e) {\r
- System.err.println("Exception while waiting for results. Exception details: ");\r
- e.printStackTrace();\r
- } catch (InterruptedException ignored) {\r
- // ignore and propagate an interruption\r
- Thread.currentThread().interrupt();\r
- } catch (WrongParameterException e) {\r
- e.printStackTrace();\r
- } finally {\r
- if (instream != null) {\r
- try {\r
- instream.close();\r
- } catch (IOException ignored) {\r
- // ignore\r
- }\r
- }\r
- }\r
- return rnastruct;\r
- }\r
- \r
+// static <T> String fold(File file, FoldWS<T> foldws, Preset<T> preset,\r
+// List<Option<T>> customOptions) {\r
+// FileInputStream instream = null;\r
+// Alignment alignment = null;\r
+// String rnastruct = null;\r
+// try {\r
+// instream = new FileInputStream(file);\r
+// alignment = ClustalAlignmentUtil.readClustalFile(instream);\r
+// instream.close();\r
+// String jobId = null;\r
+// if (customOptions != null && preset != null) {\r
+// System.out.println("WARN: Parameters (-f) are defined together"\r
+// + "with a preset (-r), ignoring preset! ");\r
+// }\r
+// if (customOptions != null) {\r
+// jobId = foldws.customFold(alignment, customOptions);\r
+// } else if (preset != null) {\r
+// jobId = foldws.presetFold(alignment, preset);\r
+// } else {\r
+// jobId = foldws.fold(alignment);\r
+// }\r
+// System.out.println("\n\ncalling fold.........");\r
+// Thread.sleep(1000);\r
+// rnastruct = foldws.getResult(jobId);\r
+// \r
+// } catch (IOException e) {\r
+// System.err.println("Exception while reading the input file. Exception details: ");\r
+// e.printStackTrace();\r
+// } catch (UnknownFileFormatException e) {\r
+// System.err.println("Exception while reading input file. Doesnt look like a Clustal format file");\r
+// e.printStackTrace();\r
+// } catch (JobSubmissionException e) {\r
+// System.err.println("Exception while submitting job to the web server. ");\r
+// e.printStackTrace();\r
+// } catch (ResultNotAvailableException e) {\r
+// System.err.println("Exception while waiting for results. Exception details: ");\r
+// e.printStackTrace();\r
+// } catch (InterruptedException ignored) {\r
+// // ignore and propagate an interruption\r
+// Thread.currentThread().interrupt();\r
+// } catch (WrongParameterException e) {\r
+// e.printStackTrace();\r
+// } finally {\r
+// if (instream != null) {\r
+// try {\r
+// instream.close();\r
+// } catch (IOException ignored) {\r
+// // ignore\r
+// }\r
+// }\r
+// }\r
+// return rnastruct;\r
+// }\r
+// \r
/**\r
* Prints Jws2Client usage information to standard out\r
* \r
import compbio.data.msa.JABAService;\r
import compbio.data.msa.SequenceAnnotation;\r
import compbio.data.sequence.FastaSequence;\r
-import compbio.data.sequence.RNAStructScoreManager;\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.metadata.JobSubmissionException;\r
import compbio.metadata.LimitExceededException;\r
super (new RNAalifold(), log);\r
}\r
\r
- \r
- // for testing\r
- @Override\r
- public RNAStructScoreManager getAnnotation(String jobId) \r
- throws ResultNotAvailableException {\r
- return WSUtil.getAnnotation(jobId, log);\r
- }\r
- \r
- @Override\r
- public String analize(List<FastaSequence> sequences)\r
- throws UnsupportedRuntimeException, LimitExceededException,\r
- JobSubmissionException {\r
- WSUtil.validateFastaInput(sequences);\r
- ConfiguredExecutable<RNAalifoldWS> confRNAalifold = init(sequences);\r
- return WSUtil.fold(sequences, confRNAalifold, log, "analize",\r
- getLimit(""));\r
- }\r
-\r
- @Override\r
- public String customAnalize(List<FastaSequence> sequences,\r
- List<Option<RNAalifold>> options) throws UnsupportedRuntimeException,\r
- LimitExceededException, JobSubmissionException,\r
- WrongParameterException {\r
- WSUtil.validateFastaInput(sequences);\r
- ConfiguredExecutable<RNAalifold> confRNAalifold = init(sequences);\r
- \r
- List<String> params = WSUtil.getCommands(options,\r
- AACon.KEY_VALUE_SEPARATOR);\r
- confRNAalifold.addParameters(params);\r
- return WSUtil.fold(sequences, confRNAalifold, log, "customAnalize",\r
- getLimit(""));\r
- }\r
- \r
- \r
/*\r
* No presets are supported, thus the result of this call will be as simple\r
* call to analize without parameters\r