遺傳圖譜的實(shí)現(xiàn)(R包)——LinkageMapView

使用devtools下載linkagemapview包

install.packages("devtools")
library(devtools)
devtools:: install_github("louellette/LinkageMapView",build_vignettes=TRUE)

載入

library(LinkageMapView)

數(shù)據(jù)類型類型介紹

mapthis

主要的文件類型(必須的),至少為三列,第一列為群組,第二列為位置,第三列為標(biāo)記名稱,同樣你也可以在第四列加上顏色的標(biāo)簽

group position    locus
2170LG3    0.000 BSSR-094
2170LG3    7.039   ESSR86
2170LG3   11.123      F3H
2170LG3   11.123     FLS1
2170LG3   13.079   ESNP32
2170LG3   13.079   ESNP31

conndf

這個(gè)是你要在染色體之間劃線的文件(非必須),分為四列,第一列為劃線開始的群組,第二列為開始群組中標(biāo)記的名稱,第三列為劃線結(jié)束的群組,第四列為結(jié)束群組中標(biāo)記的名稱

fromchr fromlocus tochr tolocus
2170LG3 BSSR-094  70349LG3  K1562
2170LG3 K0593  70349LG3  K1323
70349LG3  K1562 10117LG3  ESSR-087
70349LG3  K1323 10117LG3  P1

markerformatlist

這個(gè)文件是要對(duì)一些標(biāo)記進(jìn)行特殊的處理(非必須),如加顏色,斜體等,這個(gè)文件時(shí)list,標(biāo)記的名稱為必須的,顏色,標(biāo)簽和字體是非必須的

locus
col
cex
font

qtldf

這個(gè)好像是在圖中標(biāo)記出你的qtl的,是個(gè)data.fram

chr qtl so si  ei ei  col
70349LG3  RTPE-Q1 36.6  37  37  38  red

sectcoldf

這個(gè)沒有用過

上面提到的這些文件格式,都可以自己先創(chuàng)建好,然后倒入到R中去

幾個(gè)重要參數(shù)的使用說明

autoconnadj:染色體中名字一樣的標(biāo)記是否使用線連接起來,默認(rèn)是TRUE
posonleft:正常的圖中(默認(rèn)是TRUE),位置是在染色體的左邊的,如果改為FALSE,就會(huì)把位置畫在右邊,同樣,標(biāo)記的名稱在另一邊
revthese:后面接的是群組的名稱,這個(gè)參數(shù)可以把這個(gè)群組的順序倒過來
ruler:默認(rèn)是FALSE,如果改為TRUE,那么圖中就不會(huì)標(biāo)出位置的信息
showonly:只顯示這些標(biāo)記的名稱
dupnbr:當(dāng)一個(gè)位置的標(biāo)記比較多時(shí),將默認(rèn)參數(shù)FALSE改為TRUE,可以只顯示一個(gè)標(biāo)記的名稱

還有好多參數(shù),那些參數(shù)大多是對(duì)圖形的一些修改,以及對(duì)pdf的修改
################現(xiàn)在開始練習(xí)#######################

這個(gè)包主要有一個(gè)函數(shù)——lmv.linkage.plot

#這個(gè)包帶的練習(xí)的數(shù)據(jù)
data(carrot)
head(carrot)

練習(xí)1

lmv.linkage.plot(carrot,outfile = "carrot1.pdf")
lmv.linkage.plot(carrot,outfile = "carrot2.pdf",revthese = "70349LG3")
lmv.linkage.plot(carrot,outfile = "carrot3.pdf",autoconnadj = FALSE)
lmv.linkage.plot(carrot,outfile = "carrot4.pdf",posonleft = FALSE, mapthese = c("10117LG3"))
lmv.linkage.plot(carrot,outfile = "carrot5.pdf",mapthese = c("10117LG3"))
lmv.linkage.plot(carrot,outfile = "carrot6.pdf",ruler = TRUE)

練習(xí)2

#使用qtl包中的數(shù)據(jù),和carrot實(shí)際上效果一樣
library(qtl)
data(hyper)
lmv.linkage.plot(hyper,"carrot7.pdf",mapthese=c(1,4,6,15),
                 lcol="green",
                 lcex=2,
                 lfont=2,
                 rcol="red",
                 rcex=2,rfont=3,
                 showonly=c("D1Mit123","D4Mit80","D6Mit135","D15Mit156"))
lmv.linkage.plot(hyper,"carrot8.pdf",mapthese=c(1,4,6,15),
                 col.lgtitle = "blue",
                 cex.lgtitle=2,
                 col.main = "red",
                 main="Overall Title for the Output Map")

練習(xí)3

#make a df to pass qtl info
qtldf <- data.frame(chr = character(), 
                    qtl = character(), 
                    so = numeric(), 
                    si = numeric(), 
                    ei = numeric(), 
                    eo = numeric(),
                    col = character(),
                    stringsAsFactors = FALSE)
qtldf <- rbind(qtldf, data.frame(chr = "70349LG3", 
                                 qtl = "RTPE-Q1", 
                                 so = 36.6, 
                                 si = 37, 
                                 ei = 37, 
                                 eo = 38, 
                                 col="red"))
#make a list to pass label options
flist <- list()
locus <- c("BSSR-094", "K0149", "K0627", "K2161", "ESSR-087", "ESSR-057")
font  <- c(2)   #bold
flist[[1]] <- list(locus = locus, font = font)

locus <- c("F3H", "FLS1")
font  <- c(4)   #bold italic
flist[[2]] <- list(locus = locus, font = font)

locus <- c("P3", "P1", "Raa1")
font  <- c(3)   #italic
col <- c("red")
flist[[3]] <- list(locus = locus, font = font, col = col)

lmv.linkage.plot(carrot, outfile = "carrot9.pdf", 
                 ruler = TRUE,
                 lgtitle = c("2170", "70349", "10117"),
                 maxnbrcolsfordups = 2, 
                 markerformatlist = flist,
                 lg.col = "lightblue1", 
                 pdf.height = 16,
                 pdf.width = 10,
                 revthese = c("70349LG3"), 
                 qtldf=qtldf)

練習(xí)4

qtldf <- data.frame(fromchr = character(), 
                    fromlocus = character(), 
                    tochr = character(),
                    tolocus = character(),
                    stringsAsFactors = FALSE)
qtldf <- rbind(qtldf, data.frame(fromchr = c("2170LG3","2170LG3","70349LG3","70349LG3"),
                                 fromlocus = c("BSSR-094", "P3", "K1562", "K2227"), 
                                 tochr = c("70349LG3", "70349LG3", "10117LG3", "10117LG3"),
                                 tolocus = c("K1562", "K2227", "ESSR-087", "P1")))               
lmv.linkage.plot(carrot,"carrot10.pdf",ruler = TRUE,autoconnadj = F,conndf = qtldf)

練習(xí)5

data(oat)
# draw tickmarks at each cM from 0 to largest position of linkage groups to be drawn
maxpos <- floor(max(oat$Position[oat$Group == "Mrg01" | oat$Group == "Mrg02"]))
at.axis <- seq(0, maxpos)

#put labels on ruler at every 10 cM
axlab <- vector()
for (lab in 0:maxpos) {
  if (!lab %% 10) {
    axlab <- c(axlab, lab)
  }
  else {
    axlab <- c(axlab, NA)
  }
}
lmv.linkage.plot(oat,"oat.pdf",mapthese=c("Mrg01","Mrg02"),denmap=TRUE, cex.axis = 1, at.axis = at.axis, labels.axis = axlab)
carrot1.pdf

carrot2.pdf

carrot3.pdf

carrot4.pdf

carrot5.pdf

carrot6.pdf

carrot7.pdf

carrot8.pdf

carrot9.pdf

carrot10.pdf

oat.png
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容