[BioC] Subsetting data from RGList (Again)
Martin Morgan
mtmorgan at fhcrc.org
Tue Oct 30 18:37:16 CET 2007
Elliott
Great! some progress. I'm not sure where your problem is coming from
now, but suspect that you've managed to assign something to 'R' that
is of the wrong sort. What is class(R)? names(R)? sapply(R, dim)? Can
you recreate R? When you try to subset and see an error, what does
traceback() say? And so that we are on the same page, what does
sessionInfo() say?
Martin
"elliott harrison" <e.harrison at epistem.co.uk> writes:
> Thanks Martin,
>
> I'd sorted the which removal and get a sensible matrix of matches
>
>> idx <- match(a$Gene.Probe, R$genes$ProbeName)
>> idx
> [1] 38 65 200 278 303 312 350 351 388 571 710
> 714 778 810 997 1027 1049 1070 1177 1229 1245 1307 1328
> 1338 1411
>
>
> So I'm finding probes in my data set Hurrah!!!
>
> However when I try to apply it
>
>> R[idx,]
> Error in R[idx, ] : incorrect number of dimensions
>
> Any idea what is wrong here?
>
> Thanks again
>
> Ellliott
>
> -----Original Message-----
> From: Martin Morgan [mailto:mtmorgan at fhcrc.org]
> Sent: Tuesday, October 30, 2007 3:50 PM
> To: elliott harrison
> Cc: bioconductor at stat.math.ethz.ch
> Subject: Re: [BioC] Subsetting data from RGList (Again)
>
> Hi Elliott,
>
> "elliott harrison" <e.harrison at epistem.co.uk> writes:
>
>> Hi All,
>> Sorry to trouble everyone but I didn't get my subsetting of an RGList
>
>> sorted last week.
>> I've tried loads of different combinations of things that were
>> suggested but not quite there yet.
>>
>> MY Data is an RGList object here is a bit
> [SNIP]
>> $genes
>> Row Col FeatureNum ProbeUID ControlType ProbeName
>> GeneName SystematicName Status
>> 1 1 1 1 0 1 GE_BrightCorner
>> GE_BrightCorner GE_BrightCorner Control6
>>
>> $source
>> [1] "generic"
>>
>>
>> My list of probes to select data with is in this object.
>>> a
>> Gene.Probe
>> Probe1 A_24_P329635
>> Probe2 A_23_P104098
>> Probe3 A_23_P419038
>> Probe4 A_24_P124550
>> Probe5 A_23_P99044
>
> You'd like to match your 'Gene.Probe' column, I guess, to a column in
> R$genes, maybe ProbeName? So create a numeric vector, with the locations
> of each Gene.Probe in R$Genes$ProbeName
>
>> idx <- which(match(a$Gene.Probe, R$genes$ProbeName))
>
> and use it to subset R
>
>> R[idx,]
>
> If you'd wanted to match Probe1, etc, you'd have used rownames(a)
> instead of a$Gene.Probe. Sometimes RGList has row names, i.e.,
>
>> rownames(R)
>
> returns a (long!) character vector. In these cases, you can create a
> character vector 'rnms' containing at least some of the row names of R.
> and
>
>> R[rnms,]
>
> Martin
>
>>
>>
>> I've tried
>> A=rownames(a)
>> RA = R[A,]
>>
>> But don't get any genes
>>>$genes
>> [1] Row Col FeatureNum ProbeUID
>> ControlType ProbeName GeneName SystematicName Status
>>
>> <0 rows> (or 0-length row.names)
>>
>> I've tried creating a vector using match a load of different ways but
>> it is always empty
>>>vec = match(A, R)
>>>vec = match(A, R$genes$ProbeName)
>>>vec = match(A, R$genes)
>>>vec = match(probelist600, R)
>>>vec = match(probelist600, R$genes)
>>>vec = match(probelist600, R$genes$ProbeName)
>>
>>
>> This is part what ends up in object A
>>> A
>> [1] "Probe1" "Probe2" "Probe3" "Probe4" "Probe5" "Probe6"
>> "Probe7" "Probe8" "Probe9" "Probe10" "Probe11" "Probe12"
>> "Probe13"
>>
>> I expected to see my probe names in there.
>> I'm clearly not getting something.
>> Can anyone see where I'm going wrong?
>> Many Thanks
>> Elliott
>>
>>
>> This message has been scanned for viruses by
>> BlackSpider...{{dropped:3}}
>>
>> _______________________________________________
>> 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
>
>
>
>
>
> This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com
More information about the Bioconductor
mailing list