Back to menu

e-BioInfra Tutorial at the NBIC Conference:

port applications to the grid and run them as part of a workflow

Date: 19 April 2011

Location: NBIC Conference, Lunteren

Instructors: Barbera van Schaik, Mark Santcroos, Aldo Jongejan, Antoine van Kampen and Silvia D. Olabarriaga

NBIC conference 2011 - all tutorials: https://wiki.nbic.nl/index.php/NBIC_Conference_2011:_BioAssist_Tutorials_Installation

URL to this tutorial: http://www.bioinformaticslaboratory.nl/foswiki/bin/view/BioLab/NBICTutorial

Description: The tutorial demonstrates how to port and run applications on the grid with the eBioScience infrastructure. The participant learns how to run an existing grid workflow, wrap an application as a workflow component and link components in a workflow.

IMPORTANT: when using the VBrowser, do not delete or copy any grid files that were not created by yourself! The LFC is a shared storage device and the basis for usage is trust.

Installation instructions

A virtual machine is available with all software pre-installed. Alternatively you can install the Vbrowser, a wrapper script and the Moteur2 application on your own machine. The Vbrowser is used to access and copy files from/to grid resources and to start grid workflows. The wrapper script is used to wrap executables as a workflow component. The Moteur2 application can be used to connect workflow components.

Install virtualbox and load the ebioinfra virtual machine (VM)

  1. Install the latest version of VirtualBox on your machine. Binaries for a number of platforms are available on the USB stick
  2. Download the VM if you did not retrieve a USB stick: eBioInfra.ovf (16KB), eBioInfra-disk1.vmdk (1.7GB)
  3. Start Virtualbox and import the eBioInfra.ovf file (File > import appliance)
  4. Start the eBioInfra virtual machine

Installation of vbrowser, wrapper script and moteur2 on your own system

Requirements:
  • Perl (for the executable wrapper)
  • Java 1.6 (for Vbrowser and Moteur2)
  • Graphviz (for Moteur2)

Downloads:

Background and manuals:

Loading the grid certificate

The tutorial certificate has been inactivated after the conference. Ask Aldo or Barbera how to proceed if you would like to do this tutorial.

Get acquainted with the interface

Start the vbrowser and activate the grid certificate
  1. Locate the installation of VBrowser software on your computer (tip: menu)
  2. Start the VBrowser
  3. Login with the guest certificate by pressing the "!" button. Leave all settings unchanged and fill in the password. Push the "Create" button and then "OK"

Copy a file to the grid and examine the stored file
  1. Locate directory /grid/vlemed/NBICTutorial (tip: LFC resource)
  2. Create a subdirectory there to store your files (below mentioned as MYDIR). You might need to refresh the screen before you will see the new directory.
  3. Copy a (small) file from your local computer to MYDIR and observe the messages shown on the Transferring pop-up (tip: open new VBrowser window)
  4. Look at the properties of the new file. On which host was it stored?
  5. Look at the file replicas. What is the complete name of the physical file?
  6. Add a new replica for this file. What is the complete name of the new physical file?
  7. Look again the properties of the file. On which host(s) is it stored?

Run an existing workflow on the grid

  1. Go to the /grid/vlemed/NBICTutorial directory
  2. Browse to directory HelloWorld
  3. Right-click on the HelloWorld.gwendia file and select "View with.." > "Other.." > "ViewerMoteur2"
  4. Fill in your name (without spaces). Make sure you press enter after each value.
  5. Submit the workflow by pressing the "Run workflow" button
  6. The jobs can be monitored from the Vbrowser and from an internet browser. Copy/paste the url in an internet browser.
  7. Monitor the workflow execution (tip: click on the workflow components)
  8. Locate the stdout, stderr and output files
  9. Look at the generated files and answer the questions
    1. On which host has the job run?
    2. How long did the job take to run? (tip: inspect stdout, stderr)
  10. Copy the result file to your desktop

Run an existing workflow with multiple input parameters

  1. Run the workflow again with more than one input value (press enter after each value!)
  2. Look at the generated files and answer the questions
    1. Where did the jobs run?
    2. Where were the files stored?
    3. Were there any errors/warnings during the execution?

Port an application to the grid

Examine the files of the hello-world workflow
  1. Take a look at the hello-world.sh file (on your desktop in directory HelloWorld)
  2. Test the shell script via the command line
  3. To port an application to the grid it is necessary to properly define the in- and output parameters and files. The example shell script has one input value (inputParam) and one output file (outputFile). A wrapper has to be written for the executable.
    1. Take a look at the HelloWorld.xml file. This is the GASW wrapper for the executable that you would like to run on the grid.
    2. One or more components can be linked in a workflow. This is defined in the Gwendia language or in the Scufl language. Take a look at the HelloWorld.gwendia file to get an impression of the Gwendia language.

Port a hello-world.sh script to the grid with a wrapper script
  1. It is not necessary to write these files ourselve. They can be generated automatically with a wrapper script
  2. Open a terminal and start the command "create_GASW_SCUFL_GWENDIA". When you are not using the virtual machine, start the perl script "create_GASW_SCUFL_GWENDIA.pl" Follow the instructions on the screen. An example is given below.
    1. About the LFC directory: Fill in the grid directory name where you would like to place the files, e.g. /grid/vlemed/NBICtutorial/MYDIR
    2. About the names of the in and output parameters/files: they are not allowed to start with in, out or result
    3. About the template for the output file (/grid/vlemed/NBICtutorial/MYDIR/result/$na1_%s.txt): You can generate output file names automatically by supplying a template name.
      • $dir1 means: place the output file in the same directory as the input file (not applicable in this example)
      • $na1 is the name of the first input parameter/file, $na2 of the second parameter/file, etc
      • %s is a random number. This will prevent that files are overwritten accidently
  3. Copy the generated files and the hello-world.sh file to your directory on the grid
  4. Run the workflow (the gwendia file)

ebioinfra@ebioinfraVM:~$ create_GASW_SCUFL_GWENDIA 
This script creates a Gasw xml file, the scufl AND gwendia file with the given in- and output.
The scufl and gwendia file will have the same name as you enter for the Gasw file preceded by WF_ (e.g. WF_"name".scufl or "name".gwendia), these files are written in the output directory.

Enter the name for the output directory e.g.:
"outputXML" (will be created in working directory)
"the full path"  /home/user/creategasw/outputXML)
Press enter to use the default directory: xmlfiles): 
/home/ebioinfra/Desktop/workflowfiles
Created directory /home/ebioinfra/Desktop/workflowfiles

Enter the name for your Gasw outputfile, e.g. myGaswFile.xml.
 If you enter an existing file(name), this file will be overwritten!!!

MyHelloWorld.xml
Opened file: /home/ebioinfra/Desktop/workflowfiles/MyHelloWorld.xml

Enter the directory on the LFC where you will store the Gasw xml file (e.g. /grid/vlemed/AMC-e-BioScience/thisworkflow/gasw)

/grid/vlemed/NBICtutorial/MYDIR
Enter the access type for the executable (LFN or URL): 

LFN
Enter the name of the executable: 

hello-world.sh
Enter the path where the executable is stored (e.g. /grid/vlemed/user

/grid/vlemed/NBICtutorial/MYDIR
Writing to MyHelloWorld.xml: 

<description>
   <executable name="hello-world.sh">

<!--access_LFN-->
   <access type="LFN"/>
   <value value="/grid/vlemed/NBICtutorial/MYDIR/hello-world.sh"/>

Enter the number of parameters to use  (press enter if none): 

1
Enter the parameter name for parameter no. 1: 
YourNamePlease
Enter the parameter option for parameter no. 1 (e.g. -l) 
-i
Writing to MyHelloWorld.xml: 

<!--param_input-->
   <input name="YourNamePlease" option="-i"/>

Enter the number of input files (press enter if none): 
[enter]

Enter the number of output files  (press enter if none): 

1
Enter the description for output file no. 1: 
HelloTxt
Enter the output filename AND directory for output file no. 1 :  (e.g. /grid/vlemed/user/outdir/Out_Filename.txt or $dir(n)/$na(n)/%s_output_file) 
/grid/vlemed/NBICtutorial/MYDIR/result/$na1_%s.txt
Writing to MyHelloWorld.xml: 

<!--file_output-->
   <output name="HelloTxt" option = "no0">
      <template value="/grid/vlemed/NBICtutorial/MYDIR/result/$na1_%s.txt"/>
      <access type="LFN"/>
   </output>

Enter the number of sandbox files (press enter if none): 
[enter]

Enter the requirement value (e.g. (other.GlueCEUniqueID == "ce.gina.sara.nl:2119/jobmanager-pbs-medium" || other.GlueCEUniqueID == "deimos.htc.biggrid.nl:2119/jobmanager-pbs-medium") 
   (press enter if none): 
[enter]

Written the files /home/ebioinfra/Desktop/workflowfiles/MyHelloWorld.xml and /home/ebioinfra/Desktop/workflowfiles/WF_MyHelloWorld.scufl and /home/ebioinfra/Desktop/workflowfiles/MyHelloWorld.gwendia .

Create a workflow with multiple components with the Moteur application

myworkflow.png

You can connect components with the Gwendia workflow language. Moteur2 is a visual editor to create workflows. You will build a workflow where sequence reads (data source: 1000 genomes project) are aligned with BWA against one chromosome (data source: UCSC) and at the same time are analyzed by the FastQC package.

Copy the Gasw files to your desktop
  1. Go to grid directory lfn://lfc.grid.sara.nl:5010/grid/vlemed/NBICtutorial/Sequence_WF
  2. Copy the files BwaIllumina.xml and FastqToFastQC.xml to your desktop. You will need to examine these files later

Create a new workflow
  1. Open the Moteur2 editor (menu > Applications > Moteur)
  2. Give the workflow a name via Edit > Rename workflow

Add the BWA component
  1. Add a new workflow component. Right click on the canvas and select "add processor" and rename the processor to for example "bwa" (double click on the "new processor")
  2. Next step is to configure the component (right click on the component and select "configure")
  3. The in- and output parameters must be exactly the same (case-sensitive) and in the same order as described in the Gasw file. Open the FastqToFastQC.xml, remove the parameters "in" and "out" in the "Ports" tab and enter the names of the in- and out parameters as described in the Gasw file
    1. In: Lane, SampleName, Library, ParametersTxt, Pair1FastqGz, Pair2FastqGz, ReferenceTarGz
    2. Out: Bam, Bai
    3. You can leave the "Type" unchanged (String)
  4. Go to the "Iterators" tab
    1. Right click on the cross sign and change it to "dot iterator". More complex iteration strategies are possible, but not from the visual editor
  5. Go to the "Processor" tab and select Processor type "GASW". Fill in the location of the Gasw file on grid storage including the protocol and entire path (lfn://lfc.grid.sara.nl:5010/grid/vlemed/NBICtutorial/Sequence_WF/BwaIllumina.xml)
  6. Close the "processor bwa configuration" window

Add in- and outputs to the workflow
  1. Create an input node (right click on the canvas and select "add input")
  2. Rename the input to "Lane". The input names of these nodes do not necessarily have to be exactly the same as in the Gasw
  3. Connect the input to the input port of the BWA processor by selecting "Data link from" > "out" (right mouse button) and dropping this on the "Lane" input of the BWA processor
  4. Create inputs for the other input ports (SampleName, Library, ParametersTxt, Pair1FastqGz, Pair2FastqGz, ReferenceTarGz) and link them to the corresponding input ports of the BWA component
  5. Create outputs (Bam and Bai) and link the output port of the BWA component to these outputs (right click on the BWA component > data link from...)
  6. Save the workflow on the destop as "myworkflow.gwendia"

Add the FastQC component
  1. Add a new processor and give it the name "fastqc"
  2. Examine the "FastqToFastQC.xml" file for the in- and output names and enter these in the "Ports" tab
  3. Go to the "Processor" tab, select type "GASW" and enter the URI of the fastqc gasw file (lfn://lfc.grid.sara.nl:5010/grid/vlemed/NBICtutorial/Sequence_WF/FastqToFastQC.xml)
  4. Close the "processor fastqc configuration" window

Create an output node for the fastqc component and link the fastq-inputs to this component
  1. Add a new output to the canvas "fastqc_zip" and link the output port "fileOut.zip" to this output
  2. Link the "Pair1FastqGz" input to the "fastqc" component
  3. Save the workflow

Run the workflow
  1. Browse to your desktop in the VBrowser (probably you need to refresh the view before you can see your workflow)
  2. Start your workflow (right click > view with.. > Other.. > ViewerMoteur2)
  3. Enter the input parameters. You can use fake names for Lane, SampleName and Library. Don't forget to press [enter] after each value.
  4. Location of ParametersTxt: lfn://lfc.grid.sara.nl:5010/grid/vlemed/NBICtutorial/Sequence_WF/bwa-default.txt
  5. Pair1FastqGz: lfn://lfc.grid.sara.nl:5010/grid/vlemed/NBICtutorial/Sequence_WF/sequences-1000g/SRR063088_1.filtaz.fastq.gz
  6. Pair2FastqGz: lfn://lfc.grid.sara.nl:5010/grid/vlemed/NBICtutorial/Sequence_WF/sequences-1000g/SRR063088_2.filtaz.fastq.gz
  7. ReferenceTarGz: lfn://lfc.grid.sara.nl:5010/grid/vlemed/NBICtutorial/Sequence_WF/database-hg19/index_chr13.fa.tar.gz
  8. Run the workflow and monitor the progress via the Web service URL. The alignment can take a while, so you can check the results later on this day.

Tip

When you need to enter many parameters it is easier to edit an input-values-file. You can save the parameters via the "Save to file" button and manually add more values (or write a script to generate this file)

Contact us

If you wish more information about the research activities of the e-bioscience group or to get access to the e-BioInfra, please contact us

References

Topic revision: r19 - 12 Oct 2015, AngelaLuijf
 

http://wiki.bioinformaticslaboratory.nl/foswiki/bin/view/BioLab/WebHome Search
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback