23
Mobyle Workshop September 28, 2012 Jennifer Dommer Bioinformatics 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

BMID training - Mobyle Workshop - September 28, 2012

Embed Size (px)

Citation preview

Page 1: BMID training  - Mobyle Workshop - September 28, 2012

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

Page 2: BMID training  - Mobyle Workshop - September 28, 2012

2

Mobyle Framework : Command-line Application to Web Application

Page 3: BMID training  - Mobyle Workshop - September 28, 2012

3

Mobyle Framework : Command-line Application to Web Application

Page 4: BMID training  - Mobyle Workshop - September 28, 2012

4

Mobyle Framework : Command-line Application to Web Application

Page 5: BMID training  - Mobyle Workshop - September 28, 2012

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

Page 6: BMID training  - Mobyle Workshop - September 28, 2012

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

Page 7: BMID training  - Mobyle Workshop - September 28, 2012

The Command Line

7

These are all algorithm options

Page 8: BMID training  - Mobyle Workshop - September 28, 2012

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

Page 9: BMID training  - Mobyle Workshop - September 28, 2012

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/

Page 10: BMID training  - Mobyle Workshop - September 28, 2012

Head Tag in BMID

10

Included by default

name tag

authors tag

Page 11: BMID training  - Mobyle Workshop - September 28, 2012

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)

Page 12: BMID training  - Mobyle Workshop - September 28, 2012

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)

Page 13: BMID training  - Mobyle Workshop - September 28, 2012

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)

Page 14: BMID training  - Mobyle Workshop - September 28, 2012

BMID - paragraph

14

The name

tag should be

unique.

The layout tag

is automatically

generated by

BMID

Page 15: BMID training  - Mobyle Workshop - September 28, 2012

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)

Page 16: BMID training  - Mobyle Workshop - September 28, 2012

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.

Page 17: BMID training  - Mobyle Workshop - September 28, 2012

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.

Page 18: BMID training  - Mobyle Workshop - September 28, 2012

The Command Line

18

Page 19: BMID training  - Mobyle Workshop - September 28, 2012

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

Page 20: BMID training  - Mobyle Workshop - September 28, 2012

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.

Page 21: BMID training  - Mobyle Workshop - September 28, 2012

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.

Page 22: BMID training  - Mobyle Workshop - September 28, 2012

The Command Line

22

Page 23: BMID training  - Mobyle Workshop - September 28, 2012

The Interface

23