基因组注释②:conda的安装及使用(以RepeatMasker的安装为例) - 简书 (jianshu.com)
Trinity的安装 - 简书 (jianshu.com)
无参转录组的组装注释部分(1) - 简书 (jianshu.com)
使用Trinity进行转录组组装_YoungLeelight的博客-CSDN博客_trinity组装
Trinity的安装与使用_jz19901202的博客-CSDN博客_trinity使用
对trinity组装得到的转录本进行表达矩阵构建 - 简书 (jianshu.com)
Linux环境下R和R包安装及其管理 - 米源MY - 博客园 (cnblogs.com)
【转】linux下编译出现tmp空间不足解决办法 - 简书 (jianshu.com)
安装anaconda
wget -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2021.11-Linux-x86_64.sh
bash Anaconda3-2021.11-Linux-x86_64.sh
codna --version
安装trinity
Trinity是[Broad Institute]和[Hebrew University of Jerusalem]开发的RNA-Seq数据转录组组装工具,包括三个模块,
- Inchworn(尺蠖): 将RNA-seq数据组装成单个转录本,通常是主要转录亚型的全长转录本
- Chrysalis(蛹): 这一步将上一步得到contig进行聚类,对于每个聚类构建完整的德布罗意图(de Bruijin graph)。每个转录本表示的是给定基因或者一组有着共同序列的基因的全部转录组成。 之后会根据图中不相交的点对全部短读数据进行拆分
- Butterfly(蝴蝶): 并行处理各个图(graph), 追踪每个图中的短读和配对短读的路径,最后报告可变剪切亚型的全长转录本,并且区分出旁系同源基因的转录本
conda install -c bioconda trinity
#多个的话可以合并转录本
cat /路径/1_fastq.gz /路径/2_fastq.gz > 12_fastq.gz
Trinity --seqType fq --max_memory 64G --single /data1/transcriptome/SRR4294733trim3.fastq --CPU 48 --min_contig_length 1000 --output /data1/transcriptome/SRR4294733trim3.trinity
TrinityStats.pl /路径/Trinity.fasta > /输出路径/trinity.stats
必须参数:
--seqType
--max_memory
可选参数:
–min_contig_length : 拼接产生的contig的最小长度,默认200
–long_reads : fasta file containing error-corrected or circular consensus (CCS) pac bio reads
–genome_guided_bam : genome guided mode, provide path to coordinate-sorted bam file
–jaccard_clip : 减少拼接时产生融合转录子的可能。但是这个参数比较适合于真菌物种(由于其基因组比较稠密,转录子经常在UTR区域重叠),脊椎动物以及植物则不需要使用该参数
–no_normalize_reads : 不对reads进行silico normalization,但是默认是开启的(能有效减少trinity运行时间)
–output : 输出结果目录,默认是当前目录下的trinity_out_dir文件下
–full_cleanup : only retain the Trinity fasta file, rename as ${output_dir}.Trinity.fasta
3、如果要查看trinity的完整的全部参数:
Trinity --show_full_usage_info
从中我们可以看到Trinity其实还分别对Inchworm、Chrysalis以及Butterfly有各自的参数设定,以及一些特殊情况下的适用参数
4、对于大样本的mRNA的测序数据,现在最新的Trinity已经将对reads进行normalization设置为默认开启状态,所以如果需要关闭的话使用参数–no_normalize_reads,我觉得没必要关闭。。毕竟能节省计算资源嘛
5、除了上述参数外,还有一个参数–min_kmer_cov min count for K-mers to be assembled by, Inchworm (default: 1),可以理解为k-mer 的coverage
如果服务器配置不够,可以将–min_kmer_cov设置为2,这样做会去除unique occurring kmer,从而降低内存消耗,并且减少拼接过程中的噪音。但是,这会导致低表达量的转录本不再被拼接(在拼接过程中直接被舍弃),而且也会导致一些低表达量的转录本变得更加碎片化。因此看情况取舍吧
6、此外–min_glue min number of reads needed to glue two inchworm contigs together. (default: 2),也就是在inchworm步骤中(在contig聚类成component的时候),两个contigs之间连接部位需要至少有多少个reads比对上。默认是2,但是可以人为设置以减少最后拼接出来的gene数目。
7、对于以上两个参数,Trinity作者对此做了一定的解释,具体可见:https://github.com/trinityrnaseq/trinityrnaseq/issues/92
8、查看Trinity的FAQ以及别人提交的报错问题(几乎你的遇到的问题都能在里面找到别人提交并回答了的类似的问题)
https://github.com/trinityrnaseq/trinityrnaseq/wiki/Trinity-FAQ
https://github.com/trinityrnaseq/trinityrnaseq/issues
如果基因组中基因密度大(比如说真菌),一些转录本可能会在UTR区域有重叠。那么为了尽可能降低转录本的错误融合,需要用到--jaccard_clip。对于植物和脊椎动物,就不需要考虑这一步。
#报错std::bad_alloc,是因为RAM不足,可以添加--min_kmer_cov_2
/路径/trinityrnaseq-v2.13.2/Trinity --seqType fq --max_memory 64G --min_kmer_cov 2 --left /路径/transcriptome/SRR16122871_forward_paired.fastq.gz --right /路径/transcriptome/SRR16122871_reverse_paired.fastq.gz --CPU 48 --min_contig_length 1000 --output /路径/transcriptome/SRR16122871trim.trinity
隔了一段时间再用,不知道为啥提示没有jellyfish,重新安装
conda install -c bioconda jellyfish=2.2.10
/路径/trinityrnaseq-v2.13.2/Trinity --seqType fq --max_memory 64G --left /路径/transcriptome/SRR16122871_forward_paired.fastq.gz --right /路径/transcriptome/SRR16122871_reverse_paired.fastq.gz --CPU 48 --min_contig_length 1000 --output /路径/transcriptome/SRR16122871trim.trinity
#又提示没有salmon
conda install salmon
#报错,添加channel
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
conda install salmon
conda update salmon
#运行了一下,又说bowtie2-build --threads unrecognized,打开trinity,删除--threads $CPU,保存就可以正常运行了
/路径/trinityrnaseq-v2.13.2/Trinity --seqType fq --max_memory 64G --left /路径/transcriptome/SRR16122871_forward_paired.fastq.gz --right /路径/transcriptome/SRR16122871_reverse_paired.fastq.gz --CPU 48 --min_contig_length 1000 --output /路径/transcriptome/SRR16122871trim.trinity
然后用busco 评估组装的完整性
conda install -c conda-forge -c bioconda busco=5.3.2 -y
#下载数据库文件并解压
wget https://busco-data.ezlab.org/v4/data/lineages/embryophyta_odb10.2019-11-20.tar.gz
tar xf embryophyta_odb10.2019-11-20.tar.gz
busco -i /路径/组装文件.fasta -l /数据库路径/embryophyta_odb10 -m tran -o 输出文件名
使用Trinity获得基因表达矩阵
#安装trinity
wget https://github.com/trinityrnaseq/trinityrnaseq/releases/download/Trinity-v2.13.2/trinityrnaseq-v2.13.2.FULL.tar.gz
tar -zxvf trinityrnaseq-v2.13.2.FULL.tar.gz
cd trinityrnaseq-v2.13.2
make plugins
#安装RSEM,下载地址[http://deweylab.github.io/RSEM/](http://deweylab.github.io/RSEM/)下载后unzip即可
cd /路径/RSEM-1.3.3
make
make install
#失败的话用下面的
make DESTDIR=/data1/zzs/yyinh/RSEM-1.3.3 install
#安装bowtie2,下载地址http://bowtie-bio.sourceforge.net/bowtie2/index.shtml
make
make install
#安装samtools,下载地址wget -c https://github.com/samtools/samtools/releases/download/1.9/samtools-1.16.1.tar.bz2
tar jxvf samtools-1.16.1.tar.bz2
cd samtools路径
./configure --prefix=/路径/samtools-1.16.1/
make
make install
./samtools --help
vim ~/.bachrc
export PATH=/l路径/samtools-1.16.1/bin:$PATH
source ~/.bashrc
#安装edgeR
R#进入R
install.packages("BiocManager")
BiocManager::install("edgeR")
#报错说没有剩余空间,百度说是tmp空间不足的原因
cd /路径
mkdir /路径/tmp
export TMPDIR=/路径/tmp
source ~/.bashrc
#然后继续安装edgeR,安装完成就可以进行下一步了
#开始定量
#新建samples.txt,先写部位root,然后tab,然后写重复root1,然后写fastq.gz,换行,继续
#单个
/路径/trinity/trinityrnaseq-v2.13.2/util/align_and_estimate_abundance.pl --transcripts /路径/transcriptome/SRR4294733trinity.fasta --seqType fq --single /路径/transcriptome/SRR4294733trim3.fastq --est_method RSEM --aln_method bowtie2 --trinity_mode --prep_reference --output_dir /路径/Trinity_RSEM
#如果报错command not found就打开.pl文件,把相应command全部替换成/路径/command
#下一步构建表达矩阵
/路径/trinity/trinityrnaseq-v2.13.2/util/abundance_estimates_to_matrix.pl --est_method RSEM --gene_trans_map /路径/Trinity_RSEM/SRR4294733trinity.fasta.gene_trans_map --name_sample_by_basedir /路径/Trinity_RSEM/align_and_estimate_abundance/RSEM.isoforms.results#结果在你目前的路径里
#多个
/路径/trinity/trinityrnaseq-v2.13.2/util/align_and_estimate_abundance.pl --transcripts /路径/transcriptome/SRR83165323trim.trinity.Trinity.fasta --seqType fq --samples_file /路径/transcriptome/samples.txt --est_method RSEM --aln_method bowtie2 --trinity_mode --prep_reference --output_dir /路径/transcriptome/RSEMRESULTS --thread_count 12
#然后把每个文件夹即样品的isoforms.results放到quant.file
find * -name '*.isoforms.results' > quant.file
cat quant.file
/路径/trinity/trinityrnaseq-v2.13.2/util/abundance_estimates_to_matrix.pl --est_method RSEM --gene_trans_map /路径/transcriptome/SRR83165323trim.trinity.Trinity.fasta.gene_trans_map --name_sample_by_basedir --quant_files /路径/transcriptome/quant.file
ok啦