SV鉴定软件--smartie-sv和BayesTyper的使用

  • smartie-sv的安装
    • 1. smartie-sv的安装,需要依赖htslib和blasr
    • 2. hstlib的安装
    • 3. blasr的安装
    • 4. smartie-sv的配置
    • 5. smartie-sv的使用
    • 6. 运行结果
  • bayesTyper的安装
    • 1. bayesTyper安装
    • 2. Platypus的安装
    • 3. manta的安装:
    • 4. bayesTyper的使用
      • 4.1:Generation of variant candidates(候选变异的生成)
        • 4.1.1 用GATK的HaplotypeCaller模块鉴定候选位点。
        • 4.1.2 用Platypus鉴定小的以及中等的变异
        • 4.1.3 用manta鉴定大的结构变异
        • 4.1.4 多种变异的合并
      • 4.2 Genotyping based on variant candidates(基于候选变异的基因分型)
        • 4.2.1 计算测序数据的 k-mers
        • 4.2.2 鉴定变异的cluster
        • 4.2.3 对cluster进行genotype
        • 4.2.4 利用bcftools对结果进行合并

最近一直在折腾结构变异SV的鉴定,SV的鉴定软件虽然很多,但是在最近的两篇基因组文章里面,主要用的是smartie-sv和bayesTyper,其中smartie-sv主要用于基因组间的比较,也可以用于三代数据的比较;bayesTyper主要用于二代数据的SV鉴定,适用于群体,速度较快。

参考文献:
[1] Genome assembly of a tropical maize inbred line provides insights into structural variation and crop improvement
[2] Eight high-quality genomes reveal pan-genome architecture and ecotype differentiation of Brassica napus

smartie-sv的安装

  • smartie-sv的详细信息在这里.

1. smartie-sv的安装,需要依赖htslib和blasr

$ git clone --recursive https://github.com/zeeev/smartie-sv.git  #获取samrtie-sv
$ cd smartie-sv && make

2. hstlib的安装

$ git clone https://github.com/samtools/htslib.git
$ autoconf
$ ./configure
$ make
$ make install

3. blasr的安装

$ wget https://github.com/PacificBiosciences/blasr/archive/master.zip -O blasr.zip
$ unzip blasr.zip
$ mv blasr-master/ blasr
$ cd blasr
$ make -j 8

4. smartie-sv的配置

smartie-sv需要用到htslib的bgzip、htsfile、tabix,以及blasr的blasr、sawriter,所以我们需要把5个可执行文件链接到smartie-sv的bin文件夹下,以便smartie-sv对其的调用。

$ cd smartie-sv/bin
$ ln -s ../../htslib/bin/bgzip ./
$ ln -s ../../htslib/bin/htsfile ./
$ ln -s ../../htslib/bin/tabix ./
$ ln -s ../../blasr/alignment/bin/blasr ./
$ln -s ../../blasr/alignment/bin/sawriter ./

5. smartie-sv的使用

smartie-sv的使用在官方的README.md有示例,它支持snakename的命令。

$ bin/sawriter target.fasta  #利用sawriter对基因组进行index
# 本地运行时
$ snakemake -s Snakefile -w 50 -p -k -j 20

6. 运行结果

# Snakefile内容,在安装目录"smartie-sv/pipeline/Snakefile"位置,定义call SV等方法,便于流程使用
shell.prefix("source config.sh; set -eo pipefail ; ")configfile: "config.json"def _get_target_files(wildcards):return config["targets"][wildcards.target]def _get_query_files(wildcards):return config["queries"][wildcards.query]rule dummy:input: expand("variants/{target}-{query}.svs.bed", target=config["targets"], query=config["queries"])rule callSVs:message: "Calling SVs"input  : SAM="mappings/{target}-{query}-aligned.sam", TARGET=_get_target_files, PG=config["install"] + "/bin/printgaps"output : "variants/{target}-{query}.svs.bed"shell  : """cat {input.SAM} | {input.PG} {input.TARGET} variants/{wildcards.target}-{wildcards.query}"""rule runBlasr:message: "Aligning query to target"input:   BL=config["install"] + "/bin/blasr", TARGET=_get_target_files, QUERY=_get_query_filesoutput:  "mappings/{target}-{query}-aligned.sam", "unmappings/{target}-{query}-unaligned.fasta"shell:   """{input.BL} -clipping hard -alignContigs -sam -minMapQV 30 -nproc 6 -minPctIdentity 50 -unaligned {output[1]} {input.QUERY} {input.TARGET} -out {output[0]}"""

我们需要修改的只有文件"config.json",主要包含smartie-sv的目录,参考基因组文件和比对基因组文件,以json格式存在。

{"install":"smartie-sv",             #最好写绝对路径
"targets":{"zs11":"Darmor.fa"},
"queries":{"Darmor":"Darmor.fa"},
}

最后生成三个文件夹,mappings、unmappings和variants,sv信息主要在variants文件

其中zs11-Darmor.svs.bed包含SV的信息,以bed格式存在

bayesTyper的安装

  • bayesTyper的详细信息在这里.
  • Platypus的详细信息在这里.
  • Manta的详细信息在这里.

bayesTyper的官网文档推荐使用三种方法鉴定变异(GATK、Platypus和manta),然后利用bayesTyperTools对变异文件进行合并,然后利用bayesTyper的cluster进行cluster,最后利用bayesTyper的genotype进行基因分型。

1. bayesTyper安装

bayesTyper的安装非常简单,安装完成后会在bin目录下生成bayesTyper 和bayesTyperTools两个可执行文件

$ git clone https://github.com/bioinformatics-centre/BayesTyper.git
$ cd BayesTyper && make -j 4

2. Platypus的安装

$ git clone https://github.com/andyrimmer/Platypus.git
$ cd Platypus && make -j 4
# 使用platypus的只需运行bin目录下的Platypus.py
$ python bin/Platypus.py --bamFiles=BAM.bam --refFile=REF.fa --output=variants.vcf

3. manta的安装:

manta采用的是cmake的方式,所以要另外新建一个安装目录,另外manta需采用python 2.7 版本,以及需要Cython模块。安装成功后会在bin目录下生成三个文件,configManta.py、configManta.py.ini和runMantaWorkflowDemo.py,我们主要用的就是configManta.py。

$ git clone https://github.com/Illumina/manta.git
$ make manta_build && cd manta_build
$ ../manta-1.6.0/configure --prefix=`pwd`
$ make -C /public/home/guocc/software/manta_build
$ make -j4 install

4. bayesTyper的使用

在官方文档中,鉴定变异的主要流程分为2大部分:

4.1:Generation of variant candidates(候选变异的生成)

以比对完的bam文件(推荐以bwa的mem)为起始,分为一下几个步骤:

4.1.1 用GATK的HaplotypeCaller模块鉴定候选位点。

4.1.2 用Platypus鉴定小的以及中等的变异

4.1.3 用manta鉴定大的结构变异

4.1.4 多种变异的合并

利用bayesTyperTools的combine功能对以上三种方法的结果进行合并,合并命令为:

$ bayesTyperTools combine -v GATK:<gatk_sample1>.vcf,GATK:<gatk_sample2>.vcf,PLATYPUS:<platypus_sample1>.vcf,PLATYPUS:<platypus_sample2>.vcf,MANTA:<manta_sample1>.vcf,...,prior:<prior>.vcf -o <candiate_variants_prefix> -z
  • 注意这里-v参数后面接的是字符串,为gatk:sample.vcf格式,各个样品间用“,”分隔,参数-z 表示以压缩格式gz输出。
  • bayesTyper的combine格式需要一个参数文件–contigs.txt,里面包含基因组的所有contig信息。格式为##contig=<ID=8,length=146364022>

4.2 Genotyping based on variant candidates(基于候选变异的基因分型)

4.2.1 计算测序数据的 k-mers

  • 这里主要用的KMC3来对比对后的bam文件进行kmer的统计,参数为(-k55 -ci1 -fbam)
  • 计算完kmer后,用bayesTyperTools makeBloom -k <kmc_output_prefix> -p <num_threads>生成bayesTyper需要的前提文件。
  • kmc生成的为<sample_id>.kmc_pre<sample_id>.kmc_suf两个文件,bayesTyperTools makeBloom生成的为<sample_id>.bloomMeta<sample_id>.bloomData两个文件,这里一定要在同一文件下运行,且前缀名一致。

4.2.2 鉴定变异的cluster

运行命令:

$ bayesTyper cluster -v <candiate_variants_prefix>.vcf.gz -s <samples>.tsv -g <ref_build>_canon.fa -d <ref_build>_decoy.fa -p <num_threads>
  • 所有的结果都会按cluster分成很多个unit,存在独立的文件
  • 文件<sample>.tsv包含的信息为<sample_id><sex><kmc_output_prefix>
  • cluster的结果输出在bayestyper_cluster_data目录

4.2.3 对cluster进行genotype

bayesTyper genotype -v bayestyper_unit_<unit_id>/variant_clusters.bin -c bayestyper_cluster_data -s <samples>.tsv -g <ref_build>_canon.fa -d <ref_build>_decoy.fa -o bayestyper_unit_<unit_id>/bayestyper -z -p <num_threads>

4.2.4 利用bcftools对结果进行合并

bcftools concat -O z -o <output_prefix>.vcf.gz bayestyper_unit_1/bayestyper.vcf.gz bayestyper_unit_2/bayestyper.vcf.gz ...

此贴为记录我的爬坑之路,因为之前百度都没有找到任何与这两个软件相关的信息,所以很是头疼。希望能帮到大家,供大家参考。
以上就是全部步骤,最后两步还没跑通,等跑通后再做分享。


结构变异SV的鉴定--smartie-sv与bayestyper相关推荐

  1. 基于全基因组测序数据鉴定结构变异的四大类方法总结

    不同类型的基因组变异示意图(图片来源:labspaces) 上次给大家总结介绍了基因组单核苷酸多态性(single nucleotide polymorphism,SNP)的鉴定方法,今天给大家介绍结 ...

  2. NC|王军/宋默识结合三代测序解析肠道菌群结构变异和功能

    期刊:Nature Communications 链接:https://doi.org/10.1038/s41467-022-30857-9 - 研究背景 - 测序技术的不断进步是生命科学发展的重要原 ...

  3. 结构变异( SV )分析介绍

    结构变异( SV )分析 基因组结构性变异(Structure Variantions,简称SVs)通常指基因组上大长度的序列变化和位置关系变化.基因组结构性变异类型很多,包括长度在50bp以上的长片 ...

  4. breakdancer检测结构变异

    breakdancer 来啦@-@,今天给大家分享一下breakdancer这个工具. 软件介绍 breakdancer是一款结构变异检测软件,对双端测序数据进行开发,BreakDancer-1.1 ...

  5. Nature子刊|“二代+三代”宏基因组学揭示肠道微生物群的个性化结构变异

    2022年,<Nature communications>期刊发表的"Short- and long-read metagenomics expand individualize ...

  6. 使用LUMPY检测结构变异

    LUMPY是一款基于概率框架检测结构变异(structure variants)的软件, 它根据read-pair, split-read, read-depth和其他先验知识寻找基因组上可能的结构变 ...

  7. dbvar:染色体结构变异数据库

    欢迎关注"生信修炼手册"! 染色体结构变异structural variation(SV), 被定义为1kb以上范围的DNA结构变化,通常包括缺失,重复,倒位,易位,当然也包含拷贝 ...

  8. DGVa:染色体结构变异数据库

    欢迎关注"生信修炼手册"! DGVa是一个来自EBI的染色体结构变异数据库,通过文献整理和科研人员提交两种方式,存储了多个物种的染色体结构变异信息,网址如下 https://www ...

  9. 检测结构变异——Manta的使用方式简介(生信)

    Manta 的使用方式简介 一 Manta简介 1.1 原理简介 1.1.1 **Build breakend association graph** 1.1.2 **Analyze graph ed ...

最新文章

  1. 重新开始 2011/11/25
  2. 5款非常好用的前端在线编辑器推荐
  3. JS报错:require is not defined
  4. 简单理解Tomasulo算法与重加载缓冲区
  5. 为什么至今为止有些人的电脑系统还在使用XP?
  6. lms自适应滤波器matlab_自适应回声消除器简介
  7. vi/vim使用进阶: 在VIM中使用GDB调试 – 使用vimgdb
  8. InfluxDB学习之InfluxDB常用函数(三)变换类函数
  9. 《Java核心技术 卷1 基础知识 原书第10版》
  10. EasyUI前端框架
  11. 教育类产品 竞品分析
  12. comsol 5.3 matlab,COMSOL5.3在Linux下的安装
  13. Ethereum账户私钥管理之导出、导出keystore 文件
  14. Angular Material 学习笔记 Chips
  15. Hadoop是什么?(处理大数据存储和分析的基础架构)
  16. CocosCreator特效系列之素描效果
  17. Greenplum简介
  18. JDK11 下载与安装、环境配置(全网最详情,值得收藏)
  19. 隆云通空气温湿、CO2、PM2.5、光照五参数传感器
  20. Use Beamer

热门文章

  1. 语雀可以导出html吗,Confluence 迁移到语雀
  2. vue + vuex 实现评论和回复
  3. 常见的几种手机操作系统
  4. Andwobble破解
  5. 19c 单实例打补丁
  6. 前端页面中根据链接随机生成二维码
  7. tab weui 页面切换_weui 多网页切换效果分析
  8. 多生成树协议,冗余备份,负载均衡
  9. Kali学习笔记32:Maltego、Exiftool
  10. BUCTOJ Contest1001 - 邀请赛20180814 问题 F: Poker