1 / 20

Mobyle XML

Version history: First version for training Nick and Art – Vivek, 02/07/2011. Mobyle XML. Vivek G opalan. Mobyle XML. Link between command-line application and web-form or web service Defines the command-line application documentations and arguments in XML format.

Download Presentation

Mobyle XML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Version history: First version for training Nick and Art – Vivek, 02/07/2011 Mobyle XML Vivek Gopalan

  2. Mobyle XML • Link between command-line application and web-form or web service • Defines the command-line application documentations and arguments in XML format

  3. Mobyle Framework : Command-line Application to Web Application clustalw-mobyle.xml

  4. Tutorial • Assume Vivek has written a simple command-line application called fah2celsiusto convert Fahrenheit (F) to Celsius (C) fah2celsius --input 270 • The above commands prints the Celsius value in the standard output. • Let’s convert this simple application to web application using Mobyle Framework

  5. Implementation/Deployment steps • Create a Mobyle XML file called fah2celsius.xml to handle the application input and output parameters. fah2celsius --input 270 • Copy the file to the Local/Services/Programs folder in Mobyle library folder • Mobyle folder is configured by default to fetch XML files from this folder • Deploy the fah2celsius.xml to the Mobyle web location using Tools/mobdeploy command • The deployment step checks erros and processes the XML file from the above folder and copy it to the web folder that is accessible by Mobyle application. Tools/mobdeploy deploy -p fah2celsus • Test the deployment from the Mobyle web interface Design slide link

  6. 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/

  7. Mobyle XML file – head tag (meta data) name tag (usually same as the XML file name), used to name job name category tag is used to show the fah2cesius 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/

  8. Mobyle XML file – parameter Vs Paragraph Parameter represents a specific command line argument and represent one HTML form component or widget. First parameter (input_value) fah2celsius --input 270 3rd parameter (output_file) 1st parameter (input_value) 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” XML view generated using http://xmlgrid.net/

  9. Parameter • Defines the specific argument of command line arguments • Should contain unique name • value and/or default value • Code to generate the command-line argument string • Written as simple python conditions • User-friendly description and comments • Relative position of it in the command-line • Precondition to generate the condition • E.g only add the parameter value if some other parameter value is selected • Written as simple python conditions

  10. Parameter - continues • Different data types that is mapped to specific HTML form components or widgets • Sequence/Alignment/Tree (file upload button) • Integer/Float/String (Text box) • Text/Report (File upload button) • Choice/MultipleChoice (list box) • Boolean (Check box) • Can be categorized based on the attributes • Issimple ( show in simple view only) • Ishidden (do not show this panel – used for options that are given as default) • Ismandatory (cannot be empty) • Isstdout/isout ( the output files generated from the application – used for pipelining and workflow creation)

  11. 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/

  12. Mobyle XML file – Other examples (Boolean type) The vdefvalue selects the default value for Boolean type It can be 0 or 1 XML view generated using http://xmlgrid.net/

  13. Python code snippet • The parameter name is used refer to value • E.ginput_valuecould used to refer to the value of that parameter in any 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

  14. Python code snippets 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 string 3. Double or single quote 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 represent the parameter name in that XML file.

  15. Python code snippets 3. Check value is present in a list: (“”,” –a tempCal ”) [ input_type in [‘fahrenheit’,’celsius’] ] If input_type parameter value is fahrenheit or celsius then “ –a tempCal “ will be used as 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.

  16. Paragraph • Contains one or more parameters • Group command-line arguments into meaningful categories • E.g. input options, output options, advanced features • Could be used to control the layout of multiple parameters (not often used now in Mobyle)

  17. 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/

  18. Design steps (follow this before implementation step) • 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) • Use the command-line arguments names (eg. --input or -x ) as part of the parameter description (<prompt> tag) • Note down the different types of output files generated from application • Useful to display the output file in job results and linking to other applications in workflow • Note which parameters will be assigned simple and/mandatory • Try to use all the command-line arguments for the applications • Helps experienced command-line user to related web form to the command-line utility Implementation slide link

  19. Final notes • Use Xinclude option for parameters that uses local resources • Eg blast databases • Egbowtie indexes • Remember • We covered only the <program> tag in this tutorial • Mobyle manages the job results and workflow definitions also through XML • Workflow definitions can be automatically handled Mobyle Workflow application or manually by user.

  20. Thanks….

More Related