# 官網(wǎng)說明書:https://github.com/millanek/Dsuite
########## 1 Installation
# 注意操作系統(tǒng)環(huán)境配置:GCC的版本 >=4.9.0 。GCC的安裝與升級,參考:https://www.cnblogs.com/jixiaohua/p/11732225.html
git clone https://github.com/millanek/Dsuite.git
cd Dsuite
make
vi ~/.bashrc
# export PATH=/pub/software/Dsuite/Build:$PATH #你的安裝目錄
source ~/.bashrc
Dsuite -h #查看幫助
########## 2 Input files
#(1)vcf文件,可以包含SNPs和Indels的多等位基因位點,但必須是biallelic。
#(2)個體或種群名錄SETS.txt
# 想用多少用多少個體,如果中途希望取子集研究,只需要把不需要的個體用xxx替代就行。
# 在Dtrios命令中至少要指定一個outgroup。
# 在Dquartets中不要有outgroup,因為這個命令會自動分組,探索所有可能的patterns。
cat?SETS.txt #文件格式如下
Ind1? ? Species1
Ind2? ? Species1
Ind3? ? Species2
Ind4? ? Species2
Ind5? ? Species3
Ind6? ? Outgroup
Ind7? ? Outgroup
Ind8? ? xxx
...? ? ...
IndN? ? Species_n
########## 3 Optional files
#(1)Newick格式的樹。 樹應(yīng)具有與物種/種群名稱相對應(yīng)的葉子標簽。 分支長度可以存在,但不使用。 若要使用Fbranch,樹必須使用Outgroup置根。 例子:
#(Species2,(Species1,(Species3,Species4)));
#(Species2:6.0,(Species1:5.0,(Species3:3.0,Species4:4.0)));
#(2)用于Dinvestigate的test_trios.txt文件。 每行三個種群/物種,以制表符按P1 P2 P3的順序分隔:
Species1? ? Species2? ? Species3
Species1? ? Species4? ? Species2
...? ...? ? ? ? ...
########## 4 Piped VCF input #本案例中沒有用到
# 可以從另一個程序(例如bcftools)將基因型數(shù)據(jù)“輸送”到Dsuite Dtrios或Dsuite Dquartets中,從而允許自定義過濾VCF文件。
# 只需使用stdin關(guān)鍵字代替VCF文件名即可。
# 還必須通過-l選項為Dsuite程序提供已過濾的VCF中的行數(shù)。
# 例如,要在所有樣本中對VCF進行過濾,以使其總最小深度至少為1000,則可以使用以下命令:
NUMLINES=$(bcftools view -i 'INFO/DP>1000' INPUT_FILE.vcf.gz | wc -l)? # to get NUMLINES
bcftools view -i 'INFO/DP>1000' INPUT_FILE.vcf.gz | Dsuite Dtrios -l $NUMLINES stdin SETS.txt
########## 5 Commands (v0.4): ?Dsuite Dtrios
#?Dsuite Dtrios - Calculate the D (ABBA-BABA) and f4-ratio statistics for all possible trios of populations/species
# Usage: Dsuite Dtrios [OPTIONS] INPUT_FILE.vcf SETS.txt
Dsuite Dtrios -t tree.nwk -c snp.flt.vcf SETS.txt?
#?-t ?指定樹結(jié)構(gòu)
# -c 不需要生成用于合并的文件"_combine.txt"和"_combine_stderr.txt"
#?SETS.txt ?為指定的3個類群和Outgroup
###?Dtrios的?Output
(1)?SETS_BBAA.txt #結(jié)果文件,支持BBAA模式,p < 0.01
P1 P2 P3 Dstatistic Z-score p-value f4-ratio BBAA ABBA BABA
Species1 Species2?Species3?0.0363449 3.95771 3.7836e-05 0.0222077 439626 439435 408612
(2)?SETS_Dmin.txt
(3)?SETS_tree.txt #與SETS_BBAA.txt內(nèi)容相同
########## 6 Commands (v0.4): ?Dsuite Dquartets #推薦使用,一次性計算出所有組合的可能性,從中選取合理的部分
#?Calculate the D (ABBA/BABA) and f4-ratio (f_G) statistics for all quartets of species in the dataset (there is no outgroup)
# Usage: Dsuite Dquartets [OPTIONS] INPUT_FILE.vcf SETS.txt
Dsuite Dquartets -t tree.nwk snp.flt.vcf SETS.txt?
#?SETS.txt中沒有outgroup,第二列為各個樣品的物種或分組名,個體名稱與snp.flt.vcf 中一致
# tree.nwk 樹上葉子的名稱為SETS.txt中的物種或分組名
###?Dquartets的?Output
(1)?SETS_quartets_BBAA.txt #結(jié)果文件
cat SETS_quartets_BBAA.txt?
# 查看結(jié)果,結(jié)果會顯示每個組合的P1 P2 P3 P4,the D statistics,Zscore,unadjusted p-values,the f4-ratios,以及BBAA、BABA和ABBA patterns的數(shù)量。
(2)?SETS_quartets_combine.txt? 和 SETS_quartets_combine_stderr.txt ?#用于合并,本案例不需要
(3)?SETS_quartets_Dmin.txt 和?SETS_quartets_quartets_tree.txt??#與SETS_quartets_BBAA.txt中的內(nèi)容一樣
#結(jié)果的進一步解讀和繪圖,待續(xù)。。。