Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

BMID training - Mobyle Workshop - September 28, 2012

691 views

Published on

  • Be the first to comment

  • Be the first to like this

BMID training - Mobyle Workshop - September 28, 2012

  1. 1. Mobyle WorkshopSeptember 28, 2012Original slides by Vivek Gopalan, Ph.D.Fmr. Scientific Infrastructure Team Lead Jennifer Dommer Bioinformatics Software Developer Bioinformatics and Computational Biosciences Branch (BCBB) OCICB/OSMO/OD/NIAID/NIH
  2. 2. Mobyle Framework : Command-line Application to Web Application 2
  3. 3. Mobyle Framework : Command-line Application to Web Application 3
  4. 4. Mobyle Framework : Command-line Application to Web Application 4
  5. 5. 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
  6. 6. 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
  7. 7. The Command Line These are all algorithm options 7
  8. 8. Mobyle XML file – primary tags program tag is the primary tag used to define about specific application 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 XML view generated using http://xmlgrid.net/ 8
  9. 9. Mobyle XML file – head tag (meta data) name tag (usually same as the XML file name), used to name job category tag is used to show the fah2celsius application in the applications list tree in Mobyle interface command tag represent the actual command or executable file name XML view generated using http://xmlgrid.net/ 9
  10. 10. Head Tag in BMIDIncluded by default name tag authors tag 10
  11. 11. Mobyle XML file – parameter Parameter represents a specific command line argument and represents one HTML form component or widget. First parameter (input_value)fah2celsius --input 270 11
  12. 12. Mobyle XML file – parameter vs Paragraph Parameter represents a specific command line argument and represents one HTML form component or widget. First parameter (input_value) fah2celsius --input 270 1st parameter (input_value) 3rd parameter (output_file)fah2celsius --input 270 --format-output > celcius.txt 2st parameter (format_output) Paragraph represents one or more parameters (command line argument) 2nd and 3rd parameters could be combined as “Output options” 12
  13. 13. Mobyle XML file – paragraph 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) XML view generated using http://xmlgrid.net/ 13
  14. 14. BMID - paragraphThe nametag should beunique.The layout tagis automaticallygenerated byBMID 14
  15. 15. Mobyle XML file – parameter Parameter represents a specific command line argument and represents one HTML form component or widget. First parameter (input_value)fah2celsius --input 270 15
  16. 16. Mobyle XML file – parameter The parameter tag attributes represents the categories The name tag should be unique. The prompt tag gives the simple description 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. XML view generated using http://xmlgrid.net/ 16
  17. 17. BMID - parameterThe The prompt tagtype/datatype/class gives the simpletags defines the type descriptionThe argpos tagdefines the relativeposition of theParameter in the The format tag defines actualcommand line command-line string Generated. A python code snippet is used. 17
  18. 18. The Command Line 18
  19. 19. 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
  20. 20. Python code snippets (examples)1. Concatenation:“ --input “ + str(value)If the value entered by user is 10 then “ --input 10” willBe generated by the above codeNotes:1. Leave a whitespace at the beginning of the code.2. + is used to concatenate two strings3. Double or single quotes should be used to delimit strings2. 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. 20
  21. 21. Python code snippets3. Check value is present in a list:(“”,” –a tempCal ”) [ input_type in [‘fahrenheit’,’celsius’] ]If the input_type parameter value is fahrenheit or celsiusthen “ –a tempCal “ will be used as a parameter command-lineargumentVery often used in the <precond> tag which is used tocheck/evaluate whether the command-line argument for thatparameter could be used or not in the command. 21
  22. 22. The Command Line 22
  23. 23. The Interface 23

×