de Bruin et al. Workflow 1
Created: 2012-08-01 08:50:28
Last updated: 2012-08-01 08:54:59
This is "Workflow 1" from de Bruin et al., Mol. Cell. Proteomics 2012.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (0)
Titles (0)
Descriptions (0)
Dependencies (0)
Inputs (5)
Name |
Description |
Tandem_Param_File |
|
FASTA_File |
|
Log_File |
|
mzXML_File |
|
Prophet_Pars |
|
Processors (2)
Name |
Type |
Description |
PeptideProphet |
beanshell |
Script/****************** Input descriptions ****************/
//input port: ArrayList input_files (depth 1)
//input port: String arguments (depth 0)
//input port: String log_file (depth 0)
//output port: String output_file (depth 0)
/****************** Class Declarations ****************/
class InProcStreamReader extends Thread
{
private StringBuffer sb;
public InputStream is;
InProcStreamReader(InputStream is) {
this.is = is;
}// InProcStreamReader(InputStream is)
public void run() {
try {
InputStreamReader isr = new InputStreamReader(is);
sb = new StringBuffer();
while ((c = isr.read()) != -1)
sb.append((char) c);
} catch (IOException ioe)
{
ioe.printStackTrace();
}/// catch
}// run
public String getOutput() {
return sb.toString();
}// getOutput
}// InProcStreamReader
/****************** Global variables ******************/
tppDir = "C:\\Inetpub\\tpp-bin\\";
/****************** Global functions ******************/
// Replaces substrings in a string with a replacement string
String replace(String str, String pattern, String replace) {
int s = 0;
int e = 0;
StringBuffer result = new StringBuffer();
while ((e = str.indexOf(pattern, s)) >= 0) {
result.append(str.substring(s, e));
result.append(replace);
s = e+pattern.length();
}// while
result.append(str.substring(s));
return result.toString();
}// String replace(String str, String pattern, String replace)
// Generates the output file name based on the input file
String genOutputFileName(String inputFile) {
return replace(inputFile, "pep.xml", "interact.pep.xml");
}// String genOutputFileName(String inputFile)
// Splits argument string into separate array elements
String[] filterArguments(String arguments) {
String[] retval = arguments.split(" ");
return retval;
}// String[] filterArguments(String arguments) {
/************** Main matter, input checking ************/
if (input_files == void) {
throw new RuntimeException("The 'input_files' port cannot be null.");
}// if
/************ Main matter, Running executable **********/
// Setting up the command line
appArray = new ArrayList();
// Adding the command itself
appArray.add(tppDir + "xinteract.exe");
// Setting the output file
tmpout = genOutputFileName(input_files.get(0));
fin = new File(tmpout);
if (fin.exists())
fin.delete();
appArray.add("-N"+tmpout);
// Filtering out arguments, or setting defaults
if (arguments == void || arguments.equals("")) {
arguments = "-p0.05 -l7 -MONO -OigGtus";
}// if
arglist = filterArguments(arguments);
if (!(arglist == void || arglist[0].equals(""))) {
for (int i = 0; i < arglist.length; i++) {
appArray.add(arglist[i]);
}// for
}// if
// Adding the inputs
for (int i = 0; i < input_files.size(); i++) {
if (!input_files.get(i).contains("interact")) {
appArray.add(input_files.get(i));
}// if
}// for
workdir = new File(tppDir);
launcher = new ProcessBuilder(appArray);
launcher.directory = workdir;
proc = launcher.start();
outputReader = new InProcStreamReader(proc.getInputStream());
outputReader.start();
// any error???
exitVal = proc.waitFor();
outputReader.join();
/************** Main matter, generating log ************/
fstream = new FileWriter(log_file, true);
out = new BufferedWriter(fstream);
if (!(log_file == void || log_file.equals(""))) {
out.write("=============== PeptideProphet ===============");
out.newLine();
out.write("Parameters:");
for (i=0; i |
Workflow_1a |
workflow |
|
Beanshells (2)
Name |
Description |
Inputs |
Outputs |
PeptideProphet |
|
input_files
arguments
log_file
|
output_file
|
Tandem |
|
mzxml_file
fasta_file
parameter_file
log_file
|
tandem_file
|
Outputs (1)
Name |
Description |
pepXML_Output |
|
Datalinks (8)
Source |
Sink |
Prophet_Pars |
PeptideProphet:arguments |
Log_File |
PeptideProphet:log_file |
Workflow_1a:pepXML_Output |
PeptideProphet:input_files |
FASTA_File |
Workflow_1a:FASTA_File |
Log_File |
Workflow_1a:Log_File |
Tandem_Param_File |
Workflow_1a:Tandem_Param_File |
mzXML_File |
Workflow_1a:mzXML_File |
PeptideProphet:output_file |
pepXML_Output |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1
(of 1)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (1)
Featured In Packs (0)
None
Log in to add to one of your Packs
Attributed By (2)
(Workflows/Files)
Favourited By (1)
Statistics
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (0)
No comments yet
Log in to make a comment