lm.fit incompatible dimensions
3
0
Entering edit mode
maxininfa • 0
@maxininfa-17622
Last seen 6.0 years ago

Hi! I'm trying to follow this guide to analyze this raw ArrayExpress data and I'm stucked really hard at the Identification of DE genes with the "Three groups of samples" example. Personally the data has 4 groups, but it should be the same up to this point.

> f
 [1] tumor   control haemo   ctc    
 [5] tumor   control haemo   ctc    
 [9] tumor   control haemo   ctc    
[13] tumor   control haemo   ctc    
[17] tumor   control haemo   ctc    
[21] tumor   control haemo   ctc    
Levels: tumor control haemo ctc

> design
   tumor control haemo ctc
1      1       0     0   0
2      0       1     0   0
3      0       0     1   0
4      0       0     0   1
5      1       0     0   0
6      0       1     0   0
7      0       0     1   0
8      0       0     0   1
9      1       0     0   0
10     0       1     0   0
11     0       0     1   0
12     0       0     0   1
13     1       0     0   0
14     0       1     0   0
15     0       0     1   0
16     0       0     0   1
17     1       0     0   0
18     0       1     0   0
19     0       0     1   0
20     0       0     0   1
21     1       0     0   0
22     0       1     0   0
23     0       0     1   0
24     0       0     0   1
attr(,"assign")
[1] 1 1 1 1
attr(,"contrasts")
attr(,"contrasts")$f
[1] "contr.treatment"

> data.rma
ExpressionSet (storageMode: lockedEnvironment)
assayData: 54675 features, 24 samples 
  element names: exprs 
protocolData
  rowNames: GSM463723.CEL GSM463724.CEL
    ... GSM463746.CEL (24 total)
  varLabels: exprs dates
  varMetadata: labelDescription channel
phenoData
  rowNames: GSM463723.CEL GSM463724.CEL
    ... GSM463746.CEL (24 total)
  varLabels: index
  varMetadata: labelDescription channel
featureData: none
experimentData: use 'experimentData(object)'
Annotation: pd.hg.u133.plus.2

> dim(data.rma)
Features  Samples 
   54675       24 
> dim(design)
[1] 24  4

> data.fit = lm.fit(data.rma, design)
Error in lm.fit(data.rma, design) : incompatible dimensions
> data.fit = lm.fit(design, data.rma)
Error in lm.fit(design, data.rma) : incompatible dimensions

I tried switching the order since the lm.fit description has the design as first imput, despite being the opposite on this guide. I don't understand why I'm getting this error given the respective dim() outputs.

> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.1 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
 [1] LC_CTYPE=en_US.UTF-8      
 [2] LC_NUMERIC=C              
 [3] LC_TIME=es_AR.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=es_AR.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=es_AR.UTF-8      
 [8] LC_NAME=C                 
 [9] LC_ADDRESS=C              
[10] LC_TELEPHONE=C            
[11] LC_MEASUREMENT=es_AR.UTF-8
[12] LC_IDENTIFICATION=C       
attached base packages:
[1] stats4    parallel  stats     graphics 
[5] grDevices utils     datasets  methods  
[9] base     
other attached packages:
 [1] pd.hg.u133.plus.2_3.12.0
 [2] DBI_1.0.0               
 [3] RSQLite_2.1.1           
 [4] oligo_1.46.0            
 [5] Biostrings_2.50.2       
 [6] XVector_0.22.0          
 [7] IRanges_2.16.0          
 [8] S4Vectors_0.20.1        
 [9] Biobase_2.42.0          
[10] oligoClasses_1.44.0     
[11] BiocGenerics_0.28.0     
[12] BiocManager_1.30.4      
loaded via a namespace (and not attached):
 [1] Rcpp_1.0.0                 
 [2] pillar_1.3.1               
 [3] plyr_1.8.4                 
 [4] compiler_3.5.2             
 [5] GenomeInfoDb_1.18.1        
 [6] bitops_1.0-6               
 [7] iterators_1.0.10           
 [8] tools_3.5.2                
 [9] zlibbioc_1.28.0            
[10] digest_0.6.18              
[11] bit_1.1-14                 
[12] tibble_2.0.0               
[13] gtable_0.2.0               
[14] memoise_1.1.0              
[15] preprocessCore_1.44.0      
[16] lattice_0.20-38            
[17] ff_2.2-14                  
[18] rlang_0.3.1                
[19] pkgconfig_2.0.2            
[20] Matrix_1.2-15              
[21] foreach_1.4.4              
[22] DelayedArray_0.8.0         
[23] GenomeInfoDbData_1.2.0     
[24] affxparser_1.54.0          
[25] bit64_0.9-7                
[26] grid_3.5.2                 
[27] BiocParallel_1.16.5        
[28] ggplot2_3.1.0              
[29] blob_1.1.1                 
[30] scales_1.0.0               
[31] codetools_0.2-16           
[32] matrixStats_0.54.0         
[33] GenomicRanges_1.34.0       
[34] splines_3.5.2              
[35] SummarizedExperiment_1.12.0
[36] colorspace_1.3-2           
[37] KernSmooth_2.23-15         
[38] lazyeval_0.2.1             
[39] munsell_0.5.0              
[40] RCurl_1.95-4.11            
[41] crayon_1.3.4               
[42] affyio_1.52.0

Thanks for your time!

oligo arrayexpress limma • 3.5k views
ADD COMMENT
3
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States

The function you want to use is lmFit, not lm.fit.

ADD COMMENT
0
Entering edit mode

OMG, I feel so stupid now xD Thanks!!!

ADD REPLY

Login before adding your answer.

Traffic: 534 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6