Upload
herve-menager
View
235
Download
5
Tags:
Embed Size (px)
Citation preview
Mobyle Workshop
September 28, 2012
Jennifer DommerBioinformatics Software Developer
Bioinformatics and Computational Biosciences Branch (BCBB)
OCICB/OSMO/OD/NIAID/NIH
Original slides by Vivek Gopalan, Ph.D.
Fmr. Scientific Infrastructure Team Lead
2
Mobyle Framework : Command-line Application to Web Application
3
Mobyle Framework : Command-line Application to Web Application
4
Mobyle Framework : Command-line Application to Web Application
BCBB Mobyle Interface Designer (BMID)
A web based GUI for creating Mobyle XML
Uses drag and drop options to create XML
Eliminates the need for users to manually generate
XML
5
Design Steps
Read the manual or help page of the command-line application
• Note whether the order of parameter matters
Categorize the parameters into meaningful groups (“paragraph”)
Note down the different types of output files generated from the
application
• Can be useful to display the output file(s) in job results and link to
other applications in pipeline interface
Note which parameters will be assigned as “mandatory” /
“simple” (if not simple will display on advanced form only)
Try to use all the command-line arguments for the applications
and label arguments on forms with appropriate flags, which helps
experienced command-line user relates form to functionality
• Use the command-line arguments names (e.g., --input or -x) as
part of the parameter description (<prompt> tag)
6
The Command Line
7
These are all algorithm options
Mobyle XML file – primary tags
8XML view generated using http://xmlgrid.net/
head tag contains the metadata about the
Application such as title, author, categories,
Documentation, references, etc.
parameters tag defines the input and output
arguments used by the command-line
program tag is the primary tag used to define about specific application
Mobyle XML file – head tag (meta data)
9
name tag (usually same as the XML file name), used to name job
command tag represent the actual command or executable file name
category tag is used to show the
fah2celsius application in the applications
list tree in Mobyle interface
XML view generated using http://xmlgrid.net/
Head Tag in BMID
10
Included by default
name tag
authors tag
Mobyle XML file – parameter
11
Parameter represents a specific command line argument
and represents one HTML form component or widget.
fah2celsius --input 270
First parameter (input_value)
Mobyle XML file – parameter vs Paragraph
12
fah2celsius --input 270 --format-output > celcius.txt
1st parameter (input_value) 3rd parameter (output_file)
2st parameter (format_output)
Paragraph represents one or more parameters
(command line argument)
2nd and 3rd parameters could be combined as “Output options”
Parameter represents a specific command line argument
and represents one HTML form component or widget.
fah2celsius --input 270
First parameter (input_value)
Mobyle XML file – paragraph
13XML view generated using http://xmlgrid.net/
The name tag should be
unique.
The parameters tag defines multiple
parameters or paragraphs in it
The layout tag could be used for
arranging the parameters in the
paragraph in the web interface (optional)
BMID - paragraph
14
The name
tag should be
unique.
The layout tag
is automatically
generated by
BMID
Mobyle XML file – parameter
15
Parameter represents a specific command line argument
and represents one HTML form component or widget.
fah2celsius --input 270
First parameter (input_value)
Mobyle XML file – parameter
16XML view generated using http://xmlgrid.net/
The parameter tag attributes represents the categories
The prompt tag gives the simple description
The name tag should be unique.
The type/datatype/class tags defines the type
The argpos tag defines the relative position of the
Parameter in the command line
The format tag defines actual command-line string
Generated. A python code snippet is used.
BMID - parameter
17
The
type/datatype/class
tags defines the type
The prompt tag
gives the simple
description
The argpos tag
defines the relative
position of the
Parameter in the
command lineThe format tag defines actual
command-line string
Generated. A python code
snippet is used.
The Command Line
18
Python code snippet
The parameter name is used refer to its value
• E.g., input_value could be used to refer to the
value of that parameter in any other parameters
Special variables - value & vdef
• Parameters cannot have value or vdef as their
names or id.
• value: represents the selected value of that
parameter or file name (if parameter is file upload)
• vdef: represents the default value of that parameter
19
Python code snippets (examples)
20
1. Concatenation:
“ --input “ + str(value)
If the value entered by user is 10 then “ --input 10” will
Be generated by the above code
Notes:
1. Leave a whitespace at the beginning of the code.
2. + is used to concatenate two strings
3. Double or single quotes should be used to delimit strings
2. One line Condition:
(“” , “ -b ”)[value is not None]
(“” , “ --o ” + str(value))[value != vdef]
(“ --x ” + vdef , “ --x ” + value)[input_value < 5 ]
General structure : circular bracket and square bracket
(false action, true action) [condition]
The input_value represents the parameter name in that XML file.
Python code snippets
21
3. Check value is present in a list:
(“”,” –a tempCal ”) [ input_type in [‘fahrenheit’,’celsius’] ]
If the input_type parameter value is fahrenheit or celsius
then “ –a tempCal “ will be used as a parameter command-line
argument
Very often used in the <precond> tag which is used to
check/evaluate whether the command-line argument for that
parameter could be used or not in the command.
The Command Line
22
The Interface
23