[BioC] Retrieve measures
Matthew Ritchie
mritchie at wehi.EDU.AU
Thu Mar 18 22:23:07 MET 2004
Hi Emanuele,
> Hello everybody,
> haw can I retrieve easily from an RGlist object the row value of a
> specific gene if I know only the "Gene ID"? thank you all and forgive me
> to bother you with basic questions!
>
> Emanuele
If you have the R/G information stored in an RGList object (called RG),
the gene names stored in RG$genes, and you known the ID, or name (say
"AAX3"), then subsetting your RGList as follows should give you what you
want.
RG[RG$genes$ID=="AAX3",]
See below for a working example. Best wishes,
Matt Ritchie
# Make up a dummy genelist
gal <- as.data.frame(cbind(Block=rep(1,10), Column=seq(1:10),
Row=rep(1,10), ID=c("Control 1", "Control 2", "AAX1", "AAX2", "AAX3",
"AAX4", "AAX5", "AAX6", "AAX7", "AAX8"),Name=c("House keeping 1", "House
keeping 2", "AAX1", "AAX2", "AAX3", "AAX4", "AAX5", "AAX6", "AAX7",
"AAX8")))
gal
# Make up an RGList object, for 2 arrays with 10 genes on each
RG <- new("RGList", list(R=matrix(rnorm(20, 1000, 300), 10,2),
G=matrix(rnorm(20, 1500, 350),10,2), Rb=NULL, Gb=NULL, genes=gal,
printer=list(nspot.r=1, nspot.c=10, ngrid.r=1, ngrid.c=1)))
RG
# Show the RG information for the gene that you're interested in
RG[RG$genes$ID=="AAX3",]
More information about the Bioconductor
mailing list