snippy + iqtree进行SNP分析及进化树绘制

1、使用snippy流程对多个组装的结果进行snp分析
Snippy finds SNPs between a haploid reference genome and your NGS sequence reads. It will find both substitutions (snps) and insertions/deletions (indels). It will use as many CPUs as you can give it on a single computer (tested to 64 cores). It is designed with speed in mind, and produces a consistent set of output files in a single folder. It can then take a set of Snippy results using the same reference and generate a core SNP alignment (and ultimately a phylogenomic tree).

conda install -c bioconda snippy

#input.tab:第一列sampleID,第二列fasta文件所在路径
snippy-multi input.tab --ref Reference.fasta --cpus 16 > run_shell.sh    #ref为fasta或gbk格式
cat run_shell.sh
sh run_shell.sh

image.png

2、使用IQ-TREE对snp进行进化分析

conda install iqtree

#快速bs
iqtree -s core.full.aln -m MFP -bb 1000 -bnni -cmax 15 -redo -nt AUTO
  #-s 输入多序列比对文件
  #-m 其自动测试并选择最优替代模型;.model记录了所有模型的似然信息;最优替代模型的信息会记录 .iqtree中
  #-bb 1000 快速BS法做1000次
  #-bnni 快速bs推荐加上参数-bnni
  #-cmax 长序列可适当增加,默认10
  #-nt 多线程,AUTO自动多线程

3、R语言ggtree绘图

library(ggtree)
library(treeio)
library(ggplot2)
tr = read.newick("core.full.aln.treefile")
 
p1 <- ggtree(tr, size=0.2) + 
      geom_tiplab(size=2, color="grey10") + 
      geom_treescale(fontsize=2, linesize=0.3)
#ggtree中branch.length = "none"将树的最右端对齐
#geom_tiplab(as_ylab=TRUE)  标签右对齐
p1

ggsave("core.full.aln.tree.pdf", width=13, height = 9, units = "cm")

版权声明:
作者:倾城
链接:https://www.techfm.club/p/216386.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>