+ \r
+ public static void writeClustalInput(List<FastaSequence> sequences,\r
+ ConfiguredExecutable<?> exec, char gapChar) throws JobSubmissionException {\r
+ \r
+ try {\r
+ File filein = new File(exec.getInput());\r
+ FileOutputStream fout = new FileOutputStream(filein);\r
+ log.debug("File path: " + filein.getAbsolutePath());\r
+ SequenceUtil.writeClustal(fout, sequences, gapChar);\r
+ fout.close();\r
+ } catch (IOException e) {\r
+ log.error("IOException while writing input file into the disk: "\r
+ + e.getLocalizedMessage(), e);\r
+ throw new JobSubmissionException(\r
+ "We are sorry but JABAWS server seems to have a problem! "\r
+ + e.getLocalizedMessage(), e);\r
+ }\r
+ }\r
+ \r
+ public static final RNAstruct readRNAStructFile(String workDirectory,\r
+ String structFile) throws IOException, FileNotFoundException {\r
+ assert !compbio.util.Util.isEmpty(workDirectory);\r
+ assert !compbio.util.Util.isEmpty(structFile);\r
+ File sfile = new File(compbio.engine.client.Util.getFullPath(\r
+ workDirectory, structFile));\r
+ log.trace("RNAALIFOLD OUTPUT FILE PATH: " + sfile.getAbsolutePath());\r
+ if(!(sfile.exists() && sfile.length() > 0)) {\r
+ throw new FileNotFoundException("Result for the jobId "\r
+ + workDirectory + "with file name " + structFile\r
+ + " is not found!");\r
+ }\r
+ return compbio.data.sequence.SequenceUtil.readRNAalifoldResults(\r
+ new FileInputStream(sfile));\r
+ }\r
+ \r
+ \r