日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
可以做structure的R語(yǔ)言包LEA是怎樣的

這期內(nèi)容當(dāng)中小編將會(huì)給大家?guī)?lái)有關(guān)可以做structure的R語(yǔ)言包LEA是怎樣的,文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。

目前創(chuàng)新互聯(lián)已為數(shù)千家的企業(yè)提供了網(wǎng)站建設(shè)、域名、虛擬空間、網(wǎng)站托管維護(hù)、企業(yè)網(wǎng)站設(shè)計(jì)、浮梁網(wǎng)站維護(hù)等服務(wù),公司將堅(jiān)持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長(zhǎng),共同發(fā)展。

關(guān)于分群的軟件,之前寫了structure 2.3.4 軟件使用指南,軟件雖然有windows版本,但是操作太麻煩了,也寫了Admixture使用說(shuō)明文檔cookbook,但是只有Linux版本,使用起來(lái)有難度。難道不能使用R語(yǔ)言進(jìn)行structure繪圖么?結(jié)果來(lái)了:LEA!

1. paper

LEA: An R package for landscape and ecological association studies

使用說(shuō)明文檔

不同格式的數(shù)據(jù)使用LEA

2. 軟件介紹

This short tutorial explains how population structure analyses reproducing the results of the widely-used computer program structure can be performed using commands in the R language. The method works for any operating systems, and it does not require the installation
of structure or additional computer programs. The R program allows running population structure inference algorithms, choosing the number of clusters, and showing admixture coefficient bar-plots using a few commands. The methods used by R are fast and accurate, and they
are free of standard population genetic equilibrium hypotheses. In addition, these methods allow their users to play with a large panel of graphical functions for displaying pie-charts and interpolated admixture coefficients on geographic maps.

劃重點(diǎn):

  • 可以在R語(yǔ)言中實(shí)現(xiàn)軟件Structure的功能

  • 可以做類似admixture的圖

  • 簡(jiǎn)單操作, 幾個(gè)命令實(shí)現(xiàn)相關(guān)功能

  • C語(yǔ)言開發(fā), 可以處理大數(shù)據(jù)

3. 軟件安裝
install.packages(c("fields","RColorBrewer","mapplots"))
source("http://bioconductor.org/biocLite.R")
biocLite("LEA")

如果安裝不成功, 也可以通過(guò)CRAN把軟件包下載到本地, 進(jìn)行安裝:

install.packages("LEA_1.4.0_tar.gz", repos = NULL, type ="source")

載入兩個(gè)函數(shù), 進(jìn)行格式轉(zhuǎn)化以及可視化:

source("http://membres-timc.imag.fr/Olivier.Francois/Conversion.R")
source("http://membres-timc.imag.fr/Olivier.Francois/POPSutilities.R")
4. 測(cè)試數(shù)據(jù)

plink格式的ped文件, 具體格式參考:plink格式的ped和map文件及轉(zhuǎn)化為012的方法

1 SAMPLE0 0 0 2 2 1 2 3 3 1 1 2 1
2 SAMPLE1 0 0 1 2 2 1 1 3 0 4 1 1
3 SAMPLE2 0 0 2 1 2 2 3 3 1 4 1 1

前六列為:
家系ID
個(gè)體ID
父本
母本
性別
表型值
SNP1-1(SNP1的第一個(gè)位點(diǎn))
SNP1-2(SNP的第二個(gè)位點(diǎn))

測(cè)試數(shù)據(jù)采用admixture的示例數(shù)據(jù), 使用plink將其轉(zhuǎn)化為ped文件

library(LEA)
# 結(jié)果會(huì)生成test.geno文件的數(shù)據(jù).
output = ped2lfmm("test.ped")
# 使用LEA進(jìn)行structure進(jìn)行分析
library(LEA)
obj.snmf = snmf("test.geno", K = 3, alpha = 100, project = "new")
qmatrix = Q(obj.snmf, K = 3)
head(qmatrix)
barplot(t(qmatrix), col = rainbow(3), border = NA, space = 0,
       xlab = "Individuals", ylab = "Admixture coefficients")

可以做structure的R語(yǔ)言包LEA是怎樣的

對(duì)比admixture的結(jié)果

# 對(duì)比admixture結(jié)果
qad = read.table("test.3.Q")
head(qad)
barplot(t(qad), col = rainbow(3), border = NA, space = 0,
       xlab = "Individuals", ylab = "Admixture coefficients")

可以做structure的R語(yǔ)言包LEA是怎樣的

5. 使用snmf選擇最優(yōu)K值
# 繪制折線圖, 選擇最優(yōu)K值.
plot(project, col = "blue", pch = 19, cex = 1.2)

可以做structure的R語(yǔ)言包LEA是怎樣的
可以看出, K=3時(shí), 最小, 因此選擇K=3.

上述就是小編為大家分享的可以做structure的R語(yǔ)言包LEA是怎樣的了,如果剛好有類似的疑惑,不妨參照上述分析進(jìn)行理解。如果想知道更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。


網(wǎng)站標(biāo)題:可以做structure的R語(yǔ)言包LEA是怎樣的
文章來(lái)源:http://www.dlmjj.cn/article/ppjjpe.html