[BioC] using limma package for paired t-test: Error: (subscript) logical subscript too long

James W. MacDonald jmacdon at med.umich.edu
Tue Jan 17 22:49:23 CET 2012


Hi Viritha,

On 1/17/2012 4:36 PM, viritha k wrote:
> Hi group,
> I am trying to perform paired t-test for 6 samples which are paired one is
> from normal tissue of the subject and the other is tumor tissue of the same
> subject.
> I am following the code as mentioned in the Limma User guide,p.40,8.3
> Paired Samples)
>
> Code:
>> source("http://bioconductor.org/biocLite.R")
>> biocLite("limma")
>> library(limma)
>> targets<-readTargets("targets.txt")
>> head(targets)
>     FileName Pair Treatment
> 1 GSM675890    1         N
> 2 GSM675891    1         T
> 3 GSM675892    2         N
> 4 GSM675893    2         T
> 5 GSM675894    3         N
> 6 GSM675895    3         T
>
>> eset<-as.matrix(read.table("6samples.txt",sep='\t',header=TRUE,colClasses=c(rep('numeric',7)),nrow=133673))
>> head(eset)

At the very least you should add a row.names = 1 to your call to 
read.table(). You want the ID to be the row.names of your matrix, not 
the first column.

Since the dimensions of your matrix don't match the number of rows of 
your design matrix, I would expect a different error,

Error in lm.fit(design, t(M)) : incompatible dimensions

So there might be something else wrong. You don't show the final design 
matrix, so no telling.

Best,

Jim


>   ID_REF GSM675890 GSM675891 GSM675892 GSM675893 GSM675894 GSM675895
> [1,] 2315129  30.32278  20.42571   7.60854  17.15130  14.57533  22.22889
> [2,] 2315145  12.74657   6.30117  11.43528   4.10696   3.12693  10.96096
> [3,] 2315163 175.96267 125.77725  52.19822 102.07567 116.91966 174.41690
> [4,] 2315198   6.57030   1.85541   3.34829   1.13516   0.34278   1.83917
> [5,] 2315353  88.49511  48.77128  50.60524  62.92448  47.10977  45.06430
> [6,] 2315371   2.01707   1.90644 536.07636   2.21359   0.00212   0.43249
>
>> Pair<-factor(targets$Pair)
>> Treat<-factor(targets$Treatment,levels=c("N","T"))
>> design<-model.matrix(~Pair+Treat)
>> fit_pair<-lmFit(eset,design)
> Error: (subscript) logical subscript too long
>
>> sessionInfo()
> R version 2.14.1 (2011-12-22)
> Platform: i386-pc-mingw32/i386 (32-bit)
> locale:
> [1] LC_COLLATE=English_United States.1252
> [2] LC_CTYPE=English_United States.1252
> [3] LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United States.1252
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> other attached packages:
> [1] limma_3.10.1        BiocInstaller_1.2.1
> loaded via a namespace (and not attached):
> [1] tools_2.14.1
> Please suggest as to where is the issue?
> Thanks,
> Viritha
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor

-- 
James W. MacDonald, M.S.
Biostatistician
Douglas Lab
University of Michigan
Department of Human Genetics
5912 Buhl
1241 E. Catherine St.
Ann Arbor MI 48109-5618
734-615-7826

**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues 



More information about the Bioconductor mailing list