This space is home to learning materials and tutorials created for CyVerse products and services. To search the entire CyVerse wiki, use the box at the upper right.



Skip to end of metadata
Go to start of metadata

Jetstream Workflow That Creates Gene Expression Matrices (GEMs) from SRA/FASTQ NGS Files


This is the old version of Pegasus-GEM JS workflow. Please use this latest version - Pegasus-GEM Jetstream Workflow Tutorial - 2.2

Rationale and background

Pegasus-GEM is Pegasus Jetstream workflow that utilizes Jetstream resources to produce a Gene Expression Matrix (GEM) from DNA sequence files in FASTQ format. This is adapted from OSG-GEM workflow that currently runs on Open Science Grid (OSG)

William L. Poehlman, Mats Rynge, Chris Branton, D. Balamurugan and Frank A. Feltus. OSG-GEM: Gene Expression Matrix Construction Using the Open Science Grid. Bioinformatics and Biology Insights 2016:10 133–141 doi: 10.4137/BBI.S38193.


This workflow processes both paired or single end FASTQ files to produce a matrix of normalized RNA molecule counts (FPKM). Pegasus-GEM also supports direct input downloads from NCBI SRA for processing. An indexed reference genome along with gene model annotation files must be obtained prior to configuring and running the workflow. The following tasks are directed by the Pegasus workflow manager:

  • Splitting input FASTQ files into files containing 20,000 sequences each.
  • Trimming raw sequences with Trimmomatic
  • Aligning reads to the reference genome using Hisat2 or Tophat2 or STAR
  • Merging BAM alignment files into a single sorted BAM file using Samtools merge
  • Quantifying RNA transcript levels using StringTie or Cufflinks

It is suggested that the user become familiar with the documentation associated with the following software packages:

This tutorial will take users through steps of:

  1. Running Pegasus-GEM on Jetstream cloud
  2. Running Pegasus-GEM on an example data


Sounds great, what do I need to get started?

  1. XSEDE account
  2. XSEDE allocation. Users can request a startup XSEDE allocation. The startup XSEDE allocations are relatively easy to apply and get allotted. Please contact for further information.
  3. Getting started with Jetstream
  4. Your data (or you can run example data)

What kind of data do I need?

  1. Mandatory requirements
    1. FASTQ files. Either single end or paired. You can also use SRR id's
    2. Select the type of reads. Single or Paired.
    3. Select the type of mapper (Tophat2 or Hisat2 or STAR)
    4. Select the type of assembler (Cufflinks or Stringtie)

What kind of resources will I need for my project?

  1. Enough SUs (Service Units) to run your computation
  2. One MASTER and several workers needed for running your computation
  3. Enough storage space on the WQ-MAKER Jetstream instance for both input and output files. Since most of the images have limited disk space, it is recommended to mount an external volume to the running Pegasus-GEM MASTER instance. 

Part 1: Connect to an instance of an CentOs Jetstream Image (virtual machine)

Step 1. Go to and log in with your XSEDE credentials.


Step 2. Click on the "Create New Project"  in the Project tab on the top and enter the name of the project and a brief description 

Step 3. Launch an instance from the selected image and name it as MASTER 

After the project has been created and entered inside it, click the "New" button, select "Centos 7 (7.3) Development GUI" image and then click Launch instance. In the next window (Basic Info),

  • name the instance as "MASTER" (don't worry if you forgot to name the instance at that point, as you can always modify the name of the instance later)
  • leave base image version as it is
  • leave the project name as it is or change to a different project if needed
  • select "Jetstream - Indiana University or Jetstream - TACC" as Provider (for this tutorial we will chose Jetstream - TACC) and click 'Continue'. Your choice of provider will depend on the resources you have available (SUs) and the needs of your instance
  • select "m1.medium" as Instance size and click "Continue". 

Make sure to check on the Projected Resources Usage to make sure you have enough resources to run the instance. If you need more SUs or CPUs to run instances, contact the Jetstream team at Review the details of the instance you are selecting to launch and click "Launch Instance"


As the instance is launched behind the scenes, you will get an update as it goes through each step.

Status updates of Instance launch (both MASTER and WORKER) include Build-requesting launch, Build-networking, Build-spawning, Active-networking, Active-deploying. Depending on the usage load on Jetstream, it can take anywhere from 2-5 mins for an instance to become active. You can force check updates by using the refresh button in the Instance launch page or the refresh button on your browser. Once the instance becomes active a virtual machine with the ip address provided will become available for you to connect to. This virtual machine will have all the necessary components to run WQ-MAKER and test files to run a MAKER demo. 

Step 4. Launch WORKER instance from  "Centos 7 (7.3) Development GUI" image 

Launch one instance from the  "Centos 7 (7.3) Development GUI" image and name them as W-1. Use the same configuration as the MASTER VM 

Step 5. ssh into the ip address of MASTER VM as root

5.1 Bootstrap and MASTER and worker

Step 6. Create and attach the volume to the MASTER instance

Since the m1 medium instance size (60GB disk space) selected for running MASTER instance of Pegasus may not be sufficient for most of the GEM runs, it is recommended to run it on volumes. Following are the three steps for mounting the external volume.

6.1: Create a volume

Click the "New" button in the project and select "Create Volume". Enter the name of the volume, volume size (GB) needed and the provider (TACC or Indiana) and finally click "Create Volume" 

6.2: Attach the created volume to the MASTER instance 

Click the checkbox by the side of Volume (1), then click the attach button (2), next chose the MASTER instance (3) and finally click the ATTACH VOLUME TO INSTANCE button (4)


Part 3: Set up a Pegasus-GEM run using the Terminal window

Step 1. Get oriented. A workflow specific ssh key has to be created. This key is used for some of the data staging steps of the workflow.

Step 2: Example Workflow Setup. The workflow cloned from github contains an example config file as well as example input files from the 21st chromosome of Gencode Release 24 of the GRCh38 build of the human reference genome. Two small FASTQ files containing 200,000 sequences from NCBI dataset SRR1825962 lie within the Test_data directory of the workflow

Run default test data . The workflow, configured to run Hisat2 and StringTie, can then be launched by running:

Monitoring Workflow

Pegasus provides a set of commands to monitor workflow progress. The path to the workflow files as well as commands to monitor the workflow will print to screen upon submitting the workflow. For example:

2016.05.26 23:31:03.859 CDT:   Your workflow has been started and is running in
2016.05.26 23:31:03.869 CDT:     /stash2/user/username/workflows/osg-gem-x/workflow/osg-gem-x
2016.05.26 23:31:03.880 CDT:   *** To monitor the workflow you can run ***
2016.05.26 23:31:03.891 CDT:     pegasus-status -l /stash2/user/username/workflows/osg-gem-x/workflow/osg-gem-x
2016.05.26 23:31:03.901 CDT:   *** To remove your workflow run ***
2016.05.26 23:31:03.912 CDT:     pegasus-remove /stash2/user/username/workflows/osg-gem-x/workflow/osg-gem-x

Output will be transferred at the base of this directory upon completion. For example:



From here, the user may follow our documentation to modify the software options as well as point to their own input datasets. Note that there are no test reference genome indices available for STAR, because they are too large to upload to github.

Pre-Workflow User Input

The user must provide indexed reference genome files as well as gene model annotation information prior to submitting the workflow. The user must select a reference prefix($REF_PREFIX) that will be recognized by Pegasus as well as by Hisat2 or Tophat2. In addition, information about splice sites or a reference transcriptome must be provided in order to guide accurate mapping of split input files. Once the user has downloaded a reference genome fasta file and gene annotation in GTF/GFF3 format, the following commands can be used to produce the necessary input files, using GRCh38 as an example $REF_PREFIX for Gencode Release 24 of the human reference genome:


  • Index the reference genome

  • Generate Tab delimited list of splice sites using gene model GTF file as input (Python DefaultDictionary Module necessary)


  • Index the reference genome

  • Generate and Index Reference Transcriptome


  • Generate Tab delimited list of splice sites using gene model GTF file as input (Python DefaultDictionary Module necessary)



Please contact if you need help determining the optimal amount of resources for running pegasus-GEM. 

  • No labels