1. 安裝虛擬機(jī)及QIIME1
2. 虛擬機(jī)增強(qiáng)功能及共享文件夾
簡(jiǎn)單,百度都有屑宠,目的在于實(shí)現(xiàn)win系統(tǒng)和linux系統(tǒng)可以自由復(fù)制粘貼困檩、全屏和文件共享
3. 準(zhǔn)備數(shù)據(jù)文件
4. OTU分析
4.1. map文件檢查
validate_mapping_file.py -o vmf-map/ -m map.txt
結(jié)果:No errors or warnings were found in mapping file.
同時(shí)生成一個(gè)vmf-map文件夾
4.2. 序列拼接
overlap大于6bp且錯(cuò)配率小于8%才有可能完成匹配
join_paired_ends.py -f SRR1370913_1.fastq.gz -r SRR1370913_2.fastq.gz -o SRR1370913
join_paired_ends.py -f SRR1370914_1.fastq.gz -r SRR1370914_2.fastq.gz -o SRR1370914
join_paired_ends.py -f SRR1370915_1.fastq.gz -r SRR1370915_2.fastq.gz -o SRR1370915
join_paired_ends.py -f SRR1370920_1.fastq.gz -r SRR1370920_2.fastq.gz -o SRR1370920
生成文件保存在SRR1230913腰埂、SRR1230914飒焦、SRR1230915、SRR1230920文件夾內(nèi)
4.3. 過濾
(1)去除過短序列;(2)N charater序列牺荠;(3)轉(zhuǎn)化為fasta文件
split_libraries_fastq.py -i SRR1370913/fastqjoin.join.fastq,SRR1370914/fastqjoin.join.fastq,SRR1370915/fastqjoin.join.fastq,SRR1370920/fastqjoin.join.fastq --sample_id SRR1370913,SRR1370914,SRR1370915,SRR1370920 -o slout/ -m map.txt -q 19 --barcode_type 'not-barcoded' --phred_offset=33
所有的文件信息保存在seqs.fna文件內(nèi)
4.3.1. log文件
log文件記錄了輸入的文件信息及有效序列數(shù)目等信息(可以整理為一個(gè)質(zhì)控表格)
4.4. 去除嵌合體
嵌合體的去除與否目前仍存在爭(zhēng)議翁巍,如果不需要去除,可直接跳過該步驟休雌。
4.5. OTU分析和注釋
pick_open_reference_otus.py -o otus/ -i slout/seqs.fna -p params.txt
包括以下四步:
4.5.1. 結(jié)果解讀
4.5.2. OTU數(shù)目
# 生成簡(jiǎn)要內(nèi)容
biom summarize-table -i otus/otu_table_mc2_w_tax_no_pynast_failures.biom
# 生成簡(jiǎn)要內(nèi)容并保存
biom summarize-table \
-i otus/otu_table_mc2_w_tax_no_pynast_failures.biom \
-o otu_count.txt
4.5.3. 轉(zhuǎn)化.biom文件為.txt
biom convert -i otus/otu_table_mc2_w_tax_no_pynast_failures.biom -o otus/table.from_biom_w_taxonomy.txt --to-tsv --header-key taxonomy
4.6 Venn圖及熱圖
4.6.1 繪制Venn圖
#install.packages("VennDiagram")
sampleCol=c("SRR1370913","SRR1370914","SRR1370915","SRR1370920")
library(VennDiagram)
rt=read.table("otus/table.from_biom_w_taxonomy.txt",sep="\t",header=T,skip=1,row.names=1,comment.char = "")
list1=list()
for(i in sampleCol){
rt1=rt[rt[,i]!=0,]
print(head(rownames(rt1)))
list1[[i]]=rownames(rt1)
}
venn.diagram(list1,filename="venn.tiff",fill=rainbow(length(sampleCol)))
4.6.2 繪制熱圖
#install.packages("gplots")
lineNum=100
library('gplots')
rt=read.table("otus/table.from_biom_w_taxonomy.txt",sep="\t",header=T,skip=1,row.names=1,comment.char = "")
sampleNum=ncol(rt)-1
rt=rt[,1:sampleNum]
rt1=rt[order(rowSums(rt),decreasing=TRUE),]
rt2=rt1[1:lineNum,]
y=as.matrix(log10(rt2+1))
pdf(file="heatmap.pdf",height=12)
par(oma=c(3,3,3,5))
heatmap.2(y,col='greenred',trace="none",cexCol=1)
dev.off()
5. α多樣性和β多樣性
core_diversity_analyses.py -o cdout/ -i otus/otu_table_mc2_w_tax_no_pynast_failures.biom -m map.txt -t otus/rep_set.tre -e 193760 -p diversityParams.txt
包括四個(gè)小程序:
1.single rarefaction.py------Rarify the OTU table
2.beta diversity.py-------beta多樣性
3.principal coordinates.py------PCoA圖形化
4.alpha diversity.py-------Alpha多樣性
5.make rarefaction plots.py-------稀釋曲線
6.summarize taxa.py------Summarize Taxonomy
7.plot taxa summary.py------Taxa summary plots
其中灶壶,193685通過以下命令獲得:
biom summarize-table -i otus/otu_table_mc2_w_tax_no_pynast_failures.biom
5.1 結(jié)果解讀
6. 系統(tǒng)樹構(gòu)建
系統(tǒng)發(fā)生樹(英文:phylogenetic tree或evolutionary tree)是表明被認(rèn)為具有共同祖先的各物種相互間演化關(guān)系的樹,又被稱為系統(tǒng)發(fā)育樹杈曲、系統(tǒng)演化樹驰凛、系統(tǒng)進(jìn)化樹、種系發(fā)生樹担扑、演化樹恰响、進(jìn)化樹、系統(tǒng)樹涌献。它用來表示系統(tǒng)發(fā)生研究的結(jié)果胚宦,用它描述物種之間的進(jìn)化關(guān)系。
6.1. 主要步驟
1.filter otus from otu table.py------挑選豐度>1‰的OTU燕垃,獲得otu_table_mc2_0.001_fraction.biom文件
filter_otus_from_otu_table.py -i otus/otu_table_mc2_w_tax_no_pynast_failures.biom -o otus/otu_table_mc2_0.001_fraction.biom --min_count_fraction 0.001
2.filter_fasta.py------獲得豐度>1‰OTU的fasta文件枢劝,獲得rep_set_0.001_fraction.fasta文件
filter_fasta.py -f otus/pynast_aligned_seqs/rep_set_aligned_pfiltered.fasta -b otus/otu_table_mc2_0.001_fraction.biom -o otus/rep_set_0.001_fraction.fasta
3.make_phylogeny.py-------構(gòu)建系統(tǒng)樹,獲得rep_set_0.001_fraction.tre文件
make_phylogeny.py -i otus/rep_set_0.001_fraction.fasta -o otus/rep_set_0.001_fraction.tre
4.ggtree.R------系統(tǒng)樹可視化
如果R版本較低利术,可以將otus\table.from_0.001_fraction.txt和otus\rep_set_0.001_fraction.tre復(fù)制到windows下進(jìn)行分析。
#if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
#BiocManager::install()
#BiocManager::install('ggtree')
setwd("C:/Users/DELL/Desktop/tree")
library("ggplot2")
library("ggtree")
library("colorspace")
cls=list()
rt=read.table("table.from_0.001_fraction.txt",sep="\t",header=T,skip=1,row.names=1,comment.char = "")
for(i in 1:nrow(rt)){
otu=rownames(rt[i,])
phylum=strsplit(as.character(rt$taxonomy[i]),"\\; |p\\_\\_")[[1]][3]
cls[[phylum]]=c(cls[[phylum]], otu)
}
phylumNames=names(cls)
phylumNum=length(phylumNames)
tree <- read.tree("rep_set_0.001_fraction.tre")
tree <- groupOTU(tree, cls)
# 這部分代碼有問題低矮,后續(xù)再更改印叁!
pdf(file="circosTree.pdf")
ggtree(tree, layout="fan", ladderize = FALSE, branch.length="none", aes(color=group)) +
scale_color_manual(values=c(rainbow_hcl(phylumNum+1)), breaks=1:phylumNum, labels=phylumNames ) + theme(legend.position="right") +
geom_text(aes(label=paste(" ",gsub("\\d+\\.\\d+|New\\.|Reference|CleanUp\\.","",label),sep=""), angle=angle+90), size=2.2)
dev.off()
pdf(file="heatmapTree.pdf",width=15,height=18)
p <- ggtree(tree, ladderize = FALSE, branch.length="none", aes(color=group)) +
scale_color_manual(values=c(rainbow_hcl(phylumNum+1)), breaks=1:phylumNum, labels=phylumNames ) + theme(legend.position="left") +
geom_text(aes(label=paste(" ",gsub("\\d+\\.\\d+|New\\.|Reference|CleanUp\\.","",label),sep="")), size=2.2)
gplot(p, log(rt[,1:ncol(rt)-1]+1), font.size=4)
dev.off()
5 OTU差異分析
differential_abundance.py -i otus/otu_table_mc2_w_tax_no_pynast_failures.biom -o diff_otus.txt -m map.txt -c SampleType -x normal -y tumor -a DESeq2_nbinom