|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.utils.galaxy.GalaxyAdaptor
public class GalaxyAdaptor
Adaptor class between the parameter representation of Jstacs in Parameter
s and ParameterSet
s and the parameter representation
in Galaxy.
A GalaxyAdaptor
can be created from a ParameterSet
containing all parameters that are necessary for
the execution of some program that shall be included in a Galaxy installation.
The conversion is done by the method parse(String[])
. If this method is called with first argument equal to "--create"
and second argument a filename, then the Galaxy-representation of the current ParameterSet
is stored to that file. Afterwards, the application
and this file must be added to tool_conf.xml
(see Galaxy tutorial for details).
During the execution of the main program, addResult(Result, boolean, boolean)
and addResultSet(ResultSet, boolean, boolean)
can be used to add results of the computation to the results displayed in Galaxy, to export these and to add these to a summary page. If a
protocol of the program run shall be written, a GalaxyAdaptor.Protocol
object can be obtained by the getProtocol(boolean)
method.
After all results have been added and the protocol has been written, the method writeOutput()
must be called to create
the appropriate output files within Galaxy.
Nested Class Summary | |
---|---|
static class |
GalaxyAdaptor.FileResult
Result for files that are results of some computation. |
static class |
GalaxyAdaptor.LinkedImageResult
Class for an ImageResult that is linked to a file that can be downloaded. |
static class |
GalaxyAdaptor.Protocol
Class for a Protocol writer. |
Constructor Summary | |
---|---|
GalaxyAdaptor(ParameterSet parameters,
String toolname,
String description,
String version,
String command)
Creates a new GalaxyAdaptor from a given ParameterSet containing all parameters
that are necessary for a program is shall be included in a Galaxy installation. |
Method Summary | |
---|---|
void |
addResult(Result res,
boolean export,
boolean includeInSummary)
Adds a result to the results of a program run. |
void |
addResultSet(ResultSet res,
boolean exportAll,
boolean includeInSummary)
Adds a set of results to the results of a program run. |
String |
export(String filename,
Result res)
Exports a specified GalaxyAdaptor.LinkedImageResult of a program execution
to a file provided by filename and returns the
corresponding Galaxy data type. |
void |
fromGalaxyConfig(String filename)
Parses the values of the parameters from a galaxy script file |
static String |
getColor(int depth)
Returns the color for a specified depth within the parameter hierarchy. |
String |
getHtmlFilesPath()
Returns the path where files, e.g. images, that shall be linked from the HTML summary shall be stored in. |
static int |
getHtmlId()
Gets a unique id that can be used, e.g. to create unique filenames. |
static String |
getLegalName(String name)
Returns a legal variable name in Galaxy |
GalaxyAdaptor.Protocol |
getProtocol(boolean exportProtocol)
Returns an object for writing a protocol of a program run |
boolean |
parse(String[] args)
Parses the command line. |
void |
setHelp(File helpfile)
Sets the help, i.e., a more detailed description of the program to the contents of helpfile . |
void |
setHelp(String help)
Sets the help, i.e., a more detailed description of the program to help . |
String |
toGalaxyConfig()
Creates the contents of a Galaxy configuration file from all the information provided to this GalaxyAdaptor . |
void |
writeOutput()
Writes all output files of one program execution. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GalaxyAdaptor(ParameterSet parameters, String toolname, String description, String version, String command)
GalaxyAdaptor
from a given ParameterSet
containing all parameters
that are necessary for a program is shall be included in a Galaxy installation. Besides the
parameters, a name, a description, and a version number of the program must be provided.
Additionally, the user must provide the command to run this program. For instance, if the program is bundled into
a jar MyJar.jar
, this command could be java -jar MyJar.jar
.
parameters
- the parameters of the programtoolname
- the name of the programdescription
- a description of the program, may be supplemented by additional help provided by setHelp(File)
or setHelp(String)
version
- the version of the programcommand
- the command to run the programMethod Detail |
---|
public static String getColor(int depth)
depth
- the depth
public static int getHtmlId()
public void setHelp(String help)
help
.
help
- the help textpublic void setHelp(File helpfile) throws IOException
helpfile
.
helpfile
- the file containing the help text
IOException
- if helpfile
could not be readpublic GalaxyAdaptor.Protocol getProtocol(boolean exportProtocol)
exportProtocol
- if true
the protocol will be exported and accessible
as extra result within Galaxy
public String toGalaxyConfig() throws Exception
GalaxyAdaptor
.
Exception
- if any of the parameters could not be convertedpublic void fromGalaxyConfig(String filename) throws Exception
filename
- the name of the script file
Exception
- if the parameter values could not be parsedpublic String export(String filename, Result res) throws IOException
GalaxyAdaptor.LinkedImageResult
of a program execution
to a file provided by filename
and returns the
corresponding Galaxy data type.
filename
- the filenameres
- the result
IOException
- if the contents of res
could not be written to the filepublic void writeOutput() throws IOException
IOException
- if any of the files could not be created or writtenpublic boolean parse(String[] args) throws Exception
args
- the arguments
true
if this execution should be a program run (as opposed to writing a configuration file)
Exception
- if the arguments could not be parsed or the Galaxy configuration file could not be createdpublic void addResult(Result res, boolean export, boolean includeInSummary)
res
- the resultexport
- if true
the result is exported to its own Galaxy result, e.g. for
evaluation in other application within GalaxyincludeInSummary
- if true
the result is shown on the summary pagepublic void addResultSet(ResultSet res, boolean exportAll, boolean includeInSummary)
res
- the resultsexportAll
- if true
all results in this set are exported to their own Galaxy result, e.g. for
evaluation in other application within GalaxyincludeInSummary
- if true
the results are shown on the summary pagepublic static String getLegalName(String name)
name
- the original name
public String getHtmlFilesPath()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |