[BioC] SOLVED Error in normalize.quantiles.robust
DAVID ARTETA GARCIA
darteta001 at ikasle.ehu.es
Wed Jul 2 18:15:46 CEST 2008
Thanks Ben and rest
setting the storage mode to "double" solved the problem.
I didn´t know there was a difference between a "12.73" and a "12". All
the values in my data.frame were non-decimals. Guess is my lack of
programming knowledge. I will look into that.
Best,
David
DAVID ARTETA GARCIA <darteta001 at ikasle.ehu.es> ha escrito:
> Hi James,
>
> row.names is an argument indeed but it doesn´t seem to be the
> problem either; I still get the same error:
>
>> xxx <- read.table("mydata.txt", sep = "\t",
>> header=TRUE,row.names=1, colClasses="numeric")
> Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
> scan() expected 'a real', got 'A0001'
>
> I have found out that for normalize.quantiles.robust() this works fine:
>
> aaa <- matrix(rnorm(100),ncol=5)
> colnames(aaa) <-c("aa","bb","cc","dd","ee")
> zzz <- normalize.quantiles.robust(aaa)
>
> but this does not:
>
> aaa <- matrix(c(15:114),ncol=5)
> colnames(aaa) <-c("aa","bb","cc","dd","ee")
> zzz <- normalize.quantiles.robust(aaa)
> Error in normalize.quantiles.robust(aaa) :
> REAL() can only be applied to a 'numeric', not a 'integer'
>
>
> This is my session info:
>
>> sessionInfo()
> R version 2.7.0 (2008-04-22)
> i386-pc-mingw32
>
> attached base packages:
> [1] tools stats graphics grDevices utils datasets
> methods base
>
> other attached packages:
> [1] affy_1.18.0 preprocessCore_1.2.0 affyio_1.8.0
> Biobase_2.0.0
>
>
> D.
>
> "James W. MacDonald" <jmacdon at med.umich.edu> ha escrito:
>
>> Hi David,
>>
>> I think you also need a row.names = 1 in your call to read.table. Check
>> ?read.table to make sure - I don't have R on this computer so I can't
>> check myself.
>>
>> Best,
>>
>> Jim
>>
>>
>>
>> DAVID ARTETA GARCIA wrote:
>>> Dear Martin, thanks for your answer. I cannot make your first
>>> suggestion work:
>>>
>>>> xxx <- read.table("mydata.txt", sep = "\t",
>>>> header=TRUE,colClasses="numeric")
>>> Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,
>>> na.strings, :
>>> scan() expected 'a real', got 'A0001'
>>>
>>> I also tried removing the row.names and then I get
>>>
>>>> log.quant.rob.norm <-normalize.quantiles.robust(as.numeric(xxx))
>>> Error in normalize.quantiles.robust(as.numeric(xxx)) :
>>> INTEGER() can only be applied to a 'integer', not a 'NULL'
>>>
>>>
>>> Any more thoughts?
>>>
>>> D.
>>>
>>>
>>>
>>> Martin Morgan <mtmorgan at fhcrc.org> ha escrito:
>>>
>>>> Hi David --
>>>>
>>>> DAVID ARTETA GARCIA <darteta001 at ikasle.ehu.es> writes:
>>>>
>>>>> Dear list, I have a matrix I imported using read.table with raw
>>>>> intensity data for 12 samples and 2300 genes in one colour, as folows:
>>>>>
>>>>>> dim(xxx)
>>>>> [1] 2352 12
>>>>>
>>>>>> head(xxx)
>>>>> 0025 0039 0041 0043 0047 0058 0061 0067 0072 0073 0078 0085
>>>>> A0001 953 509 1669 867 6672 1526 453 397 883 686 382 429
>>>>> A0002 1769 641 1635 1357 4364 1308 552 441 888 1374 493 693
>>>>> A0003 2304 943 2701 1745 4966 1622 807 591 1283 1579 517 870
>>>>> A0004 2185 1235 3992 1866 6462 1556 1004 781 1512 1911 762 906
>>>>> A0005 1842 1008 1904 1434 6331 1155 759 515 1155 1448 510 764
>>>>> A0006 1586 909 2294 641 7729 1367 788 489 1317 714 503 301
>>>>>
>>>>>
>>>>>> class(xxx)
>>>>> [1] "matrix"
>>>>>
>>>>>
>>>>> I am trying to normalize using robust quantiles but I get an error
>>>>> that I don´t understand.
>>>>>
>>>>>> log.quant.rob.norm<-normalize.quantiles.robust(xxx,use.log2=TRUE)
>>>>> Error in normalize.quantiles.robust(xxx, use.log2 = TRUE) :
>>>>> REAL() can only be applied to a 'numeric', not a 'integer'
>>>>>> is.numeric(xxx)
>>>>> [1] TRUE
>>>>
>>>> I guess is.integer(xxx) returns TRUE; integer is a subclass of
>>>> numeric, so they are both TRUE. You'll want to convert your intensity
>>>> measures to numeric (e.g., with the colClasses="numeric" argument to
>>>> whatever read.* function you used, or as.numeric(xxx).
>>>>
>>>> Martin
>>>>
>>>>>
>>>>> Can anyone help me with this?
>>>>>
>>>>> TIA,
>>>>>
>>>>> D.
>>>>>
>>>>> _______________________________________________
>>>>> Bioconductor mailing list
>>>>> Bioconductor at stat.math.ethz.ch
>>>>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>>>>> Search the archives:
>>>>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>>>
>>>> --
>>>> Martin Morgan
>>>> Computational Biology / Fred Hutchinson Cancer Research Center
>>>> 1100 Fairview Ave. N.
>>>> PO Box 19024 Seattle, WA 98109
>>>>
>>>> Location: Arnold Building M2 B169
>>>> Phone: (206) 667-2793
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Bioconductor mailing list
>>> Bioconductor at stat.math.ethz.ch
>>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>>> Search the archives:
>>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
More information about the Bioconductor
mailing list