Perform DE analysis (Trinity)

Create count matrix

Locate util/abundance_estimates_to_matrix.pl in the trinityrnaseq-2.2.0 distribution, and run

cd ~/LSLNGS2015/Trinity

PATH_TO_TRINITY/util/abundance_estimates_to_matrix.pl \
--est_method RSEM --out_prefix Trinity_genes \
RSEM_Sp_ds/Sp_ds.genes.results RSEM_Sp_hs/Sp_hs.genes.results \
RSEM_Sp_log/Sp_log.genes.results RSEM_Sp_plat/Sp_plat.genes.results

PATH_TO_TRINITY/util/abundance_estimates_to_matrix.pl \
--est_method RSEM --out_prefix Trinity_trans \
RSEM_Sp_ds/Sp_ds.isoforms.results RSEM_Sp_hs/Sp_hs.isoforms.results \
RSEM_Sp_log/Sp_log.isoforms.results RSEM_Sp_plat/Sp_plat.isoforms.results

Options

--est_method RSEM or eXpress

--out_prefixoutput file prefix (default: 'matrix')

--cross_sample_fpkm_norm choose one of the three normalization methods, TMM, UpperQuartile, none (default: TMM)

Create count matrices

Files created for gene-level count matrix:

ls -la Trinity_genes*

-rw-rw-r-- 1 ycl6 ycl6 16023 Nov  1 15:29 Trinity_genes.counts.matrix
-rw-rw-r-- 1 ycl6 ycl6 19097 Nov  1 15:29 Trinity_genes.TMM.EXPR.matrix
-rw-rw-r-- 1 ycl6 ycl6 16429 Nov  1 15:29 Trinity_genes.TPM.not_cross_norm
-rw-rw-r-- 1 ycl6 ycl6   236 Nov  1 15:29 Trinity_genes.TPM.not_cross_norm.TMM_info.txt

Files created for transcript-level count matrix:

ls -la Trinity_trans*

-rw-rw-r-- 1 ycl6 ycl6 17516 Nov  1 15:33 Trinity_trans.counts.matrix
-rw-rw-r-- 1 ycl6 ycl6 20646 Nov  1 15:33 Trinity_trans.TMM.EXPR.matrix
-rw-rw-r-- 1 ycl6 ycl6 17923 Nov  1 15:33 Trinity_trans.TPM.not_cross_norm
-rw-rw-r-- 1 ycl6 ycl6   239 Nov  1 15:33 Trinity_trans.TPM.not_cross_norm.TMM_info.txt

We use head to examine the first 10 lines of the counts matrix

head Trinity_genes.counts.matrix

        Sp_ds   Sp_hs   Sp_log  Sp_plat
TRINITY_DN7_c0_g2       0.00    56.99   12.00   0.00
TRINITY_DN329_c0_g1     7.00    1.00    1.00    4.00
TRINITY_DN197_c0_g1     218.00  179.00  210.00  257.00
TRINITY_DN244_c0_g1     36.00   7.00    15.00   28.00
TRINITY_DN121_c0_g1     1.24    1.00    1.43    2.57
TRINITY_DN37_c0_g2      0.00    0.00    0.00    0.00
TRINITY_DN172_c0_g1     74.00   28.00   19.00   84.00
TRINITY_DN258_c0_g1     61.00   47.00   91.00   56.00
TRINITY_DN263_c0_g1     31.00   21.00   48.00   87.00

head Trinity_trans.counts.matrix

        Sp_ds   Sp_hs   Sp_log  Sp_plat
TRINITY_DN42_c0_g3_i1   0.00    0.00    1.00    0.00
TRINITY_DN132_c0_g1_i1  0.00    0.00    0.00    2.59
TRINITY_DN169_c0_g1_i1  7.00    4.00    4.00    5.00
TRINITY_DN70_c0_g1_i1   49.00   24.00   62.00   78.00
TRINITY_DN148_c0_g1_i1  18.00   7.00    13.00   17.00
TRINITY_DN41_c0_g2_i1   0.00    0.00    0.00    0.00
TRINITY_DN180_c0_g1_i1  3.00    2.00    6.00    2.00
TRINITY_DN258_c0_g1_i1  61.00   47.00   91.00   56.00
TRINITY_DN51_c0_g2_i1   179.00  86.00   38.99   242.00

Perform pairwise sample comparisons using edgeR

Locate Analysis/DifferentialExpression/run_DE_analysis.pl in the trinityrnaseq-2.2.0 distribution, and run

PATH_TO_TRINITY/Analysis/DifferentialExpression/run_DE_analysis.pl \
--matrix Trinity_genes.counts.matrix --method edgeR --dispersion 0.1 \
--output edgeR_genes

PATH_TO_TRINITY/Analysis/DifferentialExpression/run_DE_analysis.pl \
--matrix Trinity_trans.counts.matrix --method edgeR --dispersion 0.1 \
--output edgeR_trans

Options

--matrix matrix of raw read counts, not the normalized values

--method choose one of the three methods: edgeR, DESeq, DESeq2

--dispersion edgeR dispersion value (default: 0.1)

--output name of directory to place outputs

Output

The edgeR_genes and edgeR_trans folders contain the pairwise sample comparisons results (*.edgeR.DE_results) and M-A and Volcano plots (*.MA_n_Volcano.pdf) for the gene-level and transcript-level analysis respectively.

For example, ls -la edgeR_genes

-rw-rw-r--  1 ycl6 ycl6 24373 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_ds_vs_Sp_hs.edgeR.DE_results
-rw-rw-r--  1 ycl6 ycl6 11851 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_ds_vs_Sp_hs.edgeR.DE_results.MA_n_Volcano.pdf
-rw-rw-r--  1 ycl6 ycl6   943 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_ds_vs_Sp_hs.Sp_ds.vs.Sp_hs.EdgeR.Rscript
-rw-rw-r--  1 ycl6 ycl6 25617 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_ds_vs_Sp_log.edgeR.DE_results
-rw-rw-r--  1 ycl6 ycl6 12205 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_ds_vs_Sp_log.edgeR.DE_results.MA_n_Volcano.pdf
-rw-rw-r--  1 ycl6 ycl6   947 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_ds_vs_Sp_log.Sp_ds.vs.Sp_log.EdgeR.Rscript
-rw-rw-r--  1 ycl6 ycl6 25580 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_ds_vs_Sp_plat.edgeR.DE_results
-rw-rw-r--  1 ycl6 ycl6 11986 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_ds_vs_Sp_plat.edgeR.DE_results.MA_n_Volcano.pdf
-rw-rw-r--  1 ycl6 ycl6   951 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_ds_vs_Sp_plat.Sp_ds.vs.Sp_plat.EdgeR.Rscript
-rw-rw-r--  1 ycl6 ycl6 23186 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_hs_vs_Sp_log.edgeR.DE_results
-rw-rw-r--  1 ycl6 ycl6 11703 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_hs_vs_Sp_log.edgeR.DE_results.MA_n_Volcano.pdf
-rw-rw-r--  1 ycl6 ycl6   947 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_hs_vs_Sp_log.Sp_hs.vs.Sp_log.EdgeR.Rscript
-rw-rw-r--  1 ycl6 ycl6 24305 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_hs_vs_Sp_plat.edgeR.DE_results
-rw-rw-r--  1 ycl6 ycl6 12091 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_hs_vs_Sp_plat.edgeR.DE_results.MA_n_Volcano.pdf
-rw-rw-r--  1 ycl6 ycl6   951 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_hs_vs_Sp_plat.Sp_hs.vs.Sp_plat.EdgeR.Rscript
-rw-rw-r--  1 ycl6 ycl6 25862 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_log_vs_Sp_plat.edgeR.DE_results
-rw-rw-r--  1 ycl6 ycl6 12468 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_log_vs_Sp_plat.edgeR.DE_results.MA_n_Volcano.pdf
-rw-rw-r--  1 ycl6 ycl6   955 Nov  1 15:39 Trinity_genes.counts.matrix.Sp_log_vs_Sp_plat.Sp_log.vs.Sp_plat.EdgeR.Rscript

Use head to examine one of the *.DE_results file.

head edgeR_genes/Trinity_genes.counts.matrix.Sp_log_vs_Sp_plat.edgeR.DE_results

logFC   logCPM  PValue  FDR
TRINITY_DN251_c0_g1     9.6363125893139 14.5848472303309        2.13430918067156e-20    6.36024135840125e-18
TRINITY_DN309_c0_g1     8.42206045708238        15.072565164338 4.66076951545597e-19    6.94454657802939e-17
TRINITY_DN141_c0_g1     7.28961205941505        16.5621549422877        3.83166387777312e-17    3.80611945192129e-15
TRINITY_DN140_c0_g1     7.20427411091638        17.276544976763 5.13012298906905e-17    3.82194162685644e-15
TRINITY_DN261_c0_g1     7.69101068079639        14.0295251279574        8.91346030061623e-17    4.9619821474267e-15
TRINITY_DN114_c0_g2     7.43363511545729        14.8478356898501        9.99056808206717e-17    4.9619821474267e-15
TRINITY_DN18_c0_g1      7.08644807744307        15.1120605756225        4.47617278549774e-16    1.9055707001119e-14
TRINITY_DN32_c0_g2      -8.10320051153684       12.7123152654971        5.16395182569354e-16    1.92357205507084e-14
TRINITY_DN232_c0_g1     -11.9109106883623       12.0284022343563        8.15080537391968e-16    2.69882222380896e-14

Use WinSCP to download the PDF file and view it on your PC or laptop.

Below shows the M-A and Volcano plots in the PDF file named Trinity_genes.counts.matrix.Sp_log_vs_Sp_plat.edgeR.DE_results.MA_n_Volcano.pdf

Last updated