[BioC] GenePlotter - chr plots

Sean Davis sdavis2 at mail.nih.gov
Fri Mar 24 16:03:29 CET 2006




On 3/24/06 9:40 AM, "Helen Cattan" <helen.cattan at imm.ox.ac.uk> wrote:

> Hi
> 
>  
> 
> Please could someone let me know what format I need to read a file in to use
> mget. When I try read.table from a .txt file I get the following error but
> it all works fine whenI type in the Ids individually.
> 
>  
> 
>> probeIds <- read.table("mock4hrids.txt")
> 
>> probeIds[1:5,1]
> 
> [1] 206641_at   204805_s_at 218032_at   200800_s_at 201010_s_at
> 
> 1926 Levels: 200004_at 200042_at 200046_at 200049_at 200053_at ...
> 91816_f_at
> 
>> chrObj <- buildChromLocation("hgu133a")
> 
>> cPlot(chrObj)
> 
>> cColor(probeIds, "red", chrObj)

Helen,

 cColor(as.character(probeIds[,1]),"red",chrObj)

May be what you are looking for.  Note that cColor is looking for a vector.
In your code, you passed it a data.frame.  The as.character may not be
needed, depending on whether or not cColor coerces from the factor (note the
"1926 levels" stuff above, signifying that the probeIds are stored in the
data.frame as a factor).


> Error in mget(x, envir, mode, ifnotfound, inherits) :
> 
>         invalid first argument
> 
>> probeIds2 <-
> c("206641_at","204805_s_at","218032_at","200800_s_at","201010_s_at")
> 
>> cColor(probeIds2, "red", chrObj)

And, here, you did indeed pass in a character vector, which worked.


Sean



More information about the Bioconductor mailing list