Study design Quality assessment
Burrows Wheeler transform
BWT example
Introduction to UNIX-like operating systems Installing programs
Bowtie SAMtools
RNA-Seq
Aligning reads to the transcriptome TopHat
Cufflinks
RNA-Seq using TopHat and Cufflinks RNAseq and count models
DNA-Seq
BCFtools
Variant Pattern Analyzer Genome Analysis Toolkit Microbiomics
Over the last 5 years or so there has been rapid development of
methods fornext generation sequencing.
Here is the process for the Illumina technology (one of the 3 major producers of platforms for next generation sequencing).
The biological sample (e.g. a sample of mRNA molecules) is first randomly fragmented into short molecules.
Then the ends of the fragments are adenylated and adaptor oligos are attached to the ends.
The fragments are then size selected, purified and put on a flow cell.
An Illumina flow cell has 8 lanes and is covered with other oligonucleotides that bind to the adaptors that have been ligated to the fragmented nucleotide molecules from the sample.
The bound fragments are then extended to make copies and these copies bind to the surface of the flow cell.
This is continued until there are many copies of the original fragment resulting in a collection of hundreds of millions of clusters.
The reverse strands are then cleaved off and washed away and sequencing primer is hybridized to the bound DNA.
The individual clusters are then sequenced in parallel, base by base, by hybridizing fluorescently labeled nucleotides.
After each round of extension of the nucleotides a laser excites all of the clusters and a read is made of the base that was just added at each cluster.
If a very short sequence is bound to the flow cell it is possible that the machine will sequence the adaptor sequence-this is referred to as adaptor contamination.
There is also a measure of the quality of the read that is saved along with the read itself.
These quality measures are on the PHRED scale, so if there is an
estimated probability of an error ofp, the PHRED based score is
−10 log10p.
If we fragment someone’s DNA we can then sequence the
fragments, and if we can then put the fragments back together we can then get the sequence of that person’s genome or
transcriptome.
This would allow us to determine what alleles this subject has at every locus that displays variation among humans (e.g. SNPs).
There are a number of popular algorithms for putting all of the fragments back together: BWA, Maq, SOAP, ELAND and Bowtie. We’ll discuss Bowtie in some detail later (BWA uses the same ideas as Bowtie).
ELAND is a proprietary algorithm from Illumina and Maq and SOAP use hash tables and are considerably slower than Bowtie.
There are many applications of this basic idea:
1. resequencing (DNA-seq)
2. gene expression (RNA-seq)
3. miRNA discovery and quantitation
4. DNA methylation studies
5. ChIP-seq studies
6. metagenomics
We will focus on resequencing (and SNP calling) and gene expression in this course.
Some have talked about the death of microarrays due to the use of NGS in the context of gene expression studies, but this hasn’t happened yet.
Compared to microarrays, RNA-seq
1. higher sensitivity
2. higher dynamic range
3. lower technical variation
4. don’t need a sequenced genome (but it helps, a lot)
5. more information about different exon uses (more than 90% of
In one head to head comparison, 30% more genes are found to be differentially expressed with the same FDR (Marioni, Mason, Mane, et al. (2008)).
These authors also found that the correlation between normalized intensity values from a microarray had a correlation of 0.7-0.8 with the logarithm of the counts (this is similar to what others have reported).
The largest differences occurred when the read count was low and the microarray intensity was high which probably reflects
Before addressing the technical details, we will outline some considerations regarding study design specific to NGS technology. There are 3 major manufacturers of the technology necessary to generate short reads, and they all have different platforms with resulting differences in the data and processing methods. These vendors are
1. Illumina, formerly known as Solexa sequencing
2. Roche, which owns 454 Life Sciences
We will focus on the Illumina technology as the University of Minnesota has invested in this platform (the HiSeq 2000 platform is available in the Biomedical Genomics Center).
We also have some capabilities to do 454 sequencing here. This platform produces longer reads (up to several hundred and growing), and is very popular in the microbiomics literature.
By sequencing larger numbers of fragments one can estimate the sequence more accurately.
The goal of using high sequencecoverage is that by using more
fragments it is more likely that one fragment will cover any random location in the genome.
Clearly one wants to cover the entire genome if the goal is to
sequence it, hence thedepthof coverage is how many overlapping
fragments will cover a random location.
By deep sequencing, we mean coverage of 30X to 40X, whereas coverage of 4X or so would be considered low coverage.
The rule for determining coverage is:
coverage = (length of reads×number of reads)/ (length of
genome)
For a given sequencing budget, there is a tradeoff between the depth of coverage and the number of subjects one can sequence. The objectives of the study should be considered when determining the depth of coverage.
If the goal is to accurately sequence a tumor cell then deep coverage is appropriate, however if the goal is to identify rare variants, then lower coverage is acceptable.
For example, the 1000 Genomes project is using about 4X coverage.
A reasonable rule of thumb is that one probably needs 20-30X coverage to get false negatives less than 1% in nonrepeat regions of a duploid genome (Li, Ruan and Durbin, 2008).
If the organism one is sequencing does not have a sequenced genome, the calculations are considerably more complex and one would want greater coverage in this case.
Throughout this treatment we will suppose that the organism under investigation has a sequenced genome.
Another choice when designing your study regards the use of mate-pairs.
With the Illumina system one can sequence both ends of a fragment simultaneously.
This greatly improves the accuracy of the method and is highly recommended.
If the goal is to characterize copy number variations then getting paired end sequences is crucial.
We can use the ShortRead package in R to conduct quality assessment and get rid of data that doesn’t meet quality criteria. To explore this we will use some data from dairy cows.
You can find a description of the data along with the actual data in sra format at this site.
http://trace.ncbi.nlm.nih.gov/Traces/sra/?study=SRP012475
While the NCBI uses the sra format to store data, the standard format for storing data that arises from a sequencing experiment is the fastq format.
We can convert these files to fastq files using a number of
To use this you need to download the compressed file, unpack it and then enter the directory that holds the executable and issue the command (more on these steps later).
sratoolkit.2.1.15-centos linux64/bin/fastq-dump SRR490771.sra
Then this will generate fastq files which hold the data. If we open the fastq files we see they hold identifiers and information about the reads followed by the actual reads:
@SRR490756.1 HWI-EAS283:8:1:9:19 length=36 ACGAGCTGANGCGCCGCGGGAAGAGGGCCTACGGGG +SRR490756.1 HWI-EAS283:8:1:9:19 length=36 AB7A5@A47%8@2@@296263@/.(3’=49<9<8,9 @SRR490756.2 HWI-EAS283:8:1:9:1628 length=36 CCTAATAATNTTTTCCTTTACCCTCTCCACATTAAT +SRR490756.2 HWI-EAS283:8:1:9:1628 length=36 BCCC@CB>)%)43?BBCB@:>BBCBBBBBB=CB?BC @SRR490756.3 HWI-EAS283:8:1:9:198 length=36 ATTGAATTTGAGTGTAAACATTCACATAAAGAGAGA +SRR490756.3 HWI-EAS283:8:1:9:198 length=36 BBB<9ABCA<A2?5>BBB?BBB@BABB>?A*?9?<B
The string of letters and symbols encodes quality information for each base in the sequence.
Then we define the directory where the data is and read in all of the filenames that are there
> library(ShortRead)
> dataDir <- "/home/cavan/Documents/NGS/bovineRNA-seq" > fastqDir <- file.path(dataDir, "fastq")
> fls <- list.files(fastqDir, "fastq$", full=TRUE) > names(fls) <- sub(".fastq", "", basename(fls))
Then we apply the quality assessment function, qa, to each of the files after we read it into R using the readFastq function
> qas <- lapply(seq along(fls), function(i, fls) + qa(readFastq(fls[i]), names(fls)[i]), fls)
This can take a long time as it has to read all of these files into R, but note that we do not attempt to read the contents of the files into the R session simultaneously (a couple of objects generated by
the call toreadFastqstored inside R will really bog it down).
Then we rbind the quality assessments together and save to an external location.
> qa <- do.call(rbind, qas)
> save(qa, file=file.path("/home/cavan/Documents/NGS/bovineRNA-seq","qa.rda")) > report(qa, "/home/cavan/Documents/NGS/bovineRNA-seq/reportDir")
This generates a directory called reportDir and this directory will hold images and an html file that you can open with a browser to inspect the quality report.
So we now use the browser to do this-we see the data from run 12 is of considerably higher quality than the others but nothing is too bad.
One can implement soft trimming of the sequences to get rid of basecalls that are of poor quality.
A function to do this is as follows (thanks to Jeremy Leipzig who posted this on his blog).
Note that this can require a lot of computational resources for each fastq file.
# trim first position lower than minQuality and all subsequent positions # omit sequences that after trimming are shorter than minLength
# left trim to firstBase, (1 implies no left trim)
# input: ShortReadQ reads
# integer minQuality # integer firstBase # integer minLength
# output: ShortReadQ trimmed reads
library("ShortRead")
softTrim <- function(reads, minQuality, firstBase=1, minLength=5){ qualMat <- as(FastqQuality(quality(quality(reads))),’matrix’) qualList <-split(qualMat, row(qualMat))
ends <- as.integer(lapply(qualList, function(x){which(x < minQuality)[1]-1}))
# length=end-start+1, so set start to no more than length+1 to avoid # negative-length
starts <-as.integer(lapply(ends,function(x){min(x+1,firstBase)})) # use whatever QualityScore subclass is sent
newQ <-ShortReadQ(sread=subseq(sread(reads),start=starts,end=ends), quality=new(Class=class(quality(reads)),
quality=subseq(quality(quality(reads)), start=starts,end=ends)),id=id(reads))
# apply minLength using srFilter
lengthCutoff <- srFilter(function(x) { width(x)>=minLength}, name="length cutoff") newQ[lengthCutoff(newQ)] } To use: > library("ShortRead") > source("softTrimFunction.R") > reads <- readFastq("myreads.fq") > trimmedReads <- softTrim(reads=reads,minQuality=5,firstBase=4,minLength=3) > writeFastq(trimmedReads,file="trimmed.fq")
The keys to understanding how the algorithm implemented by Bowtie are the Burrows Wheeler transform (BWT) and the FM index.
1. the FM index: see Ferragina, P. and Manzini, G. (2000),
“Opportunistic data structures with applications”
2. the Burrows Wheeler transform (BWT): see Burrows, M. and
Wheeler, D.J. (1994), “A Block-sorting lossless data compression algorithm”.
The Burrows Wheeler transform is an invertable transformation of a string (i.e. a sequence of letters).
To compute this transform, one
1. determines all rotations of the string
2. sorts the rotations lexicographically to generate an arrayM
3. saves the last letter of each sorted string in addition to the
Some descriptions of the algorithm introduce a special character (e.g. $) that is lexicographically smaller than all other letters, then append this letter to the string before starting the rest of the transform.
This just guarantees that the first row ofM is the original string so
that one needn’t store the row ofM that is the original string.
To see how the BWT works, let’s consider the consensus sequence just upstream of the transcription start site in humans (from Zhang 1998):
GCCACC
First add the special character to the end of the sequence we want
to transform, denotedS with length N.
GCCACC$
then get all of the rotations:
$GCCACC C$GCCAC CC$GCCA ACC$GCC CACC$GC CCACC$G GCCACC$
then sort them (i.e. alphabetize these sequences) $GCCACC ACC$GCC C$GCCAC CACC$GC CC$GCCA CCACC$G GCCACC$
so the BWT is just the last column, typically denotedL, and we
will refer to elementi of this array asL[i] fori = 1, . . . ,N and
ranges of elements viaL[1, . . . ,k].
Importantly one can invert this transformation of the string to obtain the original string.
This was first developed in the context of data compression, so the idea was to transform the data, then compress it (which can be done very efficiently after applying this transformation), then one can invert the transformation after uncompressing.
Suppose we have the BWT of a genome and want to count the
number of occurrences of some pattern, e.g. AC, our query
sequence.
We can do this as follows.
First, create a table that for each letter has the count of the number of occurrences of letters that are lexically smaller than that letter. For us this is just
x $ A C G
Next we need to be able to determine the number of times that a
letterx occurs in L[1, . . . ,k] for anyk, which we will denote
O(x,k).
Note that all of these calculations can be done once and stored for future use.
Now search for the last letter of our query sequence, which isC,
over the range of rows given by [C(x) + 1, . . . ,C(x+ 1)] wherex
isCso the range is [3,6].
Note that these are the rows ofM that start with aCalthough we
don’t actually need to store all ofM to determine this (it just
Then process the second to last letter, which for our example isA.
To determine the range of rows ofM to search we look at
[C(x) +O(x,s1−1) + 1, . . . ,C(x) +O(x,s2)] wherex isAands1
ands2 are the endpoints of the interval from the previous step.
Now
O(A,3−1) =O(A,2) = 0
and
O(A,6) = 1
so the interval is [1 + 0 + 1, . . . ,1 + 1] = [2,2] then since this is
the end of the query sequence we determine the number of occurrences by looking at the size of the range of this interval, which is here just 1.
If the range becomes empty or if the lower end exceeds the upper end the query sequence is not present.
For example if we query onCCCand proceed as previously, the first
step is the same (since this also ends inC), so then searching for C
again we find
[C(C) +O(C,s1−1) + 1,C(x) +O(C,s2)]
butO(C,2) = 2 andO(C,6) = 4
[2 + 2 + 1,2 + 4] = [5,6]
which has size 2 (as there are 2 instances ofCC in the sequence),
so then proceed as in step 2 again to get
[C(C) +O(C,5−1) + 1,C(C) +O(C,6)]
which is
[2 + 4 + 1,2 + 4] = [7,6]
For aligning short sequences to a genome we need to know where the short segments align, hence we need to determine the location of the start of the sequence in the genome.
If the locations of some of the letters are known we can just trace back to those locations as follows.
First, note that we know the first column of the arrayM. We
know this due to 2 facts:
1. the first column will be strictly alphabetized
2. every letter in the sequence is represented in the last column
For our problem we haveL=CCCCAG$ and so the first column is justF=$ACCCCG.
As our sequence is of lengthN, then if we knew the permutation
of 1, . . . ,N that mappedF to Lwe would know the entire
sequence (as we will see shortly).
That one can determine this mapping is the key ingredient in
computing the inverse BWT. Call this mapT where we have
F T(i)
To findT, first consider M and a new array, call it M0, that is
obtained fromM by taking the last element from each row and
making it the first element but otherwise changing nothing.
Here isM0: C$GCCAC CACC$GC CC$GCCA CCACC$G ACC$GCC GCCACC$ $GCCACC
Note that every row ofM has a corresponding row in M0 and like
M M0 has all cyclic rotations of the original sequenceS.
Also note that the relative order of the rows with the same first
letter are the same in both arrays: rows 3, 4, 5 and 6 inM become
rows 1, 2, 3 and 4 inM0. We can use this insight to determine the
mapping fromF to L, i.e. T.
To determineT, we proceed sequentially as follows. L(1) =Cand
this is the firstCin Lso T(1) =i where F(i) is the firstC inF so
Then continue with this thinking: T(2) =i andL(2) is the second
CinL, but then looking at F we see that the secondCin F occurs
at position 4, so thatT(2) = 4.
Continuing in this fashion we find that
We can then reconstruct the sequence in reverse order.
We know the last element of the sequence is the last element of
the first row ofM which is the first element of L, which is hereC.
Then we proceed sequentially using the mappingT as follows
S(N−i) =L Ti(1)
whereTi(x) =Ti−1 T(x), i.e. repeatly apply the mapping T to
S(N−1) =L T(1) =L(3) =C S(N−2) =L T(3)=L(5) =A S(N−3) =L T(5) =L(2) =C S(N−4) =L T(2)=L(4) =C S(N−5) =L T(4)=L(6) =G
If we were just trying to find the location of a particular match,
likeACwe could just stop at that point rather than recover the
The FM index is a compressed version ofL,C andO along with a
compressed version of a set of indices with known locations inS.
This allows one to trace back to a known location.
So one could align short reads to a genome by first computing the BWT and compressing the results.
Unfortunately many of the reads would not align due to sequencing errors and polymorphisms.
Hence one needs to allow some discrepancies between the genome and the short reads.
While this is adjustable, the default specifications for the program Bowtie are that there is a maximum of 2 mismatches in the first 28 bases and a maximum total quality score of 70 on the PHRED scale.
In order to use the latest tools in bioinformatics you need access to a linux based operating system (or Mac OS X).
So we will give some background on how to use a linux based system.
The linux operating system is based on the UNIX operating system (by a guy named Linus Torvalds), but is freely available (UNIX was developed by a private company).
There are a number of implementations of linux that go by different names: e.g. Ubuntu, Debian, Fedora, and OPENsuse.
Most beginners choose Ubuntu (or one of its offshoots, like Mint). I use Fedora on my computers and centos is used on the server we will use for this course.
You can install it for free on any PC.
Such systems are based on a hierarchical structure for organizing files into directories.
Much of the time we will use plain text files: these are files that have no formatting, unlike the files you use in a typical word processing program.
To edit such files you need to use a text editor. I like vi and vim (which has capabilities to interact with large files).
The editor pico is simple to use and installed on the server we will use for this class.
To use this you type pico followed by the file name-if the file doesn’t exist it will create the file otherwise it will open up the file so that you can edit it.
For example
[cavanr@boris ~]$ pico temp1
will open the file temp1 for editing. Commands at the bottom of the window tell you how to conduct various operations.
You can create subdirectories in your home directory by typing
[cavanr@boris ~]$ mkdir NGS
This would create a NGS subdirectory where you can put files related to your NGS project. Then to keep your microarray data separate you could do
[cavanr@boris ~]$ mkdir microarray
To move around hierarchical directory structure you use the
commandcd. We enter the NGS directory with
To go back to our home location (i.e. the directory you start from
when you log on) you just typecd and if you want to go up one
level in the hierarchy you typecd ...
To list all of the files and directories in your current location you
typels.
To copy a file you usecp, to move a file from one location to
another you usemv and to remove a file you userm.
For example, if I want to see the size of the files (and some additional information) rather than just list them I could issue the command
[cavanr@boris ~]$ ls -l
Other useful commands includemore andless for viewing the
contents of files andmanfor information about a command (from
the manual). For instance
[cavanr@boris ~]$ man ls
Will open a help file with information about the options that are available for the ls command.
variable value. These are extremely useful as it lets the user specify many tasks without having to do a bunch of repetitive typing. For example, suppose you had a bunch of files that ended with .txt and you wanted to delete them. You could issue commands like
[cavanr@boris ~]$ rm file1.txt [cavanr@boris ~]$ rm file2.txt
[cavanr@boris ~]$ rm file3.txt...
Or you could just use
[cavanr@boris ~]$ rm file*.txt
or even
Most linux configurations will check that you really want to remove the files, but if you are removing many files, the process of typing yes repeatly is unnecessary. Just type
[cavanr@boris ~]$ rm -f *.txt
When you obtain programs from the internet that run on linux systems these programs will typically install many subdirectories, so if you want to get rid of all the contents of a directory, first enter that directory,
then issue the command
[cavanr@boris oldDir]$ rm -rf *
then go back up one level
[cavanr@boris oldDir]$ cd ..
and get rid of the directory using the rmdir command
[cavanr@boris ~]$ rmdir oldDir
If you issue a command to run a program but wish you hadn’t and want it to stop you push the Ctrl and C keys simultaneously.
To connect to a linux server from a Windows machine you need a Windows program that allows you to log on to a terminal and the ability to transfer files to and from the remote server and your Windows machine.
WinSCP is a free program that allows one to do this.
You can download the data from the WinSCP website and it installs like a regular Windows program: just allow your computer to install it and go with the default configuration.
To get a terminal window you can use a program called PuTTY.
So download the programPuTTY(which is just the file called
PuTTY.exe) and create a subdirectory in your Program Files directory called PuTTY.
Then save PuTTY.exe in the directory you just created.
Once installed start WinSCP and useboris.ccbr.umn.eduas the
hostname along with your user name and password.
You can then get a terminal window using putty: just click on the box that shows 2 computers that are connected right below the session tab.
Then disconnect when you are done (using the option in the session tab).
Recall: Bowtie is a program that aligns short reads to an indexed genome.
Note that there is a beta release of a program called Bowtie 2 that allows gapped alignments, Bowtie just allows a couple of
nucleotides to disagree between the read and the genome. To use Bowtie we need a set of short reads (in fastq format) and the index of a genome and of course the program itself.
We will download a compressed version of the program (an
executable) and after we uncompress it, we can use theexecutable,
i.e. a program that does something.
Bowtie has the capability to build indexes if we have the genome sequence.
First set up a directory to hold all of this work
[cavanr@boris ~]$ mkdir RNAseq
then create a directory to hold all of the programs we will download and set up, we will call it bin (for binaries).
[cavanr@boris ~]$ mkdir bin
Then enter this directory so we can install some programs.
In order to know what version of software you need to install you need to check the architecture of the computer. To do so we issue the following command
[cavanr@boris bin]$ uname -m x86 64
So this is a 64 bit machine (32 bit machines will report something
likei386). So get the appropriate version of Bowtie using the
wget command
[cavanr@boris bin]$ wget
then unpack it
[cavanr@boris bin]$ unzip bowtie-0.12.8-linux-x86 64.zip
Archive: bowtie-0.12.8-linux-x86 64.zip
creating: bowtie-0.12.8/
creating: bowtie-0.12.8/scripts/
inflating: bowtie-0.12.8/scripts/build test.sh
inflating:
bowtie-0.12.8/scripts/make a thaliana tair.sh ...
This will generate a subdirectory with the namebowtie-0.12.8,
so enter that subdirectory so that you can have access to the
The program ships with someE. colidata, so we will check the installation with this.
To use the program, you type the name of the executable, then give the first part of the name of the files that hold the indexes and finally give the location of the set of reads.
With the standard Bowtie installation there is a subdirectory called
readsthat has 1000 short sequences, so we are telling the program to look there for the data.
So to test the installation type the following (on some linux installations you don’t need to specify the ./ before bowtie)
Then you get a bunch of output written to the screen and at the end you should see
# reads processed: 1000
# reads with at least one reported alignment: 699 (69.90%)
# reads that failed to align: 301 (30.10%)
Reported 699 alignments to 1 output stream(s)
to examine the output you can have Bowtie write it to file by putting a filename after the command (the program will generate this file if it doesn’t already exist)
[cavanr@boris bowtie-0.12.8]$ ./bowtie e coli reads/e coli 1000.fq e coli.map
then the filee coli.mapwill contain all of the stuff that has been
If you opene coli.mapup you should see
r0 - gi|110640213|ref|NC 008253.1| 3658049 ATGCTGGAATGGCGATAGTTGGGTGGGTATCGTTC 45567778999:9;;<===>?@@@@AAA ABCCCDE 0 32:T>G,34:G>A
r1 - gi|110640213|ref|NC 008253.1| 1902085 CGGATGATTTTTATCCCATGAGACATCCAGTTCGG 45567778999:9;;<===>?@@@@AAA ABCCCDE 0 r2 - gi|110640213|ref|NC 008253.1| 3989609 CATAAAGCAACAGTGTTATACTATAACAATTTTGA 45567778999:9;;<===>?@@@@AAA ABCCCDE 0 r5 + gi|110640213|ref|NC 008253.1| 4249841 CAGCATAAGTGGATATTCAAAGTTTTGCTGTTTTA EDCCCBAAAA@@@@?>===<;;9:9998 7776554 0 r7 + gi|110640213|ref|NC 008253.1| 4086913 GCATATTGCCAATTTTCGCTTCGGGGATCAGGCTA EDCCCBAAAA@@@@?>===<;;9:9998 7776554 0 r8 + gi|110640213|ref|NC 008253.1| 2679194 GGTTCAGTTCAGTATACGCCTTATCCGGCCTACGG EDCCCBAAAA@@@@?>===<;;9:9998 7776554 0 14:A>T,33:C>G r9 - gi|110640213|ref|NC 008253.1| 2430559 GCCTGTTCGGCGTTGAGGGTAATGAAATCATCGCC 45567778999:9;;<===>?@@@@AAA ABCCCDE 0
To get a prebuilt index for some other organism, sayS. cerevisiae
you can go to the site
ftp://ftp.cbcb.umd.edu/pub/data/bowtie indexes
First get the yeast (i.e. S. cerevisiae) genome build from the
Bowtie website (the CYGD version).
[cavanr@boris bowtie-0.12.8]$ wget
ftp://ftp.cbcb.umd.edu/pub/data/bowtie indexes/s cerevisiae.ebwt.zip
Then move this into the indexes directory (note I mistakenly downloaded it from the main bowtie subdirectory) and unpack it
[cavanr@boris indexes]$ unzip s cerevisiae.ebwt.zip Archive: s cerevisiae.ebwt.zip inflating: s cerevisiae.1.ebwt inflating: s cerevisiae.2.ebwt inflating: s cerevisiae.3.ebwt ...
then move back to the main directory and issue the following command
[cavanr@boris bowtie-0.12.8]$ ./bowtie -c s cerevisiae ATTGTAGTTCGAGTAAGTAATGTGGGTTTG
then you should see output like
0 + Scchr02 90972 ATTGTAGTTCGAGTAAGTAATGTGGGTTTG IIIIIIIIIIIIIIIIIIIIIIIIIIIIII 0
# reads processed: 1
# reads with at least one reported alignment: 1 (100.00%)
# reads that failed to align: 0 (0.00%)
Reported 1 alignments to 1 output stream(s)
What the command did was align the single sequence
ATTGTAGTTCGAGTAAGTAATGTGGGTTTGagainst the yeast indexed
genome.
By using the-c option we mapped a single sequence from the
command line to the genome-you would never want to do this except for testing.
We will build an index from a FASTA formatted file for a plasmid
from anE. colistrain that was responsible for a food poisoning
incident in Japan.
First download the sequence fileNC 002127.fna
[cavanr@boris bowtie-0.12.8]$ wget
ftp://ftp.ncbi.nlm.nih.gov/genomes/Bacteria/Escherichia coli O157 H7 Sakai uid57781/NC 002127.fna
Here is the top of that file: it is a FASTA file.
>gi|10955262|ref|NC 002127.1| Escherichia coli O157:H7 str. Sakai plasmid pOSAK1, complete sequence
TTCTTCTGCGAGTTCGTGCAGCTTCTCACACATGGTGGCCTGCTCGTCAGCATCGAGTGCGTCCAGTTTT TCGAGCAGCGTCAGGCTCTGGCTTTTTATGAATCCCGCCATGTTGAGTGCAGTTTGCTGCTGCTTGTTCA TCTTTCTGTTTTCTCCGTTCTGTCTGTCATCTGCGTCGTGTGATTATATCGCGCACCACTTTTCGACCGT
Then issue the command to build the index:
[cavanr@boris bowtie-0.12.8]$ ./bowtie-build NC 002127.fna e coli O157 H7
which generates some index files
[cavanr@boris bowtie-0.12.8]$ ls e coli O157 H7.* e coli O157 H7.1.ebwt e coli O157 H7.4.ebwt
e coli O157 H7.2.ebwt e coli O157 H7.rev.1.ebwt e coli O157 H7.3.ebwt e coli O157 H7.rev.2.ebwt
Then move these to the indexes directory
[cavanr@boris bowtie-0.12.8]$ mv e coli O157 H7.* indexes
then as with the yeast example, let’s align a single read from the command line:
[cavanr@boris bowtie-0.12.8]$ ./bowtie -c e coli O157 H7 GCGTGAGCTATGAGAAAGCGCCACGCTTCC
and if everything went as planned you should get
0 + gi|10955262|ref|NC 002127.1| 2814 GCGTGAGCTATGAGAAAGCGCCACGCTTCC IIIIIIIIIIIIIIIIIIIIIIIIIIIIII 0
# reads processed: 1
# reads with at least one reported alignment: 1 (100.00%)
# reads that failed to align: 0 (0.00%)
Note that we need to be in the same directory level as our executable in order to use that executable thus far-this is not necessary.
To have access to an executable anywhere in your system you
should alter yourPATH variable in the linux environment to include
where you keep your executables then write the executables to your path.
So, let’s first make the bin directory we created part of our path:
and copy the executables: note that by copying the name of the
executable without the./at the start we can just use the name of
the executable, i.e.
[cavanr@boris bowtie-0.12.8]$ cp bowtie $HOME/bin/./bowtie
[cavanr@boris bowtie-0.12.8]$ cp bowtie-build $HOME/bin/./bowtie-build
[cavanr@boris bowtie-0.12.8]$ cp bowtie-inspect $HOME/bin/./bowtie-inspect
To test that this works let’s go back to our home directory and
issue our bowtie command with the 1000 sampleE. colireads (note
that we need to tell Bowtie where to find the fastq and index files)
[cavanr@boris ~]$ bowtie
$HOME/bin/bowtie-0.12.8/indexes/e coli $HOME/bin/bowtie-0.12.8/reads/e coli 1000.fq
Bowtie can also produce a special file type that is widely used in the NGS world, a SAM file.
To do so you use the-Soption in the call to bowtie (and use the
.samextension on the output file)
[cavanr@boris bowtie-0.12.8]$ bowtie -S e coli reads/e coli 10000snp.fq ec snp.sam
Here is the top of the fileec snp.sam.
@HD VN:1.0 SO:unsorted
@SQ SN:gi|110640213|ref|NC 008253.1| LN:4938920
@PG ID:Bowtie VN:0.12.8 CL:"bowtie -S e coli reads/e coli 10000snp.fq ec snp.sam" r0 16 gi|110640213|ref|NC 008253.1| 5212 255 35M * 0 0 GCAATGATAAAAGGAGTAACCTGTGAAAAAGATGC 45567778999:9;;<===>?@@@ @AAAABCCCDE XA:i:0 MD:Z:35 NM:i:0 r1 0 gi|110640213|ref|NC 008253.1| 2568 255 35M * 0 0 TATGTTGGCAATATTGATGAAGATGGCGTCTGCCG EDCCCBAAAA@@@@?>===<;;9: 99987776554 XA:i:0 MD:Z:35 NM:i:0
The SAM (for sequence alignment/map) file type has a very strict format.
These files can be processed in a highly efficient manner using a suite of programs called SAMtools.
Here is how to setup these tools
Download the latest version in your bin directory
samtools-0.1.18.tar.bz2.
[cavanr@boris bin]$ wget
then unpack
[cavanr@boris bin]$ tar -jxvf samtools-0.1.18.tar.bz2
then there is a directory full of C programs called samtools-0.1.18, so go in there and type
[cavanr@boris samtools-0.1.18]$ make
and write the executable to your path
[cavanr@boris samtools-0.1.18]$ cp samtools $HOME/bin/./samtools
To use this for variant calling, we need an example with at least 2 subjects, so let’s use the example that ships with SAMtools. We will return to this example latter, but for now we will just take a look at the “pileup” which represents the extent of coverage. Here is how to use SAMtools to index a FASTA file:
[cavanr@boris samtools-0.1.18]$ samtools faidx examples/ex1.fa
then create a BAM file from the SAM file (BAM files are binary, so they are compressed but not readable by eye)
[cavanr@boris samtools-0.1.18]$ samtools import examples/ex1.fa.fai examples/ex1.sam.gz ex1.bam
should get
then index the BAM file
[cavanr@boris samtools-0.1.18]$ samtools index ex1.bam
then we can view the alignment to visually examine the extent of coverage and the depth of coverage
[cavanr@boris samtools-0.1.18]$ samtools tview ex1.bam examples/ex1.fa
1 11 21 31 41 51 61 71 CACTAGTGGCTCATTGTAAATGTGTGGTTTAACTCGTCCATGGCCCAGCATTAGGGAGCTGTGGACCCTGCAGCCTGGCT ... ...A...C. ... ...C... ... ... .. ...T.T.T..T...T..TC. ... ... ... ...C... ... ... ... ...T... ... ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,... ...T... ... ... ... ... ... ...T.... ... ... ... ... .
sequencing to generate sequences from samples of RNA.
The transcriptome is the collection of all transcripts that can be generated from a genome.
Current estimates indicate that 92-94% of human transcripts with more than one exon have alternatively spliced isoforms (Wang,
Sandberg, Luo, et al. Nature, 2008).
This means that the same gene can give rise to multiple mRNA molecules.
Some will differ because they have have different exons assembled into an mRNA, but other possibilities include differences in use of the transcription start site (TSS), and differences in the 5’ and 3’ untranslated regions (UTRs).
Differences in exon usage will result in mRNAs from the same gene leading to different proteins, hence we speak of differential coding DNA sequences (CDS).
One of the differences that arises due to differential 3’UTR usage is alternative polyadenelation patterns.
These differences in 5’ and 3’ UTR usage lead to mRNA molecules that have differential affinity for proteins that bind to the mature mRNA molecule and we are just starting to understand how biological processes are regulated by these subtle mechanisms.
Note that there is a difference in aligning a set of reads from an RNA sample and a DNA sample: the RNA molecules will have undergone removal of introns hence they won’t align directly to the genome.
If there is an annotated transcriptome for an organism you should start out trying to use this to analyze your data.
However most investigations find evidence for transcripts that are not currently annotated, even for well studied organisms like mice and humans.
We will investigate the role of using an annotated transcriptome for a class project: we will split into 4 groups and each group will either not use or use an annotated transcriptome during the mapping stage and during the transcript assembly stage.
So we will do a 2 factor complete factorial design: you guys will run the analysis and I will summarize the findings the last day of class. More details on this once we have discussed the details of how to conduct the analysis.
One of the differences between using next generation sequencing for resequencing and profiling RNA levels is that with libraries prepared from RNA, one often finds duplicate reads.
In fact it is not unusual to find that 60-80% of the reads are duplicates.
In a resequencing study the chances of finding duplicates is quite low: for example, the human haploid genome is about 3 billion bps so the probability of observing a duplicate is about 1 in 3 billion, so with 20-40 million reads, duplicate reads seem unlikely.
Duplicate reads can arise as a PCR artifact, hence in resequencing studies duplicate reads should probably be treated as artifacts and removed.
There is a SAMtools function calledrmdupthat can be used to do
this, but read the manual on its use: for example, it is designed for paired end reads by default.
However, when we consider RNA-Seq libraries, duplicates might arise just due to low complexity of our sample.
By low complexity we mean there are not many distinct RNA molecules.
The median length of a human transcript is 2186 nucleotides (according to the UCSC hg19 annotation), so if one has a library with only 1 type of transcript and generates 20 million reads from it one is guaranteed to find duplicates.
So for analysis of RNA-Seq experiments it is probably unwise to remove duplicates.
There are a number of algorithms that are designed to align a set of short reads to the transcriptome, here is a short non-exhaustive list. 1. TopHat 2. GSNAP 3. MapSplice 4. SpliceMap 5. HMMSplicer
However it is not clear at this point if any of these really dominate the others in terms of performance.
However, TopHat is perhaps the most popular currently, and as it builds off of Bowtie, we will use this program in this course.
The basic idea behind TopHat is that if 2 segments of a read map to different locations on the genome then they are likely mapping to 2 different exons.
To use TopHat you need fastq files for all of our samples and the genome sequence for the organism.
Note that sometimes the data for a single sample will be in more than one fastq file.
While we can use Bowtie to align short reads to a genome, reads
that span an intron, or genes that span asplice junction, will not
If a read contains an internal segment that should map to an exon, Bowtie will fail to map this read to its correct genomic location as it won’t match the genome outside of this exon.
For this reason, Tophat initially splits the reads up into 25 base units, does the read mapping, then reassembles reads.
Note: if you are using a set of reads that are shorter than 50 bases you should instruct TopHat to break the reads into fragments that are about half the length of your reads.
For example, if you have a set of Illumina reads that are 36 bases you should instruct TopHat to break them into fragments of length
18 (using the--segment-lengthoptions, like
--segment-length 18), otherwise it may not detect any splice
TopHat starts out by mapping the reads to the genome using Bowtie and sets aside those reads that don’t map.
It then constructs a set of disjoint covered regions (it no longer uses the program Maq as it did at the time of the publication): these are taken to be the initial set of exons observed in that sample.
The program determines a consensus sequence using the reads, however in low coverage regions it will use the reference genome to determine the sequence.
Also, as the ends of exons are likely only mapped by reads that span the splice junction, the disjoint regions covered by reads are expanded (45 bases by default) using the reference sequence.
For genes that are transcribed at low levels there could be gaps in the exons after the assembly step, hence exons that are very close are merged into a single exon.
Introns of length less than 70 bases are rare in mammalian
genomes, hence by default we combine exons that are separated by less than this many bases (this can be adjusted).
The resulting set of putative exons (with their extensions from the
reference genome) we will callislands.
The 5’ end of an intron is called adonor site and the 3’ end is
the acceptor site is almost always AG, but these are sometimes GC-AG and AU-AC so current versions of TopHat also look for these acceptor and donor sites.
TopHat uses these sequence characteristics to find potential donor and acceptor site pairs in the island sequences (not just adjacent ones, but nearby ones to allow for alternative splicing).
It then looks at the set of reads that were initially unmapped and examines if any of these map to the sequence that spans the splice junction.
To conduct this mapping TopHat uses the fact that most introns are between 70 and 500,000 bases (the maximum differs from the publication): these intron sizes are based on mammals, so the user should specify values for these if using a different organism.
It also requires that at least one read span at least 8 bases on each side of the splice junction by default, but this value can be
adjusted.
It also only uses the first 28 bases from the 5’ end of the read to ensure that the read is of high quality, but this too can be adjusted. Finally the program reports a splice junction only if it occurs in more than 15% of the depth of coverage of the flanking exons (the
15% value comes from the Wang et al. 2008,Naturepaper), but
this is also adjustable as this is based on human data. If one supplies a transcriptome to TopHat via a GTF file, the program will first map reads to the transcriptome then try to identify splice junctions for the unmapped reads.
One can disable the subsequent search for splice junctions by specifying the -T option if you have provided a transcriptome. If you are going to use an annotated transcriptome then TopHat will need to construct an index for this and if you are processing multiple samples TopHat will redo exactly the same calculation for each.
To save time, you should have TopHat do these calculations for the first sample and save the results.
You can do this using the--transcriptome-index option. This
The exact syntax is like this: note that the
--transcriptome-indexoption must be used right after the -G
option.
tophat -o out sample1 -G known genes.gtf \
--transcriptome-index=transcriptome data/known \
hg19 sample1 1.fq.z
Then for processing the other samples we just tell TopHat where these indices are and don’t specify the -G option
tophat -o out sample2 \
--transcriptome-index=transcriptome data/known \
To use the program first get the latest version
[cavanr@boris bin]$ wget http://tophat.cbcb.umd.edu/downloads/tophat-2.0.6.Linux x86 64.tar.gz
Then uncompress the binaries, enter the directory that is generated and copy the executables to your path.
[cavanr@boris bin]$ tar zxvf tophat-2.0.6.Linux x86 64.tar.gz
[cavanr@boris tophat-2.0.6.Linux x86 64]$ cp tophat $HOME/bin/./tophat [cavanr@boris tophat-2.0.6.Linux x86 64]$ cp * $HOME/bin/./
Then you should test the installation, so get some test data.
[cavanr@boris tophat-2.0.6.Linux x86 64]$ wget http://tophat.cbcb.umd.edu/downloads/test data.tar.gz
Then uncompress, go into that directory and run a test
[cavanr@boris tophat-2.0.6.Linux x86 64]$ tar zxvf test data.tar.gz [cavanr@boris tophat-2.0.6.Linux x86 64]$ cd test data
Then test by issuing the command
[2012-11-08 17:14:56] Beginning TopHat run (v2.0.6) ---[2012-11-08 17:14:56] Checking for Bowtie
Bowtie 2 not found, checking for older version..
Bowtie version: 0.12.8.0
[2012-11-08 17:14:56] Checking for Samtools
Samtools version: 0.1.18.0
[2012-11-08 17:14:56] Checking for Bowtie index files [2012-11-08 17:14:56] Checking for reference FASTA file
...
While TopHat is useful for aligning a set of reads to the transriptome, one must use some other program to generate transcript level summaries of gene expression and test for differences between groups.
One such program that is supported by the same group of researchers that develop TopHat is Cufflinks.
Cufflinks uses the output from TopHat and we will see that one can use functionality of the R package cummeRbund to examine the output and generate reports and publication quality graphs. It is designed for paired end reads but can be used for unpaired reads.
reads that depends on the length of the fragments: with paired end reads one can estimate the distribution of the lengths. Note that there is a fundamental identifiability problem with transcript assembly that is only mitigated by the presence of reads that span splice junctions.
Suppose there are 2 exons and some reads map to both exons but we are unable to identify any reads that span splice junctions. If there are 2 exons there are 3 possible transcripts (2 with one of each exon and a third that uses both) so if we allow for all 3 transcripts there are an infinite collection of combinations of the 3 transcript levels that are consistent with observed read counts that hit both exons.
For this reason one must enforce a constraint on the transcripts: for example, we attempt to find the minimal set of transcripts that explain the exon counts.
Cufflinks quantifies the level of expression of a transcript via the number of fragments per kilobase of exon per million fragments mapped (FPKM).
This attempts to account for the fact that longer transcripts will generate more reads than shorter transcripts due to their length. Cuffdiff is a program that is bundled with Cufflinks that allows one to test for differences between experimental conditions.
random variables: this allows one to define a test statistic once one determines an approximation to the standard error of this log ratio. This standard error depends on the number of isoforms for the transcript: if there is a single isoform there is no uncertainty in the expression estimate produced by the algorithm and the only source of variability is from biological replicates.
If there are no replicates within conditions the standard error is computed by examining the variance across the 2 conditions. If there are not many transcripts that differ in their level of
expression this will provide a reasonable standard error, but if there are replicates one can obtain better estimates of the variance of the log ratio by using the negative binomial distribution.
If there is only a single isoform then an approach similar to that used in the R package DESeq is used, but if there are multiple isoforms then uncertainty in the isoform expression estimates must be taken into account: this is done using a generalization of the negative binomial distribution called the beta negative binomial distribution.
Some useful details:
The program will not conduct significance tests with fewer than 3 replicates for each condition unless you explicitly instruct it to do so by specifying a different minimum with the
--min-reps-for-js-testoption.
While both BAM and SAM files can be used for input the program requires that if chromosome names are present in the @SQ records in the header of the file then the reads must be sorted in the same order.
We’ve already installed and tested the latest version of TopHat, so now let’s install Cufflinks using what is now the familiar strategy: download the tarball, unpack it and write the executables to our path by copying them to bin.
[cavanr@boris bin]$ wget
http://cufflinks.cbcb.umd.edu/downloads/cufflinks-2.0.2.Linux x86 64.tar.gz [cavanr@boris bin]$ tar zxvf cufflinks-2.0.2.Linux x86 64.tar.gz
[cavanr@boris bin]$ cd cufflinks-2.0.2.Linux x86 64
Then test the installation using some test data, so download and run.
[cavanr@boris cufflinks-2.0.2.Linux x86 64]$ wget http://cufflinks.cbcb.umd.edu/downloads/test data.sam
[cavanr@boris cufflinks-2.0.2.Linux x86 64]$ cufflinks test data.sam
recent release.
[bam header read] EOF marker is absent.
[bam header read] invalid BAM binary header (this is not a BAM file).
File test data.sam doesn’t appear to be a valid BAM file, trying SAM...
...
[11:36:11] Assembling transcripts and estimating abundances.
> Processed 1 loci. [*************************] 100%
Which indicates that this is working properly. This generates a GTF file called transcripts.gtf which has information on transcripts that were identified and their level of expression.
As an example of using the TopHat/Cufflinks programs we will analyze the data that was used to illustrate the protocol developed by the authors of the programs (this is from the Nature Protocols paper from March 2012).
The data is already loaded on the server and we’ve installed all of the software, so we are almost ready to go.
We also need a set of Bowtie indexes and if we want to use an annotated transcriptome we need a GTF file with that information. These have already been set up in the subdirectory
/export/home/courses/ph7445/data
The indexes are in the files with names that end in ebwt (there are 6 of these and I got them from the Bowtie website).
The file Drosophila melanogaster.BDGP5.68.gtf was obtained from ensemble.org.
First we must use TopHat to map the reads in the fastq files to the transcriptome.
Note that due to all of the options we are going to use we need to break the command up into multiple lines: we do this by ending each line with a back-slash.
[cavanr@boris RNAseq]$ tophat -p 2 -G \
/export/home/courses/ph7445/data/Drosophila melanogaster.BDGP5.68.gtf \
-o C1 R1 thout \
--bowtie1 /export/home/courses/ph7445/data/d melanogaster fb5 22 \
/export/home/courses/ph7445/data/GSM794483 C1 R1 1.fq \
/export/home/courses/ph7445/data/GSM794483 C1 R1 2.fq
[2012-11-13 12:47:56] Beginning TopHat run (v2.0.6) ---[2012-11-13 12:47:56] Checking for Bowtie
Bowtie version: 0.12.8.0
[2012-11-13 12:47:56] Checking for Samtools
Samtools version: 0.1.18.0
[2012-11-13 12:47:56] Checking for Bowtie index files [2012-11-13 12:47:56] Checking for reference FASTA file
Warning: Could not find FASTA file
/export/home/courses/ph7445/data/d melanogaster fb5 22.fa ...
[2012-11-13 12:47:56] Reconstituting reference FASTA file from Bowtie index
Here is an explanation of the options that have been specified
I -p specifies the number of processors to use
I -G is used to give the location of the GTF file
I -o is used to give the desired location for the output
I -bowtie1is used to indicate that we want to use the first version of Bowtie and this is followed by the start of the name of the files that hold the Bowtie indexes
I last one gives the locations of the fastq files.
One then needs to issue similar commands for all of the other samples: for these you just change the name of the output directory and the name of the fastq files.
For example, to process replicate 2 of condition 1 you would issue the command
[cavanr@boris RNAseq]$ tophat -p 2 -G \
/export/home/courses/ph7445/data/Drosophila melanogaster.BDGP5.68.gtf \
-o C1 R2 thout \
--bowtie1 /export/home/courses/ph7445/data/d melanogaster fb5 22 \
/export/home/courses/ph7445/data/GSM794484 C1 R2 1.fq \
/export/home/courses/ph7445/data/GSM794484 C1 R2 2.fq
You will notice that the program first looks for a fasta file holding the genome of D. melanogaster and when it can’t find it it reconstitutes the file from the Bowtie index.
As it can do this very quickly this isn’t much of a concern but we will need it latter on and it is easy to generate: just issue this command.
[cavanr@boris RNAseq]$ bowtie-inspect
/export/home/courses/ph7445/data/d melanogaster fb5 22 > d melanogaster fb5 22.fa
You should then reference this directory when you specify where your index files are located.
Then we process all of the resulting BAM files using cufflinks as follows.
[cavanr@boris RNAseq]$ cufflinks -p 2 -o C1 R1 clout C1 R1 thout/accepted hits.bam
Again-p controls the number of processors and -ogives the
output directory
The next step is to run cuffmerge to merge all of the transcriptome data into a common set of transcripts.
To do this you need to create a text file that has the locations of all of the GTF files that were created running cufflinks.
Given our conventions for naming the output files from the cufflinks runs this file just has the contents
./C1 R1 clout/transcripts.gtf ./C1 R2 clout/transcripts.gtf ./C1 R3 clout/transcripts.gtf ./C2 R1 clout/transcripts.gtf ./C2 R2 clout/transcripts.gtf ./C2 R3 clout/transcripts.gtf
[cavanr@boris RNAseq]$ cuffmerge -p 2 \
-g /export/home/courses/ph7445/data/Drosophila melanogaster.BDGP5.68.gtf\
-s d melanogaster fb5 22.fa \ assemblies.txt
This command generates a directory calledmerged asmthat
Finally you issue the cuffdiff command to test for differential expression
[cavanr@boris RNAseq]$ cuffdiff -o diff out \
-b d melanogaster fb5 22.fa -p 2 -L \
C1,C2 merged asm/merged.gtf C1 R1 thout/accepted hits.bam,\ C1 R2 thout/accepted hits.bam,C1 R3 thout/accepted hits.bam,\ C2 R1 thout/accepted hits.bam,C2 R2 thout/accepted hits.bam,\ C2 R3 thout/accepted hits.bam
As this demonstrates, we need to instruct the program where the fasta file is, the output directory and the number of processors as before, but now we must also include information on
I the labels to use -L C1,C2to denote the conditions
I the location of the merged GTF file
You are using Cufflinks v2.0.2, which is the most recent release. [14:55:40] Loading reference annotation and sequence.
[14:55:45] Inspecting maps and determining fragment length distributions.
...
[17:17:31] Testing for differential expression and regulation in locus. > Processed 11618 loci.
[*************************] 100
Performed 11637 isoform-level transcription difference tests Performed 9328 tss-level transcription difference tests Performed 8067 gene-level transcription difference tests Performed 9777 CDS-level transcription difference tests Performed 1523 splicing tests
Performed 1219 promoter preference tests Performing 1335 relative CDS output tests ...
Writing CDS-level read group tracking Writing read group info
We can then examine the output using the R package
cummeRbund, so start up R by typing R at the linux command prompt.
When in R load the library and read in the output from cufflinks
> library(cummeRbund)
> cuff data <- readCufflinks(’diff out’) Creating database diff out/cuffData.db Reading diff out/genes.fpkm tracking Checking samples table...
Populating samples table... Writing genes table
Reshaping geneData table Recasting
Writing geneData table ...
Then we can examine the object to see what sorts of tests we can examine.
> cuff data
CuffSet instance with: 2 samples
14704 genes 27456 isoforms 18216 TSS 19465 CDS 14704 promoters 18216 splicing 13489 relCDS
And we can test for differences in gene expression using straightforward commands as follows.
> gene diff <- diffData(genes(cuff data)) > sig gene diff <- subset(gene diff, + significant==’yes’)
> nrow(sig gene diff) [1] 246
> csDensity(genes(cuff data)) > dev.off() > pdf("explorPlt2.pdf") > csScatter(genes(cuff data), ’C1’, ’C2’) > dev.off() > pdf("explorPlt3.pdf") > csVolcano(genes(cuff data), ’C1’, ’C2’) > dev.off()
> mygene <- getGene(cuff data, ’regucalcin’) > pdf("explorPlt4.pdf") > expressionBarplot(mygene) > dev.off() > pdf("explorPlt5.pdf") > expressionBarplot(isoforms(mygene)) > dev.off()
0.0 0.5 1.0 0 1 2 3 4 log10(fpkm) density sample_name C1 C2
10 1000
10 1000
C1
●● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●●●●●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ●● ●●●●●●● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ●● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●●● ●● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ●● ● ●● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ●● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ●● ● ●● ● ● ● ● ● ● ● ● ●●●● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ●●●● ● ● ● ● ● ● ● ● ● ●● ●●●● ● ● ● ● ● ● ● ●● ● ●● ● ● ●●●● ●● ● ● ● ●● ● ● ● ●● ● ● ● ● ● ● ●●●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●●●● ●●●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ●● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ● ●●●●●●●●●●●●●●● ● ● ● ● ● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●●●●●●●●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ●● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ●● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●●● ●● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ● ● ● ●●●●●● ● ● ● ●● ● ● ●● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ●●●● ● ● ●●●● ● ●● ● ● ● ● ● ●● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ●● ● ● ●●● ● ● ● ●●● ● ● ● ● ●● ● ● ● ● ● ● ● ● ●● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ●● ●● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ●●●●● ● ● ● ●● ● ● ● ● ● ● ● ●● ● ●●●● ● ●● ● ● ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●● ● ● ● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ●● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●●●●●●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ● ●● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ●●● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ● ● ● ● ●● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ●●●●●●●●● ● ● ● ● ● ● ● ● ● ●● ●● ● ● ●●● ● ● ●● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ●● ● ●● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ●● ● ●● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ●● ● ● ●● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ● ●●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ●● ● ● ●● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ●● ●● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ●● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●●● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● �