NextPolish1.4.1安装与使用--生信工具082

张开发
2026/5/6 0:16:00 15 分钟阅读

分享文章

NextPolish1.4.1安装与使用--生信工具082
NextPolish 简介NextPolish 用于修正由高错误率长读长组装得到的基因组中的碱基错误SNV / 插入缺失。它可以仅使用短读长数据、仅使用长读长数据或同时结合两者进行纠错。软件包含两个核心模块采用分步策略对参考基因组进行碱基纠错。若需要对原始三代测序TGS长读长测序错误率约 10%–15%进行纠错或组装请使用 NextDenovo。NextDenovo v2.5.2 安装与使用--生信工具081-CSDN博客https://github.com/Nextomics/NextPolish #官网01 安装下载点击链接下载或使用以下命令wget https://github.com/Nextomics/NextPolish/releases/latest/download/NextPolish.tgz注意若出现类似错误version GLIBC_2.14 not found或liblzma.so.0: cannot open shared object file请下载兼容版本。依赖Python支持 Python 2 和 3Paralleltask安装pip install paralleltask tar -vxzf NextPolish.tgz cd NextPolish make卸载cd NextPolish make clean测试nextPolish test_data/run.cfg02 常用命令行准备短读长文件列表 sgs.fofnls reads1_R1.fq reads1_R2.fq reads2_R1.fq reads2_R2.fq sgs.fofn新建配置文件 run.cfggenomeinput.genome.fa echo -e task best\ngenome $genome\nsgs_fofn sgs.fofn run.cfg运行nextPolish run.cfg最终校正后基因组序列文件/工作目录/genome.nextpolish.fasta统计文件/工作目录/genome.nextpolish.fasta.stat小提示你也可以使用自己的比对流程仅用 NextPolish 完成基因组纠错。在本地机器运行时这比默认流程更快且校正准确度与默认流程一致。以下为示例使用 bwa 进行比对# 设置输入与参数 round2 threads20 read1reads_R1.fastq.gz read2reads_R2.fastq.gz inputinput.genome.fa for ((i1; i${round};i)); do # 第一步 # 构建基因组索引并比对 bwa index ${input}; bwa mem -t ${threads} ${input} ${read1} ${read2} \ | samtools view --threads 3 -F 0x4 -b - \ | samtools fixmate -m --threads 3 - - \ | samtools sort -m 2g --threads 5 - \ | samtools markdup --threads 5 -r - sgs.sort.bam # 建立 BAM 与基因组索引 samtools index - ${threads} sgs.sort.bam; samtools faidx ${input}; # 基因组纠错 python NextPolish/lib/nextpolish1.py -g ${input} -t 1 -p ${threads} -s sgs.sort.bam genome.polishtemp.fa; inputgenome.polishtemp.fa; # 第二步 # 构建基因组索引并比对 bwa index ${input}; bwa mem -t ${threads} ${input} ${read1} ${read2} \ | samtools view --threads 3 -F 0x4 -b - \ | samtools fixmate -m --threads 3 - - \ | samtools sort -m 2g --threads 5 - \ | samtools markdup --threads 5 -r - sgs.sort.bam # 建立 BAM 与基因组索引 samtools index - ${threads} sgs.sort.bam; samtools faidx ${input}; # 基因组纠错 python NextPolish/lib/nextpolish1.py -g ${input} -t 2 -p ${threads} -s sgs.sort.bam genome.nextpolish.fa; inputgenome.nextpolish.fa; done; # 最终校正后基因组文件genome.nextpolish.fa注意事项建议先用长读长对原始基因组进行纠错设置 task 以 “5” 开头并配置 lgs_fofn或使用 racon再用短读长纠错。这可以避免在某些高错误率区域出现短读长错误比对的问题尤其对于未经过一致性矫正的组装结果如 miniasm 组装更为重要。03 NextPolish 参数详解NextPolish 至少需要一个组装序列文件参数genome和一个测序读段文件列表参数sgs_fofn /lgs_fofn/hifi_fofn作为输入。软件支持 gzip 压缩的 FASTA、FASTQ 格式所有运行参数通过配置文件传入。输入设置基因组文件genome /path/to/need_to_be_polished_assembly_file测序读段文件列表一行一个文件双端数据需交错排列ls reads1_R1.fq reads1_R2.fq reads2_R1.fq.gz reads2_R2.fq.gz ... sgs.fofn配置文件格式配置文件为纯文本以keyvalue形式设置参数。典型配置如下软件内置模板doc/run.cfg[General] job_type local job_prefix nextPolish task best rewrite yes deltmp yes rerun 3 parallel_jobs 6 multithread_jobs 5 genome ./raw.genome.fasta genome_size auto workdir ./01_rundir polish_options -p {multithread_jobs} [sgs_option] # 可选 sgs_fofn ./sgs.fofn sgs_options -max_depth 100 -bwa [lgs_option] # 可选 lgs_fofn ./lgs.fofn lgs_options -min_read_len 1k -max_depth 100 lgs_minimap2_options -x map-ont [hifi_option] # 可选 hifi_fofn ./hifi.fofn hifi_options -min_read_len 1k -max_depth 100 hifi_minimap2_options -x asm20输出文件genome.nextpolish.fasta校正后的基因组序列FASTA 格式。序列标题包含原始 ID 和长度小写字母表示校正后低质量碱基通常由杂合性导致。genome.nextpolish.fasta.stat校正后基因组的基础统计信息文件。参数详解全局参数Generaljob_type sge任务运行模式local /sge/pbs 等默认sgejob_prefix nextPolish任务名称前缀默认nextPolishtask best运行策略all/default/best/ 1 / 2 / 5 / 12 / 1212 等1、2短读长校正的不同算法模块5长读长校正模块all [5]1234default [5]12best [55]1212默认bestrewrite no是否覆盖已存在目录yes /no默认nodeltmp yes是否删除中间临时文件默认yesrerun 3对未完成任务自动重试次数0 表示不重试默认3parallel_jobs 6并行运行的任务数默认6multithread_jobs 5单个任务使用的线程数默认5submit auto提交任务命令auto 由 Paralleltask 自动设置kill auto终止任务命令auto 由 Paralleltask 自动设置check_alive auto检查任务状态命令auto 由 Paralleltask 自动设置job_id_regex auto解析任务 ID 的正则表达式auto 由 Paralleltask 自动设置use_drmaa no是否使用 DRMAA 提交和管理任务genome genome.fa待校正的基因组序列必填genome_size auto基因组大小auto 表示从输入基因组自动计算默认autoworkdir 01_rundir运行工作目录默认./polish_options -p {multithread_jobs}校正核心参数-p校正使用的进程数-u输出全部大写序列默认关闭-debug将校正碱基细节输出至 stderr仅对短读长校正有用默认关闭短读长参数sgs_optionsgs_fofn ./sgs.fofn短读长文件列表一行一个文件双端交错排列sgs_options -max_depth 100 -bwa-N不过滤包含 N 碱基的 reads / 双端对-use_duplicate_reads使用重复的双端 reads默认关闭-unpaired输入为非成对 reads默认关闭-max_depth校正时使用的最大测序深度默认100-bwa使用 bwa 比对默认-minimap2使用 minimap2 比对速度远快于 bwa普通长读长参数lgs_optionlgs_fofn ./lgs.fofn长读长文件列表一行一个文件lgs_options -min_read_len 1k -max_depth 100-min_read_len过滤短于该值的 reads默认1k-max_read_len过滤长于该值的 reads0 表示不限制默认0-max_depth校正使用的最大深度0 表示不限制默认100lgs_minimap2_options -x map-pb -t {multithread_jobs}minimap2 比对参数用于设置 PacBio / ONT 比对模式必填HiFi 读长参数hifi_optionhifi_fofn ./hifi.fofnHiFi 读长文件列表一行一个文件hifi_options -min_read_len 1k -max_depth 100-min_read_len过滤短于该值的 reads默认1k-max_read_len过滤超长 reads0 不限制默认0-max_depth校正使用的最大深度默认100hifi_minimap2_options -x map-pb -t {multithread_jobs}minimap2 比对参数用于 HiFi reads 比对必填04 引用Hu, Jiang, et al. “NextPolish: a fast and efficient genome polishing tool for long read assembly.” Bioinformatics (Oxford, England) (2019).

更多文章