转自:https://www.jianshu.com/p/ddd1c9a74fde?from=singlemessage
EDTA(Extensive de novo TE Annotator)是一个可以从头注释全基因组中的TE并且评估已有TE库注释优劣的工具包。该工具的主要步骤是过滤掉原始TE中注释错误的,从而注释出全基因组中较高质量的非冗余TE库。工具包中的一些程序的选择只是基于水稻基因组中人工校正的TE库,可能对其他基因组并不是很合适。因此,在其他基因组中使用该工具包时应该特别注意。
作者使用了水稻基因组(TIGR7/MSU7版本)中的一个修正过的TE注释版本(v6.9.5)来进行了测试。
一、安装(更新)
主要有4种方法,可以任选其一。
1. 使用conda快速安装
conda install -c bioconda edta
2. 使用Singularity快速安装(适合在集群使用)
安装
singularity build --sandbox EDTA.sif docker://kapeel/edta
在使用时,有一点需要注意,需要用-B将外部的RepeatMasker的Libraries绑定的Libraries,否则可能会在检查依赖这一步失败。
方法1:这里,我参考的是LoReAN的方法
cd ~
mkdir -p LoReAn && cd LoReAn
wget https://github.com/lfaino/LoReAn/raw/noIPRS/third_party/software/RepeatMasker.Libraries.tar.gz && tar -zxvf RepeatMasker.Libraries.tar.gz
singularity exec \
-B /home/xzg/LoReAn/Libraries/:/opt/conda/share/RepeatMasker/Libraries/ \
/home/xzg/edta.sif /EDTA/EDTA.pl -h
上面的/home/xzg/是我的家目录,需要根据实际情况进行选择
方法2: 使用 @wangshun1121 构建的docker镜像, 他解决了需要-B进行挂载的问题。
singularity build edta.sif docker://registry.cn-hangzhou.aliyuncs.com/wangshun1121/edta
使用
singularity exec {path}/EDTA.sif /EDTA/EDTA.pl --genome genome.fa [other parameters]
{path} is the path you build the EDTA singularity image
3. 使用Docker快速安装(适合root用户)
安装
docker pull kapeel/edta
使用
docker run kapeel/edta --genome genome.fa [other parameters]
4. 使用conda分步安装
conda create -n EDTA
conda activate EDTA
conda config --env --add channels anaconda --add channels conda-forge --add channels bioconda
conda install -n EDTA -y cd-hit repeatmodeler muscle mdust blast java-jdk perl perl-text-soundex multiprocess regex tensorflow=1.14.0 keras=2.2.4 scikit-learn=0.19.0 biopython pandas glob2 python=3.6 tesorter genericrepeatfinder genometools-genometools ltr_retriever ltr_finder
git clone https://github.com/oushujun/EDTA
./EDTA/EDTA.pl
二、输入文件
1. 必须
FASTA格式的基因组文件(序列名不多于15个字符,且为简单字符,如字母,数字或下划线)
2. 可选
- 该物种或相关物种的编码序列(FASTA格式)。该文件有助于去除TE库中的基因序列。
- 该版本基因组组装结果的基因位置文件(BED格式)。TE注释过程中将会过滤该文件中的基因位置信息,从而避免注释错误。
- 该物种修正版的TE库。其中的序列也没必要是全部修正过的TE,部分修正过的也可以使用。
三、输出文件
genome.mod.EDTA.TElib.fa
:非冗余的TE库。如果在输入文件中提供了修正版的TE库,则该文件中也将包含这部分序列。
其他输出文件
-
genome.mod.EDTA.TElib.novel.fa
: 新TE类型. 该文件中包括输入的修正版的TE库中没有的TE序列(需要--curatedlib
参数). -
genome.mod.EDTA.TEanno.gff
: 全基因组TE的注释. 该文件包括结构完整和结构不完整的TE的注释(需要--anno 1
参数). -
genome.mod.EDTA.TEanno.sum
: 对全基因组TE注释的总结(需要--anno 1
参数). -
genome.mod.MAKER.masked
: 低阈值TE的屏蔽.该文件中仅包括长TE(>= 1 kb)序列(需要--anno 1
参数). -
genome.mod.EDTA.TE.fa.stat.redun.sum
: 简单TE的注释偏差(需要--evaluate 1
参数). -
genome.mod.EDTA.TE.fa.stat.nested.sum
:嵌套型TE注释的偏差(需要--evaluate 1
参数). -
genome.mod.EDTA.TE.fa.stat.all.sum
: 注释偏差的概述(需要--evaluate 1
参数).
四、使用方法
详细参数说明
perl EDTA.pl [options]
-genome [File] The genome FASTA
-species [Rice|Maize|others] Specify the species for identification of TIR candidates. Default: others
-step [all|filter|final|anno] Specify which steps you want to run EDTA.
all: run the entire pipeline (default)
filter: start from raw TEs to the end.
final: start from filtered TEs to finalizing the run.
anno: perform whole-genome annotation/analysis after TE library construction.
-overwrite [0|1] If previous results are found, decide to overwrite (1, rerun) or not (0, default).
-cds [File] Provide a FASTA file containing the coding sequence (no introns, UTRs, nor TEs) of this genome or its close relative.
-curatedlib [file] Provided a curated library to keep consistant naming and classification for known TEs.
All TEs in this file will be trusted 100%, so please ONLY provide MANUALLY CURATED ones here.
This option is not mandatory. It's totally OK if no file is provided (default).
-sensitive [0|1] Use RepeatModeler to identify remaining TEs (1) or not (0, default).
This step is very slow and MAY help to recover some TEs.
-anno [0|1] Perform (1) or not perform (0, default) whole-genome TE annotation after TE library construction.
-evaluate [0|1] Evaluate (1) classification consistency of the TE annotation. (-anno 1 required). Default: 0.
This step is slow and does not affect the annotation result.
-exclude [File] Exclude bed format regions from TE annotation. Default: undef. (-anno 1 required).
-threads|-t [int] Number of theads to run this script (default: 4)
-help|-h Display this help info
1. 生成基因组中的原始的TE库
对于不同的TE类型,可以分别指定-type ltr|tir|mite|helitron
来运行,如果是想要所有类型的TE,直接指定-type all
就可以。
这里使用示例数据水稻基因组来进行测试,下载位置rice genome 。
perl /raid8/cuixb/tools/biosoft/EDTA/EDTA_raw.pl -genome rice_genome.fasta -species Rice -threads 6
2. 完成其他分析
这里可以通过指定-overwrite 0
来使软件自动识别文件夹下的已有分析结果。
perl EDTA.pl -overwrite 0 -genome rice_genome.fasta -species Rice
对已有的TE库进行评估
如果你已经有了一个TE库,想对该TE库的注释效果与其他方法比较,那么可以进行如下两步分析:
对你的基因组根据已有的TE库进行注释
以水稻为例:
RepeatMasker -pa 36 -q -no_is -norna -nolow -div 40 -lib custom.TE.lib.fasta -cutoff 225 rice_genome.fasta
测试某一TE类型的注释效果
perl lib-test.pl -genome genome.fasta -std genome.stdlib.RM.out -tst genome.testlib.RM.out -cat [options]
-genome [file] FASTA format genome sequence
-std [file] RepeatMasker .out file of the standard library
-tst [file] RepeatMasker .out file of the test library
-cat [string] Testing TE category. Use one of LTR|nonLTR|LINE|SINE|TIR|MITE|Helitron|Total|Classified
-N [0|1] Include Ns in total length of the genome. Defaule: 0 (not include Ns).
-unknown [0|1] Include unknown annotations to the testing category. This should be used when
the test library has no classification and you assume they all belong to the
target category specified by -cat. Default: 0 (not include unknowns)
例如:
perl lib-test.pl -genome rice_genome.fasta -std ./EDTA/database/Rice_MSU7.fasta.std6.9.5.out -tst rice_genome.fasta.test.out -cat LTR
更好的阅读体验可移步这里。
五、常见报错
1. Error: gt is not found in the genometools path !
![image](//upload-images.jianshu.io/upload_images/19589140-142876cfa9b11405.png?imageMogr2/auto-orient/strip|imageView2/2/w/680/format/webp)
找到问题,但搜索genometools时它在EDTA环境中,推测可能是没有执行权限?
chmod u+x .../miniconda3/.../genometools
2. 我在"Identify TIR candidates from scratch"这一步出现下面的报错
what(): terminate called after throwing an instance of 'Resource temporarily unavailable std::system_error'
what(): Resource temporarily unavailable
terminate called after throwing an instance of 'std::system_error'
我对这个报错进行了相近的分析,找到了对应代码,即sh $TIR_Learner -g $genome -s $species -t $threads -l $maxint
. 用实际内容替换变量后,即下面这行代码
sh /EDTA/bin/TIR-Learner2.4/TIR-Learner2.4.sh -g chr.fa -s others -t 20 -l 5000
更具体一点,可以将问题定位到脚本的Module 3, Step 3: Get dataset
genomeFile=/data/xzg_data/1800_assembly/annotation/repeatAnnotation/chr.fa #基因组文件的实际路径
genomeName=TIR-Learner
tir_path=/EDTA/bin/TIR-Learner2.4 # TIR-Learner2.4的路径
t=1
dir=`pwd`
export OMP_NUM_THREADS=1
python3 $tir_path/Module3_New/getDataset.py -g $genomeFile -name $genomeName -p $tir_path -t $t -d $dir"/Module3_New"
将线程数设置为1后,该代码顺利跑通。进一步,我定位getDataset.py
的出问题的地方实际是predict函数。当然接着执行后续的代码,发现改动这一参数并不影响下面代码的运行。
echo "Module 3, Step 4: Check TIR/TSD"
python3 $path/Module3_New/CheckTIRTSD_M3.py -name $genomeName -p $path -t $t -d $dir"/Module3_New"
echo "Module 3, Step 5: Write to Gff"
python3 $path/Module3/WriteToGff_M3.py -name $genomeName -p $path -t $t -d $dir"/Module3_New"
我发现predict函数涉及到了Python的多进程调用,最终在偶然间找到问题真正所在,即Linux系统对用户的资源限制,可以通过ulimit -a
查看。
最终我通过设置ulimit -u 9000
,提高允许运行的总程序数,将问题解决。
参考
- Ou, Shujun & Su, Weijia & Liao, Yi & Chougule, Kapeel & Peterson, Thomas & Jiang, Ning & Hirsch, Candice & Hufford, Matthew. (2019). Benchmarking Transposable Element Annotation Methods for Creation of a Streamlined, Comprehensive Pipeline. 10.1101/657890.
- EDTA Github
- RMblast的问题
- 一个关于fork资源不够的解决过程