Category Archives: RNAseq

Why do RNAseq?

There is always a scientific question at the basis of doing RNAseq. Here are some images of susceptible Myrtaceae plants infected with myrtle rust. Clockwise from top left: Syzygium luehmannii (Riberry), Syzygium leuhmannii, Syzygium jambos, Chamelaucium uncinatum (Geraldton wax) flower buds, Chamelaucium uncinatum stems and leaves. For highly susceptible plants the pathogen can be devastating. Determining the genetic basis for resistance would therefore be very useful for plant breeding and for population and species management. Whole gene expression studies are one way to determine this genetic basis by identifying the changes in resistant versus susceptible plants.

myrtle rust


Trinity assembly – and how not to go about it

I have used the Trinity assembly software to build denovo transcriptomes for each of my plants. Lots of good information here:

I made several errors to begin with. The first error was to build transcriptomes for each plant at each time-point thinking that this would allow me to compare across the treatments. Running the assembly software can take days to complete – so this has meant a lot of time wasted doing 24 separate assemblies!

The correct thing to do is to combine the data from all times (pre-inoculation, 24 hours post-inoculation and 48 hours post-inoculation) for each plant. In my case I did 8 assemblies. You need all the gene transcripts from all samples to build the most complete ‘potential’ expression profile. You can then use this transcriptome fasta file to map the reads from each treatment later on. The transcriptome is also really useful for other analysis you might want to do later such as searching for specific gene families etc.

more on trinity assembly to come later…


Trimming the reads

Trimming the reads

The raw sequence reads still have Illumina adaptors and some of them might be low quality. The software often used for trimming reads is Trimmomatic (I used trimmomatic v0.33). Manual available here:

Click to access TrimmomaticManual_V0.32.pdf

Trimmomatic requires Java to be installed and loaded, the default java version on Artemis (hpc) is currently  1.8.0 and this works fine. I did not change any default settings for Trimmomatic.

Here is the pbs script for my paired end data

Note: the term ‘module’ means software and there is generally a default version that is uploaded for your work unless you specify the version in the Load Modules section of the pbs),

#PBS -P (project directory)
#PBS -N (job name eg. AP0 trim)
#PBS -l nodes=1:ppn=16
#PBS -l walltime=01:00:00
#PBS -l pmem=4gb
#PBS -m abe

#Load modules
module load java
module load trimmomatic

# Working directory
cd /(pathname of working directory where files are located)

# Run trimmomatic
java -jar /usr/local/trimmomatic/0.33/trimmomatic-0.33.jar PE -phred33 AP0_R1.fastq AP0_R2.fastq AP0_R1_trimpaired.fq AP0_R1_trimunpaired.fq AP0_R2_trimpaired.fq AP0_R2_trimunpaired.fq ILLUMINACLIP:TruSeq3-PE.fa:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 MINLEN:36

So the input files are:

AP0_R1.fastq and AP0_R2.fastq (or gzipped versions)

and the output files are:

AP0_R1_trimpaired.fq, AP0_R1_trimunpaired.fq, AP0_R2_trimpaired.fq and AP0_R2_trimunpaired.fq (or gzipped versions)

These output files can be used for the assembly process with Trinity software.


Starting out with your raw reads

You have your data – now what?

Your data will usually come to you from the sequencing facility as masses of short reads in zipped files. The files will be labelled something like this:





So for this sample AP0 – (plant labeled AP and from pre-inoculation therefore ‘0’), I have paired-end data. R1 is from the forward read and R2 is from the reverse read. The Illumina run was done using two lanes therefore I have two R1 and two R2 datasets (L001 and L002).

These zipped files are .fastq files. Fasta files are the basic text files that gene sequences are formatted in with headers beginning with a  ‘>’ followed by the sequence on the next line. If they are not too massive they can be opened in Notepad+++. Fastq files have additional information about the quality of the read which cannot be easily understood by humans but can allow software to sort through and discard poor reads. More information here,

You want all the sample AP0 R1 reads from two sequencing lanes to be in one file. The same goes for the R2 reads. So you will need to unzip the files and then combine them explained below (in Back to the zipped raw data).

Unix and high performance computing

Most of the work involved in RNAseq analysis requires a Unix environment (command line) rather than Windows or graphic user interfaces. To run assembly and alignment software you also really need high performance computing (hpc) access. There are a number of ways to access these such as:

but as I have access to the university cluster I will be just discussing the methods I have used for Artemis, the University of Sydney hpc.

On my local Windows operating system I have installed PuTTY software ( which allows me to log in to the hpc remotely using a VPN and operate the software with my data in a project directory allocated to me. I use Filezilla ( for transferring much of my data from my local data storage location to the hpc and back.

PBS scripts

When using hpc clusters all jobs need to be scheduled and queued so that appropriate allocation of resources occurs. To run software on your data you submit a portable batch script (PBS) which specifies the software you need to use, the resources you need and the time expected to run the job (wall-time). It is often a bit of guesswork to know how long a job will take but the manuals for software, always available on-line, will give some guidance. Here is an example of information required in a PBS script for Artemis:

# Some useful brief comment on what this script does
#PBS -P RDS-FAC-PROJECT-RW – make sure to replace FAC and PROJECT to suit you
#PBS -N Job_101  -Job name – this is what you will see when you run commands to check the status of your job
#PBS -l nodes=1:ppn=2 – This is requesting 1 node and 2 processor per node. Only request more if your job multi-threads. 1 node has a max of 24 processors, so say you wanted 40 cores you would specify ‘nodes=2:ppn=20’
#PBS -l walltime=02:00:00 – Maximum run time of your job, in hours:minutes:seconds. Example requests 2 hours. Job is killed when it reaches wall time so make sure you request enough.
#PBS -l pmem=4gb – RAM per processor
#PBS -j oe – Send the ‘standard error’ and ‘standard output’ log files to one file (delete this line to keep them separate)
#PBS -M – email job reports to this email address
#PBS -m abe – along with the above directive, this asks for an email when the job aborts (a), begins (b), and ends (e). ‘e’ is the most important as it will give you a report of resources used which can help you decide how much resources to request for the next run.

# Load modules
module load trinity – job will use the software trinity
module load trimmomatic – job will use the software trimmomatic

# Working directory: – if all your input and output is in the same directory, if you don’t have all the data in the same directory it can be useful to have this ‘cd’ command in the script -so you can run the script from any directory without specifying full pathnames for the input and output files.

# Run trinity: – insert commands to run the job…

I will provide some of the actual pbs scripts I have used as I go.

Back to the zipped raw data

Once you have your data on the hpc you can unzip using the unix command ‘gunzip’ as these are gzipped files (gz):

gunzip ‘filename’

eg. gunzip AP0_CGATGT_L001_R1_001.fastq.gz

Your original .gz file will be gone from the directory and replaced with the unzipped version.

With your files unzipped you can now join them with the unix command cat and, in my example, rename the new combined file AP0_R1.fastq:

cat AP0_CGATGT_L001_R1_001.fastq AP0_CGATGT_L002_R1_001.fastq > AP0_R1.fastq

When you have all your data combined like this you can zip them again and begin processing them. Much of the software for assembly can process zipped files. To zip them:

gzip ‘filename’

Next post – trimming the reads












RNA and denovo transcriptomes

About me

We live in incredible times – where the genes expressed at a single moment can be captured, read and studied. I am a PhD student at the Faculty of Agriculture and Environment, University of Sydney. I am interested in the molecular responses of plants to pathogens.

I have had no prior experience running software in a Unix environment but decided that the tools are all out there and perhaps I could have a go. The last few months I have been working through an RNAseq pipeline and thought my failures and successes could help someone else who is starting out. I will blog each step and provide scripts that I used to run the software.

There are many different ways to go about analysing RNA data. I present one approach but welcome friendly criticism, constructive advice or comments. I am really learning on the run and there is a lot of free software available for different tasks – thanks to the many software developers.

The experiment

I am working with Australian Myrtaceae plants and investigating host responses to a newly arrived fungal pathogen, myrtle rust. Below is an electron scanning microscope image of a myrtle rust spore germinating on a eucalypt leaf made with the help of the Australian Microscopy & Microanalysis Research Facility (

Sample4_002 - Copy

Just by way of some background, the pathogen has a very extensive Myrtaceae host-range and most Australian natural vegetation communities are composed of Myrtaceae plants. These include eucalypts, paperbark, bottle-brush, tea-tree, lemon-scented myrtle, waxflower and more…. The potential for devastating outbreaks under the right environmental conditions is therefore still a looming threat.

For my experiment I took leaf samples from 4 resistant  and 4 susceptible plants at three time points – pre-inoculation, 24 hours post inoculation and 48 hours post inoculation. I extracted and cleaned the RNA using commercial kits. I then made libraries of around 300 base pairs for paired-end Illumina sequencing on Hiseq2500. Two lanes for each sample were run. The raw data from these runs is where I will begin the bioinformatic explanation in my next post.