1. 安装编译
git clone https://github.com/marbl/SALSA.git
cd SALSA
make -j8
##SALSA2依赖环境: Python 2.7,Networkx version < 1.2,BOOST libraries
##安装
conda create -n py2.7 python=2.7
##激活
conda activate py2.7
2. 文件输入:
三代组装结果: contigs.fasta
Hi-C比对后BAM: alignment.bam
bwa mem -SP5M -t 20 contigs.fasta HICLib_R1.fastq.gz HICLib_R2.fastq.gz \
| samtools view -hF 256 - \
| samtools sort -@ 20 -o alignment.bam -T tmp.ali
samtools index alignment.bam
(可选) GFA文件: contigs_graph.gfa
NOTE: SALSA2从PacBio/ONT的组装结果开始,建议提供记录模棱两可重建位置的GFA文件。Hi-C数据回贴到contig上,contig根据Hi-C的覆盖度分析潜在的组装错误,然后被打断。之后根据GFA和Hi-C信息构建hybrid scaffold graph,最后scaffold根据该graph进行重建。
3. 运行
#1.convert bam to bed file
bamToBed -i alignment.bam > bwa.bam.bed
#2.sort bed file
sort -k 4 bwa.bam.bed > tmp && mv tmp bwa.bam.bed
#3.build length file of contig genome
samtools faidx contigs.fasta
#激活python 2.7环境
conda activate py2.7
/home/user/plants/02.hic_assembly/004.asm_by_SALSA/SALSA/run_pipeline.py -a contigs.fasta -l contigs.fasta.fai -b bwa.bam.bed -e AAGCTT -o scaffolds -m yes
NOTE:
-m yes #
使用Hi-C对输入assembly进行纠错;
-e {Your Enzyme} #
根据实际情况修改,如果是MboI就写-e GATC,HindIII就写-e AAGCTT;
最终的输出结果在-o
指定的目录下,其中scaffolds_FINAL.fasta
和scaffolds_FINAL.agp
是两个最主要的结果,其中scaffolds_iteration_x.p
里的x取决于你的迭代次数。
亲测:使用SALSA基于HIC数据组装后,scaffold N50提高2~3倍。(仅供参考)
SALSA参数:(https://github.com/marbl/SALSA)
usage: run_pipeline.py [-h] -a ASSEMBLY -l LENGTH -b BED [-o OUTPUT]
[-c CUTOFF] [-g GFA] [-e ENZYME] [-i ITER] [-x DUP]
[-s EXP] [-m CLEAN] [-f FILTER] [-p PRNT]
SALSA Iterative Pipeline
optional arguments:
-h, --help show this help message and exit
-a ASSEMBLY, --assembly ASSEMBLY
Path to initial assembly
-l LENGTH, --length LENGTH
Length of contigs at start
-b BED, --bed BED Bed file of alignments sorted by read names
-o OUTPUT, --output OUTPUT
Output directory to put results
-c CUTOFF, --cutoff CUTOFF
Minimum contig length to scaffold, default=1000
-g GFA, --gfa GFA GFA file for assembly
-e ENZYME, --enzyme ENZYME
Restriction Enzyme used for experiment
-i ITER, --iter ITER Number of iterations to run, default = 3
-x DUP, --dup DUP File containing duplicated contig information
-s EXP, --exp EXP Expected Genome size of the assembled genome
-m CLEAN, --clean CLEAN
Set this option to "yes" if you want to find
misassemblies in input assembly
-f FILTER, --filter FILTER
Filter bed file for contigs present in the assembly
-p PRNT, --prnt PRNT Set this option to "yes" if you want to output the
scaffolds sequence and agp file for each iteration
其他参考:SALSA:基于Hi-C辅助组装长读长组装结果_xuzhougeng blog-CSDN博客
敲黑板:SALSA无法得到染色体级别的输出结果,因此得到的结果需要再借助于遗传图谱或者近缘参考基因组或者HIC图谱挂载到染色体级别。
见下一推送的RagTag相关内容。