1.先进行R包的安装:
source("http://bioconductor.org/biocLite.R")
< biocLite()
< biocLite("edgeR")
< biocLite("ctc")
< biocLite("Biobase")
< biocLite("ape")
< install.packages("gplots")
2.通过连接下载数据并解压:
$ wget http://sourceforge.net/projects/trinityrnaseq/files/misc/Trinity NatureProtocolTutorial.tgz/download
$ tar –xvf TrinityNatureProtocolTutorial.tgz
3.分别将解压后的左端reads和右端reads合并为一个文件,并利用Trinity进行转录组合成:
$ cat 1M_READS_sample/*.left.fq > reads.ALL.left.fq
$ cat 1M_READS_sample/*.right.fq > reads.ALL.right.fq
$ Trinity --seqType fq --left reads.ALL.left.fq --right reads.ALL.right.fq --SS_lib_type RF --CPU 6 --max_memory 20G
Trinity默认的输出结果为:trinity_out_dir/Trinity.fasta。用于下一步的分析
3.利用RSEM对转录本进行表达量的估计(Abundance Estimation):
# RSEM for ds
$align_and_estimate_abundance.pl --seqType fq --left RNASEQ_data/Sp_ds.left.fq.gz --right RNASEQ_data/Sp_ds.right.fq.gz --transcripts trinity_out_dir/Trinity.fasta --est_method RSEM --aln_method bowtie --trinity_mode --prep_reference --output_dir Sp_ds.RSEM
# RSEM for Sp_hs
$align_and_estimate_abundance.pl --seqType fq --left RNASEQ_data/Sp.hs.1M.left.fq --right RNASEQ_data/Sp.hs.1M.right.fq --transcripts trinity_out_dir/Trinity.fasta --est_method RSEM --aln_method bowtie --trinity_mode --prep_reference --output_dir Sp_hs.RSEM
# RSEM for Sp_log
$align_and_estimate_abundance.pl --seqType fq --left RNASEQ_data/Sp.log.1M.left.fq --right RNASEQ_data/Sp.log.1M.right.fq --transcripts trinity_out_dir/Trinity.fasta --est_method RSEM --aln_method bowtie --trinity_mode --prep_reference --output_dir Sp_log.RSEM
# RSEM for Sp_plat
% $align_and_estimate_abundance.pl --seqType fq --left RNASEQ_data/Sp.plat.1M.left.fq --right RNASEQ_data/Sp.plat.1M.right.fq --transcripts trinity_out_dir/Trinity.fasta --est_method RSEM --aln_method bowtie --trinity_mode --prep_reference --output_dir Sp_plat.RSEM
生成abundance estimation information表达量估计信息文件
Sp_ds.RSEM / RSEM.isoforms.results (因为是对转录本的估计)
Sp_hs.RSEM / RSEM.isoforms.results
Sp_log.RSEM / RSEM.isoforms.results
Sp_plat.RSEM / RSEM.isoforms.results
对基因估计则会用到:RSEM.genes.results
4.生成数量矩阵(counts matrix),进行样本的统一化(erform cross-sample normalization)
abundance_estimates_to_matrix.pl --est_method RSEM --out_prefix Trinity_trans Sp_ds.RSEM/RSEM.isoforms.results Sp_hs.RSEM/RSEM.isoforms.results Sp_log.RSEM/RSEM.isoforms.results Sp_plat.RSEM/RSEM.isoforms.results --name_sample_by_basedir
生成矩阵文件 Trinity_trans.isoform.counts.matrix
5.利用EdgeR差异表达分析:
run_DE_analysis.pl --matrix Trinity_trans.isoform.counts.matrix --method edgeR --dispersion 0.1 --output EdgeR
生成EdgeR文件夹
6.生成热图:
$analyze_diff_expr.pl --matrix ../Trinity_trans.isoform.TMM.EXPR.matrix -P 1e-3 -C 2
利用如下命令查看热图
% evince diffExpr.P1e-3_C2.matrix.log2.centered.genes_vs_samples_heatmap.pdf
7.生成聚类分析的图
$define_clusters_by_cutting_tree.pl --Ptree 60 -R diffExpr.P1e-3_C2.matrix.RData
利用如下命令查看图表:
% evince diffExpr.P1e-3_C2.matrix.RData.clusters_fixed_P_60/my_cluster_plots.pdf
文章引用:De novo RNA-Seq Assembly and Analysis Using Trinity and EdgeR
align_and_estimate_abundance.pl
补充一个DESeq2差异基因分析