2014-04-17 4 views
0

나는 35 개의 라인 (마이크로 어레이에서) 사이에 차별적으로 발현 된 유전자를 찾아야한다. 30 줄의 이름은 RAL로 시작하고 5 줄은 ZI로 시작합니다. 나는 30 개의 RAL 라인과 5 개의 ZI 라인을 대비시키고 싶다. 150을 모두 수동으로 입력하고 싶지 않으므로 makeContrast를 사용하고 싶습니다.make 두 개의 서로 다른 데이터 세트 간의 대조

dput(sampletype) 

structure(c(1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 
5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L, 8L, 8L, 8L, 9L, 9L, 9L, 10L, 
10L, 10L, 11L, 11L, 11L, 12L, 12L, 12L, 13L, 13L, 13L, 14L, 14L, 
14L, 15L, 15L, 15L, 16L, 16L, 16L, 17L, 17L, 17L, 18L, 18L, 18L, 
19L, 19L, 19L, 20L, 20L, 20L, 21L, 21L, 21L, 22L, 22L, 22L, 23L, 
23L, 23L, 24L, 24L, 24L, 25L, 25L, 25L, 26L, 26L, 26L, 27L, 27L, 
27L, 28L, 28L, 28L, 29L, 29L, 29L, 30L, 30L, 30L, 31L, 31L, 32L, 
32L, 32L, 33L, 33L, 33L, 34L, 34L, 34L, 35L, 35L, 35L), .Label = c("RAL307", 
"RAL820", "RAL705", "RAL765", "RAL852", "RAL799", "RAL301", "RAL427", 
"RAL437", "RAL315", "RAL357", "RAL304", "RAL391", "RAL313", "RAL486", 
"RAL380", "RAL859", "RAL786", "RAL399", "RAL358", "RAL360", "RAL517", 
"RAL639", "RAL732", "RAL379", "RAL555", "RAL324", "RAL774", "RAL42", 
"RAL181", "ZI50N", "ZI186N", "ZI357N", "ZI31N", "ZI197N"), class = "factor") 

design.matrix <- model.matrix(~ 0 + sample types) 

가 어떻게 같은 "RAL517-ZI50", "RAL852-ZI50", "RAL517-ZI42", "RAL852-ZI42"로 대비를 얻을 수 있습니다 :

내 데이터는이 무엇입니까?

어쨌든 내가 할 수 있습니까?

이 내 sessionInfo()에서 다음과 같습니다

> sessionInfo() 
R version 3.0.2 (2013-09-25) 
Platform: x86_64-apple-darwin10.8.0 (64-bit) 

locale: 
[1] C 

attached base packages: 
[1] parallel stats  graphics grDevices utils  datasets methods base  

other attached packages: 
[1] gplots_2.12.1  reshape2_1.2.2  ggplot2_0.9.3.1 affy_1.38.1  vsn_3.28.0   Biobase_2.20.1  
[7] BiocGenerics_0.6.0 limma_3.16.8  

loaded via a namespace (and not attached): 
[1] BiocInstaller_1.10.4 KernSmooth_2.23-10 MASS_7.3-29   RColorBrewer_1.0-5 affyio_1.28.0   
[6] bitops_1.0-6   caTools_1.14   colorspace_1.2-4  dichromat_2.0-0  digest_0.6.3   
[11] gdata_2.13.2   grid_3.0.2   gtable_0.1.2   gtools_3.1.0   labeling_0.2   
[16] lattice_0.20-23  munsell_0.4.2   plyr_1.8    preprocessCore_1.22.0 proto_0.3-10   
[21] scales_0.2.3   stringr_0.6.2   tools_3.0.2   zlibbioc_1.6.0  

감사

답변

1

당신은 내가 당신이 Bioconductor의 limma 패키지의 사용자 설명서를 읽어 제안 두 클래스 사이의 클래스 비교의 문제를 가지고, 이것은 차별적으로 발현 된 유전자의 확인을위한 대중적인 패키지이다 (http://www.bioconductor.org/packages/release/bioc/vignettes/limma/inst/doc/usersguide.pdf). 단색 마이크로 어레이로 작업하는 경우 섹션 9.2에 초점을 맞출 수 있습니다. 그런데

, 당신은 비교를 수행하는 2 단계의 요인을 만들 수 있습니다
# build the design matrix 

library(limma) 

yourfactor <- c(rep("RAL", 30),rep("ZI", 5)) 
design <- model.matrix(~ 0 + yourfactor) 
colnames(design) <- gsub("yourfactor", "", colnames(design)) # to simplify the colnames of design 

# perform the comparison 


fit <- lmFit(data, design) # data is your gene expression matrix 
contrast.matrix <- makeContrasts(RAL-ZI, levels=design) 
fit2 <- contrasts.fit(fit, contrast.matrix) 
fit2 <- eBayes(fit2) 

# summarize the results of the linear model 
results <- topTable(fit2, number=nrow(data), adjust.method="BH") 

이 요소의 표현 매트릭스 및 샘플 라벨의 샘플이 동일한 순서로되어 있음을주의하십시오. 이런 종류의 문제를 피하기 위해 유전자 발현 데이터를 조작하는 데 매우 유용한 ExpressionSet 객체 ( http://www.bioconductor.org/packages/release/bioc/html/Biobase.html)를 만드는 것이 좋습니다.

도움이 되었기를 바랍니다.

최고.

matteo

관련 문제