Subsetting data from RGList (Again)
5
0
Entering edit mode
@elliot-harrison-2391
Last seen 9.6 years ago
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 > R[1,1] An object of class "RGList" $G C:\\Program Files\\Agilent\\GeneSpring GX\\data\\CRX\\980\\test01_251485020980_S01_GE2-v5_91_0806_2_1_1 [1,] 15662.69 $Gb C:\\Program Files\\Agilent\\GeneSpring GX\\data\\CRX\\980\\test01_251485020980_S01_GE2-v5_91_0806_2_1_1 [1,] 73.9323 $R C:\\Program Files\\Agilent\\GeneSpring GX\\data\\CRX\\980\\test01_251485020980_S01_GE2-v5_91_0806_2_1_1 [1,] 15662.69 $Rb C:\\Program Files\\Agilent\\GeneSpring GX\\data\\CRX\\980\\test01_251485020980_S01_GE2-v5_91_0806_2_1_1 [1,] 73.9323 $weights C:\\Program Files\\Agilent\\GeneSpring GX\\data\\CRX\\980\\test01_251485020980_S01_GE2-v5_91_0806_2_1_1 [1,] 0 $targets SlideNumber Name FileName Treatment MasterTreatment 1 9801 Pre1_1 C:\\Program Files\\Agilent\\GeneSpring GX\\data\\CRX\\980\\test01_251485020980_S01_GE2-v5_91_0806_2_1_1.txt Pre1 Pre Cy3 Cy5 Date 1 WildType Ref 11/09/2007 $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 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}}
probe probe • 1.2k views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 19 hours ago
United States
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
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 19 hours ago
United States
Getting a little carried away there, it's just > idx <- match(a$Gene.Probe, R$genes$ProbeName) without the 'which' Martin Martin Morgan <mtmorgan at="" fhcrc.org=""> writes: > 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 > > _______________________________________________ > 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
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 19 hours ago
United States
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
ADD COMMENT
0
Entering edit mode
@elliot-harrison-2391
Last seen 9.6 years ago
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@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...{{dropped:3}}
ADD COMMENT
0
Entering edit mode
@elliot-harrison-2391
Last seen 9.6 years ago
Hi Martin, Did as you said and started from scratch and it worked like a dream. Your help is much appreciated Elliott -----Original Message----- From: Martin Morgan [mailto:mtmorgan@fhcrc.org] Sent: Tuesday, October 30, 2007 5:37 PM To: elliott harrison Cc: bioconductor at stat.math.ethz.ch Subject: Re: [BioC] Subsetting data from RGList (Again) 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
ADD COMMENT

Login before adding your answer.

Traffic: 576 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6