+ log.error("IOException while writing input file into the disk: "\r
+ + e.getLocalizedMessage(), e);\r
+ throw new JobSubmissionException(\r
+ "We are sorry by JABAWS server seems to have a problem! "\r
+ + e.getLocalizedMessage(), e);\r
+ }\r
+ }\r
+\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 RNAStructScoreManager readRNAStruct(String workDirectory,\r
+ String structFile) throws IOException, FileNotFoundException {\r
+ \r
+ assert !compbio.util.Util.isEmpty(workDirectory);\r
+ assert !compbio.util.Util.isEmpty(structFile);\r
+ // The stdout from RNAalifold\r
+ File sFile = new File(compbio.engine.client.Util.getFullPath(\r
+ workDirectory, structFile));\r
+ // Base pair probability matrix (-p option)\r
+ File aliFile = new File(compbio.engine.client.Util.getFullPath(\r
+ workDirectory, "alifold.out"));\r
+ // Check that stdout file exists\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
+ // Check that base pair probability file exists\r
+ if(!aliFile.exists()) {\r
+ log.warn("The file alifold.out is not found for the jobId "\r
+ + workDirectory + "Is the -p or --MEA option not specified?");\r
+ return RNAStructReader.readRNAStructStream(new FileInputStream(sFile));\r
+ \r
+ } else {\r
+ return RNAStructReader.readRNAStructStream(new FileInputStream(sFile), \r
+ new FileInputStream(aliFile));\r