subset in XPS
2
0
Entering edit mode
Zhibin Lu ▴ 80
@zhibin-lu-2882
Last seen 10.2 years ago
Dear Christian, I tried both methods and both of them worked well! Maybe you have known this problem. When I loaded CEL files under Mac OS 10.5/R 2.7.1/BioC 2.2 with the command Data=import.data(scheme, "Data", celdir=".", celfiles=files) it was very very slow and I also got a warning message "(WARNING: partial output only, ask package author to use Rprintf instead!)". But it was fine when I ran the same command under linux. RMA normalization costs lots of time. I know I can save the result using save.image() and use load() to continue the work next time, but just for curiosity, is there a way to load ExprTreeSet from root file just like load SchemeTreeSet and DataTreeSet? Thanks so much for your help, Zhibin > Date: Mon, 30 Jun 2008 21:29:23 +0200 > From: cstrato at aon.at > To: zhbluweb at hotmail.com > CC: bioconductor at stat.math.ethz.ch > Subject: Re: [BioC] subset in XPS > > Dear Zhibin > > Meanwhile, I have uploaded a new version to BioC devel: > http://bioconductor.org/packages/2.3/bioc/html/xps.html > which simplifies your request as follows: > > 1. get expression values >> value <- exprs(data.rma) > 2. select treenames of choice (no extension necessary) >> treenames <- c("TestA2", "TestB1") > 3. make a copy of your object if you do not want to replace it >> sub.rma <- data.rma > 4. replace slot data with subset > exprs(sub.rma, treenames) <- value > 5. check if the new ExprTreeSet is correct: >> str(sub.rma) > > Best regards > Christian > > > Zhibin Lu wrote: >> Dear Christian, >> >> Thanks so much for such a detailed explanation. I will try this when I >> get to work next week, and I do not see why I can not follow the >> direction. >> >> Thanks again and have a nice weekend, >> >> Zhibin >> >>> Date: Sat, 28 Jun 2008 15:46:26 +0200 >>> From: cstrato at aon.at >>> To: zhbluweb at hotmail.com >>> CC: bioconductor at stat.math.ethz.ch >>> Subject: Re: [BioC] subset in XPS >>> >>> Dear Zhibin >>> >>> Since you have already done RMA you have now an ExprTreeSet, >>> called e.g. "data.rma". You can see the structure with: >>>> str(data.rma) >>> >>> Since currently there is no direct possibility to use a >>> subset of type ExprTreeSet only, you can create a new class >>> ExprTreeSet in the following way: >>> >>> 1. Make a subset of slot "data" which is a dataframe >>> (assuming that you want to use samples 1,2,3,7,8,9): >>>> subdata <- exprs(data.rma) >>>> subdata <- subdata[,c(1:2,3:5, 9:11)] >>> Please note that it is important to keep the first >>> two columns. >>> >>> 2. Create a copy "sub.rma" of class "data.rma" >>>> sub.rma <- data.rma >>> >>> 3. Replace slot "data" with "subdata": >>>> exprs(sub.rma) <- subdata >>> >>> For the moment you need to replace slots "treenames" and >>> "numtrees", too, which I will change in the future to be >>> done automatically. >>> >>> 4. Replace slot "treenames" with the names of your subset: >>> a, create list containing the sub samples >>>> subtrees <- unlist(treeNames(data.g.rma)) >>>> subtrees <- as.list(subtrees[c(1:3,7:9)]) >>> b, check if the names are correct: >>>> subtrees >>> c, replace slot "treenames": >>>> sub.rma at treenames <- subtrees >>> >>> 5. Replace slot "numtrees" with the number of subsamples >>>> sub.rma at numtrees <- length(subtrees) >>> >>> 6. Check if the new ExprTreeSet is correct: >>>> str(sub.rma) >>> >>> Now you can use the new ExprTreeSet "sub.rma" as input for >>> method unifilter: >>>> rma.ufr <- unifilter(sub.rma, .......) >>> >>> >>> If you want to take advantage of the advanced capabilties >>> of package "limma", then you can create a Biobase class >>> "ExpressionSet" containing only your 6 samples as described >>> in Appendix A.3 of the vignette xps.pdf: >>> >>> 1. extract the normalized expression data: >>>> subdata <- validData(data.rma) >>> >>> 2. Since "subdata" is a dataframe, simply create a subframe: >>>> subdata <- subdata[,c(1:3,7:9)] >>> >>> 3. Create a Biobase class "ExpressionSet", called "subset" >>>> subset <- new("ExpressionSet", exprs = as.matrix(subdata)) >>> >>> Now you have an ExpressionSet ready for use with "limma". >>> >>> Please let me know if you succeeded with this info. >>> >>> Best regards >>> Christian >>> _._._._._._._._._._._._._._._._ >>> C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a >>> V.i.e.n.n.a A.u.s.t.r.i.a >>> e.m.a.i.l: cstrato at aon.at >>> _._._._._._._._._._._._._._._._ >>> >>> Zhibin Lu wrote: >>>> Hi, >>>> >>>> I am new in R/bioconductor. I am using xps package to analyze >> Affymetrix Gene ST 1.0 data. After I loaded CEL files into the >> DataTreeSet and compute the expression level with RMA, can I work on a >> subset of the data? Say, I have 12 samples. After RMA, can I just work >> on 6 of them and divide them into two groups and apply UniFilter to >> just these 6 ones? >>>> >>>> Thanks, >>>> >>>> Zhibin >>>> >>>> _______________________________________________ >>>> 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 >>>> >>>> >>>> >>> >> >> ------------------------------------------------------------------- ----- > _________________________________________________________________ Try Chicktionary, a game that tests how many words you can form from the le[[elided Hotmail spam]]
Normalization Biobase xps Normalization Biobase xps • 1.8k views
ADD COMMENT
0
Entering edit mode
Zhibin Lu ▴ 80
@zhibin-lu-2882
Last seen 10.2 years ago
Dear Christian, When I tried to use str(sub.rma) to check the sub set, I found there was an extra 'X' in front of each tree name. For the example you provided, the treenames were: .. at treenames:List of 2 .. ..$ : chr "XTestA2.mdp" .. ..$ : chr "XTestB1.mdp" When I applied filters to the sub.rma, I got an error "ERROR: Could not get tree .". After I changed the treenames manually, the error was gone. I was running R 2.8/BioC 2.3 and xps 1.1.2 under Ubuntu 8.04. Regards, Zhibin > Date: Mon, 30 Jun 2008 21:29:23 +0200 > From: cstrato at aon.at > To: zhbluweb at hotmail.com > CC: bioconductor at stat.math.ethz.ch > Subject: Re: [BioC] subset in XPS > > Dear Zhibin > > Meanwhile, I have uploaded a new version to BioC devel: > http://bioconductor.org/packages/2.3/bioc/html/xps.html > which simplifies your request as follows: > > 1. get expression values >> value <- exprs(data.rma) > 2. select treenames of choice (no extension necessary) >> treenames <- c("TestA2", "TestB1") > 3. make a copy of your object if you do not want to replace it >> sub.rma <- data.rma > 4. replace slot data with subset > exprs(sub.rma, treenames) <- value > 5. check if the new ExprTreeSet is correct: >> str(sub.rma) > > Best regards > Christian > > > Zhibin Lu wrote: >> Dear Christian, >> >> Thanks so much for such a detailed explanation. I will try this when I >> get to work next week, and I do not see why I can not follow the >> direction. >> >> Thanks again and have a nice weekend, >> >> Zhibin >> >>> Date: Sat, 28 Jun 2008 15:46:26 +0200 >>> From: cstrato at aon.at >>> To: zhbluweb at hotmail.com >>> CC: bioconductor at stat.math.ethz.ch >>> Subject: Re: [BioC] subset in XPS >>> >>> Dear Zhibin >>> >>> Since you have already done RMA you have now an ExprTreeSet, >>> called e.g. "data.rma". You can see the structure with: >>>> str(data.rma) >>> >>> Since currently there is no direct possibility to use a >>> subset of type ExprTreeSet only, you can create a new class >>> ExprTreeSet in the following way: >>> >>> 1. Make a subset of slot "data" which is a dataframe >>> (assuming that you want to use samples 1,2,3,7,8,9): >>>> subdata <- exprs(data.rma) >>>> subdata <- subdata[,c(1:2,3:5, 9:11)] >>> Please note that it is important to keep the first >>> two columns. >>> >>> 2. Create a copy "sub.rma" of class "data.rma" >>>> sub.rma <- data.rma >>> >>> 3. Replace slot "data" with "subdata": >>>> exprs(sub.rma) <- subdata >>> >>> For the moment you need to replace slots "treenames" and >>> "numtrees", too, which I will change in the future to be >>> done automatically. >>> >>> 4. Replace slot "treenames" with the names of your subset: >>> a, create list containing the sub samples >>>> subtrees <- unlist(treeNames(data.g.rma)) >>>> subtrees <- as.list(subtrees[c(1:3,7:9)]) >>> b, check if the names are correct: >>>> subtrees >>> c, replace slot "treenames": >>>> sub.rma at treenames <- subtrees >>> >>> 5. Replace slot "numtrees" with the number of subsamples >>>> sub.rma at numtrees <- length(subtrees) >>> >>> 6. Check if the new ExprTreeSet is correct: >>>> str(sub.rma) >>> >>> Now you can use the new ExprTreeSet "sub.rma" as input for >>> method unifilter: >>>> rma.ufr <- unifilter(sub.rma, .......) >>> >>> >>> If you want to take advantage of the advanced capabilties >>> of package "limma", then you can create a Biobase class >>> "ExpressionSet" containing only your 6 samples as described >>> in Appendix A.3 of the vignette xps.pdf: >>> >>> 1. extract the normalized expression data: >>>> subdata <- validData(data.rma) >>> >>> 2. Since "subdata" is a dataframe, simply create a subframe: >>>> subdata <- subdata[,c(1:3,7:9)] >>> >>> 3. Create a Biobase class "ExpressionSet", called "subset" >>>> subset <- new("ExpressionSet", exprs = as.matrix(subdata)) >>> >>> Now you have an ExpressionSet ready for use with "limma". >>> >>> Please let me know if you succeeded with this info. >>> >>> Best regards >>> Christian >>> _._._._._._._._._._._._._._._._ >>> C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a >>> V.i.e.n.n.a A.u.s.t.r.i.a >>> e.m.a.i.l: cstrato at aon.at >>> _._._._._._._._._._._._._._._._ >>> >>> Zhibin Lu wrote: >>>> Hi, >>>> >>>> I am new in R/bioconductor. I am using xps package to analyze >> Affymetrix Gene ST 1.0 data. After I loaded CEL files into the >> DataTreeSet and compute the expression level with RMA, can I work on a >> subset of the data? Say, I have 12 samples. After RMA, can I just work >> on 6 of them and divide them into two groups and apply UniFilter to >> just these 6 ones? >>>> >>>> Thanks, >>>> >>>> Zhibin >>>> >>>> _______________________________________________ >>>> 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 >>>> >>>> >>>> >>> >> >> ------------------------------------------------------------------- ----- > _________________________________________________________________ Try Chicktionary, a game that tests how many words you can form from the le[[elided Hotmail spam]]
ADD COMMENT
0
Entering edit mode
Dear Zhibin This is strange, I will investigate. Best regards Christian Zhibin Lu wrote: > Dear Christian, > > When I tried to use str(sub.rma) to check the sub set, I found there was an extra 'X' in front of each tree name. For the example you provided, the treenames were: > .. at treenames:List of 2 > .. ..$ : chr "XTestA2.mdp" > .. ..$ : chr "XTestB1.mdp" > > When I applied filters to the sub.rma, I got an error "ERROR: Could not get tree .". After I changed the treenames manually, the error was gone. > > I was running R 2.8/BioC 2.3 and xps 1.1.2 under Ubuntu 8.04. > > Regards, > > Zhibin > > >> Date: Mon, 30 Jun 2008 21:29:23 +0200 >> From: cstrato at aon.at >> To: zhbluweb at hotmail.com >> CC: bioconductor at stat.math.ethz.ch >> Subject: Re: [BioC] subset in XPS >> >> Dear Zhibin >> >> Meanwhile, I have uploaded a new version to BioC devel: >> http://bioconductor.org/packages/2.3/bioc/html/xps.html >> which simplifies your request as follows: >> >> 1. get expression values >> >>> value <- exprs(data.rma) >>> >> 2. select treenames of choice (no extension necessary) >> >>> treenames <- c("TestA2", "TestB1") >>> >> 3. make a copy of your object if you do not want to replace it >> >>> sub.rma <- data.rma >>> >> 4. replace slot data with subset >> exprs(sub.rma, treenames) <- value >> 5. check if the new ExprTreeSet is correct: >> >>> str(sub.rma) >>> >> Best regards >> Christian >> >> >> Zhibin Lu wrote: >> >>> Dear Christian, >>> >>> Thanks so much for such a detailed explanation. I will try this when I >>> get to work next week, and I do not see why I can not follow the >>> direction. >>> >>> Thanks again and have a nice weekend, >>> >>> Zhibin >>> >>> >>>> Date: Sat, 28 Jun 2008 15:46:26 +0200 >>>> From: cstrato at aon.at >>>> To: zhbluweb at hotmail.com >>>> CC: bioconductor at stat.math.ethz.ch >>>> Subject: Re: [BioC] subset in XPS >>>> >>>> Dear Zhibin >>>> >>>> Since you have already done RMA you have now an ExprTreeSet, >>>> called e.g. "data.rma". You can see the structure with: >>>> >>>>> str(data.rma) >>>>> >>>> Since currently there is no direct possibility to use a >>>> subset of type ExprTreeSet only, you can create a new class >>>> ExprTreeSet in the following way: >>>> >>>> 1. Make a subset of slot "data" which is a dataframe >>>> (assuming that you want to use samples 1,2,3,7,8,9): >>>> >>>>> subdata <- exprs(data.rma) >>>>> subdata <- subdata[,c(1:2,3:5, 9:11)] >>>>> >>>> Please note that it is important to keep the first >>>> two columns. >>>> >>>> 2. Create a copy "sub.rma" of class "data.rma" >>>> >>>>> sub.rma <- data.rma >>>>> >>>> 3. Replace slot "data" with "subdata": >>>> >>>>> exprs(sub.rma) <- subdata >>>>> >>>> For the moment you need to replace slots "treenames" and >>>> "numtrees", too, which I will change in the future to be >>>> done automatically. >>>> >>>> 4. Replace slot "treenames" with the names of your subset: >>>> a, create list containing the sub samples >>>> >>>>> subtrees <- unlist(treeNames(data.g.rma)) >>>>> subtrees <- as.list(subtrees[c(1:3,7:9)]) >>>>> >>>> b, check if the names are correct: >>>> >>>>> subtrees >>>>> >>>> c, replace slot "treenames": >>>> >>>>> sub.rma at treenames <- subtrees >>>>> >>>> 5. Replace slot "numtrees" with the number of subsamples >>>> >>>>> sub.rma at numtrees <- length(subtrees) >>>>> >>>> 6. Check if the new ExprTreeSet is correct: >>>> >>>>> str(sub.rma) >>>>> >>>> Now you can use the new ExprTreeSet "sub.rma" as input for >>>> method unifilter: >>>> >>>>> rma.ufr <- unifilter(sub.rma, .......) >>>>> >>>> If you want to take advantage of the advanced capabilties >>>> of package "limma", then you can create a Biobase class >>>> "ExpressionSet" containing only your 6 samples as described >>>> in Appendix A.3 of the vignette xps.pdf: >>>> >>>> 1. extract the normalized expression data: >>>> >>>>> subdata <- validData(data.rma) >>>>> >>>> 2. Since "subdata" is a dataframe, simply create a subframe: >>>> >>>>> subdata <- subdata[,c(1:3,7:9)] >>>>> >>>> 3. Create a Biobase class "ExpressionSet", called "subset" >>>> >>>>> subset <- new("ExpressionSet", exprs = as.matrix(subdata)) >>>>> >>>> Now you have an ExpressionSet ready for use with "limma". >>>> >>>> Please let me know if you succeeded with this info. >>>> >>>> Best regards >>>> Christian >>>> _._._._._._._._._._._._._._._._ >>>> C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a >>>> V.i.e.n.n.a A.u.s.t.r.i.a >>>> e.m.a.i.l: cstrato at aon.at >>>> _._._._._._._._._._._._._._._._ >>>> >>>> Zhibin Lu wrote: >>>> >>>>> Hi, >>>>> >>>>> I am new in R/bioconductor. I am using xps package to analyze >>>>> >>> Affymetrix Gene ST 1.0 data. After I loaded CEL files into the >>> DataTreeSet and compute the expression level with RMA, can I work on a >>> subset of the data? Say, I have 12 samples. After RMA, can I just work >>> on 6 of them and divide them into two groups and apply UniFilter to >>> just these 6 ones? >>> >>>>> Thanks, >>>>> >>>>> Zhibin >>>>> >>>>> _______________________________________________ >>>>> 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 >>> >>>>> >>>>> >>> ------------------------------------------------------------------ ------ >>> > > _________________________________________________________________ > Try Chicktionary, a game that tests how many words you can form from the letters given. Find this and more puzzles at Live Search Games! > http://g.msn.ca/ca55/207 > >
ADD REPLY
0
Entering edit mode
Dear Zhibin In general, xps offers two ways to get the treenames from an ExprTreeSet: 1. method treeNames applied to the ExprTreeSet: > treenames <- treeNames(data.rma) > treenames 2. function getTreeNames applied to the root file directly: > treenames <- getTreeNames("Test3RMA.root") > treenames > treenames <- getTreeNames("Test3RMA.root","mdp") > treenames Then you can select the treenames of interest by doing: > treenames <- treenames[c(2,4)] Of course, the following also works: > value <- exprs(data.rma) > treenames <- colnames(value) > treenames > treenames <- treenames[c(4,6)] In any case you get the subset: > sub.rma <- data.rma > exprs(subset.rma, treenames) <- value > str(sub.rma) which results in: ..@ treenames:List of 2 .. ..$ : chr "TestA2.mdp" .. ..$ : chr "TestB2.mdp" Could you please send me the code you used for subsetting, which resulted in an "X" in front of treenames. Do above mentioned solutions result in the same error? Furthermore, could you give me the following information: - which version of ROOT did you install? - did you install the ROOT binary or compile from source? - did you download/install the xps binary or compile from source? P.S.: I am glad to hear that running R through Terminal on your Mac works fine. Best regards Christian Zhibin Lu wrote: > Dear Christian, > > When I tried to use str(sub.rma) to check the sub set, I found there was an extra 'X' in front of each tree name. For the example you provided, the treenames were: > .. at treenames:List of 2 > .. ..$ : chr "XTestA2.mdp" > .. ..$ : chr "XTestB1.mdp" > > When I applied filters to the sub.rma, I got an error "ERROR: Could not get tree .". After I changed the treenames manually, the error was gone. > > I was running R 2.8/BioC 2.3 and xps 1.1.2 under Ubuntu 8.04. > > Regards, > > Zhibin > >
ADD REPLY
0
Entering edit mode
Dear Christian, I tested the new package with my linux box, so I compiled ROOT from source with the file 'root_v5.18.00.source.tar.gz'. Since I was using Linux, I think xps was also compiled from source. I followed your direction, it seems that the function 'exprs' gave the extra X. Here is what I got: > treenames<-treeNames(Data.rma) > treenames [[1]] [1] "10017_12.mdp" [[2]] [1] "100M_11.mdp" [[3]] [1] "11017_4.mdp" [[4]] [1] "110M_3.mdp" [[5]] [1] "11117_6.mdp" [[6]] [1] "111M_5.mdp" [[7]] [1] "9617_2.mdp" [[8]] [1] "96M_1.mdp" [[9]] [1] "9717_8.mdp" [[10]] [1] "97M_7.mdp" [[11]] [1] "9817_10.mdp" [[12]] [1] "98M_9.mdp" > treenames=getTreeNames("rma_all.root") > treenames [1] "10017_12.rbg" "10017_12.int" "100M_11.rbg" "100M_11.int" "11017_4.rbg" [6] "11017_4.int" "110M_3.rbg" "110M_3.int" "11117_6.rbg" "11117_6.int" [11] "111M_5.rbg" "111M_5.int" "9617_2.rbg" "9617_2.int" "96M_1.rbg" [16] "96M_1.int" "9717_8.rbg" "9717_8.int" "97M_7.rbg" "97M_7.int" [21] "9817_10.rbg" "9817_10.int" "98M_9.rbg" "98M_9.int" "10017_12.cqu" [26] "100M_11.cqu" "11017_4.cqu" "110M_3.cqu" "11117_6.cqu" "111M_5.cqu" [31] "9617_2.cqu" "96M_1.cqu" "9717_8.cqu" "97M_7.cqu" "9817_10.cqu" [36] "98M_9.cqu" "10017_12.mdp" "100M_11.mdp" "11017_4.mdp" "110M_3.mdp" [41] "11117_6.mdp" "111M_5.mdp" "9617_2.mdp" "96M_1.mdp" "9717_8.mdp" [46] "97M_7.mdp" "9817_10.mdp" "98M_9.mdp" > treenames=getTreeNames("rma_all.root", "mdp") > treenames [1] "10017_12.mdp" "100M_11.mdp" "11017_4.mdp" "110M_3.mdp" "11117_6.mdp" [6] "111M_5.mdp" "9617_2.mdp" "96M_1.mdp" "9717_8.mdp" "97M_7.mdp" [11] "9817_10.mdp" "98M_9.mdp" > value<-exprs(Data.rma) > treenames<-colnames(value) > treenames [1] "UNIT_ID" "UnitName" "X10017_12.mdp_LEVEL" [4] "X100M_11.mdp_LEVEL" "X11017_4.mdp_LEVEL" "X110M_3.mdp_LEVEL" [7] "X11117_6.mdp_LEVEL" "X111M_5.mdp_LEVEL" "X9617_2.mdp_LEVEL" [10] "X96M_1.mdp_LEVEL" "X9717_8.mdp_LEVEL" "X97M_7.mdp_LEVEL" [13] "X9817_10.mdp_LEVEL" "X98M_9.mdp_LEVEL" > treenames <- treenames[c(4,6)] > sub.rma<-Data.rma > exprs(sub.rma, treenames) <- value > str(sub.rma) ..@ treenames:List of 2 .. ..$ : chr "X100M_11.mdp" .. ..$ : chr "X110M_3.mdp" Regards, Zhibin > Date: Thu, 3 Jul 2008 21:58:38 +0200 > From: cstrato at aon.at > To: zhbluweb at hotmail.com > CC: bioconductor at stat.math.ethz.ch > Subject: Re: [BioC] subset in XPS > > Dear Zhibin > > In general, xps offers two ways to get the treenames from an ExprTreeSet: > > 1. method treeNames applied to the ExprTreeSet: >> treenames <- treeNames(data.rma) >> treenames > > 2. function getTreeNames applied to the root file directly: >> treenames <- getTreeNames("Test3RMA.root") >> treenames >> treenames <- getTreeNames("Test3RMA.root","mdp") >> treenames > > Then you can select the treenames of interest by doing: >> treenames <- treenames[c(2,4)] > > Of course, the following also works: >> value <- exprs(data.rma) >> treenames <- colnames(value) >> treenames >> treenames <- treenames[c(4,6)] > > In any case you get the subset: >> sub.rma <- data.rma >> exprs(subset.rma, treenames) <- value >> str(sub.rma) > > which results in: > ..@ treenames:List of 2 > .. ..$ : chr "TestA2.mdp" > .. ..$ : chr "TestB2.mdp" > > Could you please send me the code you used for subsetting, which > resulted in an "X" in front of treenames. > > Do above mentioned solutions result in the same error? > > Furthermore, could you give me the following information: > - which version of ROOT did you install? > - did you install the ROOT binary or compile from source? > - did you download/install the xps binary or compile from source? > > P.S.: > I am glad to hear that running R through Terminal on your Mac works fine. > > Best regards > Christian > > > Zhibin Lu wrote: >> Dear Christian, >> >> When I tried to use str(sub.rma) to check the sub set, I found there was an extra 'X' in front of each tree name. For the example you provided, the treenames were: >> .. at treenames:List of 2 >> .. ..$ : chr "XTestA2.mdp" >> .. ..$ : chr "XTestB1.mdp" >> >> When I applied filters to the sub.rma, I got an error "ERROR: Could not get tree .". After I changed the treenames manually, the error was gone. >> >> I was running R 2.8/BioC 2.3 and xps 1.1.2 under Ubuntu 8.04. >> >> Regards, >> >> Zhibin >> >> > _________________________________________________________________ If you like crossword puzzles, then you'll love Flexicon, a game which comb[[elided Hotmail spam]]
ADD REPLY
0
Entering edit mode
Dear Christian, I tested the new package with my linux box, so I compiled ROOT from source with the file 'root_v5.18.00.source.tar.gz'. Since I was using Linux, I think xps was also compiled from source. I followed your direction, it seems that the function 'exprs' gave the extra X. Here is what I got: > treenames<-treeNames(Data.rma) > treenames [[1]] [1] "10017_12.mdp" [[2]] [1] "100M_11.mdp" [[3]] [1] "11017_4.mdp" [[4]] [1] "110M_3.mdp" [[5]] [1] "11117_6.mdp" [[6]] [1] "111M_5.mdp" [[7]] [1] "9617_2.mdp" [[8]] [1] "96M_1.mdp" [[9]] [1] "9717_8.mdp" [[10]] [1] "97M_7.mdp" [[11]] [1] "9817_10.mdp" [[12]] [1] "98M_9.mdp" > treenames=getTreeNames("rma_all.root") > treenames [1] "10017_12.rbg" "10017_12.int" "100M_11.rbg" "100M_11.int" "11017_4.rbg" [6] "11017_4.int" "110M_3.rbg" "110M_3.int" "11117_6.rbg" "11117_6.int" [11] "111M_5.rbg" "111M_5.int" "9617_2.rbg" "9617_2.int" "96M_1.rbg" [16] "96M_1.int" "9717_8.rbg" "9717_8.int" "97M_7.rbg" "97M_7.int" [21] "9817_10.rbg" "9817_10.int" "98M_9.rbg" "98M_9.int" "10017_12.cqu" [26] "100M_11.cqu" "11017_4.cqu" "110M_3.cqu" "11117_6.cqu" "111M_5.cqu" [31] "9617_2.cqu" "96M_1.cqu" "9717_8.cqu" "97M_7.cqu" "9817_10.cqu" [36] "98M_9.cqu" "10017_12.mdp" "100M_11.mdp" "11017_4.mdp" "110M_3.mdp" [41] "11117_6.mdp" "111M_5.mdp" "9617_2.mdp" "96M_1.mdp" "9717_8.mdp" [46] "97M_7.mdp" "9817_10.mdp" "98M_9.mdp" > treenames=getTreeNames("rma_all.root", "mdp") > treenames [1] "10017_12.mdp" "100M_11.mdp" "11017_4.mdp" "110M_3.mdp" "11117_6.mdp" [6] "111M_5.mdp" "9617_2.mdp" "96M_1.mdp" "9717_8.mdp" "97M_7.mdp" [11] "9817_10.mdp" "98M_9.mdp" > value<-exprs(Data.rma) > treenames<-colnames(value) > treenames [1] "UNIT_ID" "UnitName" "X10017_12.mdp_LEVEL" [4] "X100M_11.mdp_LEVEL" "X11017_4.mdp_LEVEL" "X110M_3.mdp_LEVEL" [7] "X11117_6.mdp_LEVEL" "X111M_5.mdp_LEVEL" "X9617_2.mdp_LEVEL" [10] "X96M_1.mdp_LEVEL" "X9717_8.mdp_LEVEL" "X97M_7.mdp_LEVEL" [13] "X9817_10.mdp_LEVEL" "X98M_9.mdp_LEVEL" > treenames <- treenames[c(4,6)] > sub.rma<-Data.rma > exprs(sub.rma, treenames) <- value > str(sub.rma) ..@ treenames:List of 2 .. ..$ : chr "X100M_11.mdp" .. ..$ : chr "X110M_3.mdp" Regards, Zhibin > Date: Thu, 3 Jul 2008 21:58:38 +0200 > From: cstrato at aon.at > To: zhbluweb at hotmail.com > CC: bioconductor at stat.math.ethz.ch > Subject: Re: [BioC] subset in XPS > > Dear Zhibin > > In general, xps offers two ways to get the treenames from an ExprTreeSet: > > 1. method treeNames applied to the ExprTreeSet: >> treenames <- treeNames(data.rma) >> treenames > > 2. function getTreeNames applied to the root file directly: >> treenames <- getTreeNames("Test3RMA.root") >> treenames >> treenames <- getTreeNames("Test3RMA.root","mdp") >> treenames > > Then you can select the treenames of interest by doing: >> treenames <- treenames[c(2,4)] > > Of course, the following also works: >> value <- exprs(data.rma) >> treenames <- colnames(value) >> treenames >> treenames <- treenames[c(4,6)] > > In any case you get the subset: >> sub.rma <- data.rma >> exprs(subset.rma, treenames) <- value >> str(sub.rma) > > which results in: > ..@ treenames:List of 2 > .. ..$ : chr "TestA2.mdp" > .. ..$ : chr "TestB2.mdp" > > Could you please send me the code you used for subsetting, which > resulted in an "X" in front of treenames. > > Do above mentioned solutions result in the same error? > > Furthermore, could you give me the following information: > - which version of ROOT did you install? > - did you install the ROOT binary or compile from source? > - did you download/install the xps binary or compile from source? > > P.S.: > I am glad to hear that running R through Terminal on your Mac works fine. > > Best regards > Christian > > > Zhibin Lu wrote: >> Dear Christian, >> >> When I tried to use str(sub.rma) to check the sub set, I found there was an extra 'X' in front of each tree name. For the example you provided, the treenames were: >> .. at treenames:List of 2 >> .. ..$ : chr "XTestA2.mdp" >> .. ..$ : chr "XTestB1.mdp" >> >> When I applied filters to the sub.rma, I got an error "ERROR: Could not get tree .". After I changed the treenames manually, the error was gone. >> >> I was running R 2.8/BioC 2.3 and xps 1.1.2 under Ubuntu 8.04. >> >> Regards, >> >> Zhibin >> >> >
ADD REPLY
0
Entering edit mode
Dear Zhibin Finally, I am able to confirm your results. The problem appears already at: > str(Data.rma) This is caused by one of the "features" of R. Since I need to export the resulting table from the root file and import it again with: > ds <- read.table("Test.txt", header=TRUE, sep="\t", row.names=NULL); > head(ds) R will check for correct colnames by function make.names(), and will do: "The character "X" is prepended if necessary" if the name starts with a number!!! Thus, I need to replace this line everywhere in my program with: > ds <- read.table("Test.txt", header=TRUE, check.names=FALSE, sep="\t", row.names=NULL); I will let you know once I have uploaded the new version, however, I need to do some testing to make sure everything is ok. Thank you for reporting this problem. Best regards Christian Zhibin Lu wrote: > Dear Christian, > > I tested the new package with my linux box, so I compiled ROOT from source with the file 'root_v5.18.00.source.tar.gz'. Since I was using Linux, I think xps was also compiled from source. I followed your direction, it seems that the function 'exprs' gave the extra X. Here is what I got: > > >> treenames<-treeNames(Data.rma) >> treenames >> > [[1]] > [1] "10017_12.mdp" > > [[2]] > [1] "100M_11.mdp" > > [[3]] > [1] "11017_4.mdp" > > [[4]] > [1] "110M_3.mdp" > > [[5]] > [1] "11117_6.mdp" > > [[6]] > [1] "111M_5.mdp" > > [[7]] > [1] "9617_2.mdp" > > [[8]] > [1] "96M_1.mdp" > > [[9]] > [1] "9717_8.mdp" > > [[10]] > [1] "97M_7.mdp" > > [[11]] > [1] "9817_10.mdp" > > [[12]] > [1] "98M_9.mdp" > > >> treenames=getTreeNames("rma_all.root") >> treenames >> > [1] "10017_12.rbg" "10017_12.int" "100M_11.rbg" "100M_11.int" "11017_4.rbg" > [6] "11017_4.int" "110M_3.rbg" "110M_3.int" "11117_6.rbg" "11117_6.int" > [11] "111M_5.rbg" "111M_5.int" "9617_2.rbg" "9617_2.int" "96M_1.rbg" > [16] "96M_1.int" "9717_8.rbg" "9717_8.int" "97M_7.rbg" "97M_7.int" > [21] "9817_10.rbg" "9817_10.int" "98M_9.rbg" "98M_9.int" "10017_12.cqu" > [26] "100M_11.cqu" "11017_4.cqu" "110M_3.cqu" "11117_6.cqu" "111M_5.cqu" > [31] "9617_2.cqu" "96M_1.cqu" "9717_8.cqu" "97M_7.cqu" "9817_10.cqu" > [36] "98M_9.cqu" "10017_12.mdp" "100M_11.mdp" "11017_4.mdp" "110M_3.mdp" > [41] "11117_6.mdp" "111M_5.mdp" "9617_2.mdp" "96M_1.mdp" "9717_8.mdp" > [46] "97M_7.mdp" "9817_10.mdp" "98M_9.mdp" > > >> treenames=getTreeNames("rma_all.root", "mdp") >> treenames >> > [1] "10017_12.mdp" "100M_11.mdp" "11017_4.mdp" "110M_3.mdp" "11117_6.mdp" > [6] "111M_5.mdp" "9617_2.mdp" "96M_1.mdp" "9717_8.mdp" "97M_7.mdp" > [11] "9817_10.mdp" "98M_9.mdp" > > >> value<-exprs(Data.rma) >> treenames<-colnames(value) >> treenames >> > [1] "UNIT_ID" "UnitName" "X10017_12.mdp_LEVEL" > [4] "X100M_11.mdp_LEVEL" "X11017_4.mdp_LEVEL" "X110M_3.mdp_LEVEL" > [7] "X11117_6.mdp_LEVEL" "X111M_5.mdp_LEVEL" "X9617_2.mdp_LEVEL" > [10] "X96M_1.mdp_LEVEL" "X9717_8.mdp_LEVEL" "X97M_7.mdp_LEVEL" > [13] "X9817_10.mdp_LEVEL" "X98M_9.mdp_LEVEL" > > >> treenames <- treenames[c(4,6)] >> sub.rma<-Data.rma >> exprs(sub.rma, treenames) <- value >> str(sub.rma) >> > > ..@ treenames:List of 2 > .. ..$ : chr "X100M_11.mdp" > .. ..$ : chr "X110M_3.mdp" > > > Regards, > > Zhibin > > >> Date: Thu, 3 Jul 2008 21:58:38 +0200 >> From: cstrato at aon.at >> To: zhbluweb at hotmail.com >> CC: bioconductor at stat.math.ethz.ch >> Subject: Re: [BioC] subset in XPS >> >> Dear Zhibin >> >> In general, xps offers two ways to get the treenames from an ExprTreeSet: >> >> 1. method treeNames applied to the ExprTreeSet: >> >>> treenames <- treeNames(data.rma) >>> treenames >>> >> 2. function getTreeNames applied to the root file directly: >> >>> treenames <- getTreeNames("Test3RMA.root") >>> treenames >>> treenames <- getTreeNames("Test3RMA.root","mdp") >>> treenames >>> >> Then you can select the treenames of interest by doing: >> >>> treenames <- treenames[c(2,4)] >>> >> Of course, the following also works: >> >>> value <- exprs(data.rma) >>> treenames <- colnames(value) >>> treenames >>> treenames <- treenames[c(4,6)] >>> >> In any case you get the subset: >> >>> sub.rma <- data.rma >>> exprs(subset.rma, treenames) <- value >>> str(sub.rma) >>> >> which results in: >> ..@ treenames:List of 2 >> .. ..$ : chr "TestA2.mdp" >> .. ..$ : chr "TestB2.mdp" >> >> Could you please send me the code you used for subsetting, which >> resulted in an "X" in front of treenames. >> >> Do above mentioned solutions result in the same error? >> >> Furthermore, could you give me the following information: >> - which version of ROOT did you install? >> - did you install the ROOT binary or compile from source? >> - did you download/install the xps binary or compile from source? >> >> P.S.: >> I am glad to hear that running R through Terminal on your Mac works fine. >> >> Best regards >> Christian >> >> >> Zhibin Lu wrote: >> >>> Dear Christian, >>> >>> When I tried to use str(sub.rma) to check the sub set, I found there was an extra 'X' in front of each tree name. For the example you provided, the treenames were: >>> .. at treenames:List of 2 >>> .. ..$ : chr "XTestA2.mdp" >>> .. ..$ : chr "XTestB1.mdp" >>> >>> When I applied filters to the sub.rma, I got an error "ERROR: Could not get tree .". After I changed the treenames manually, the error was gone. >>> >>> I was running R 2.8/BioC 2.3 and xps 1.1.2 under Ubuntu 8.04. >>> >>> Regards, >>> >>> Zhibin >>> >>> >>> > > _________________________________________________________________ > > > >
ADD REPLY
0
Entering edit mode
Dear Zhibin I have just uploaded a new version xps_1.1.3 to BioC devel: http://bioconductor.org/packages/2.3/bioc/html/xps.html which hopefully satisfies your requests: 1. to allow CEL-names starting with a number, "check.names=FALSE" is added to read.table() in all methods. 2. functions root.expr() and root.call() are added to allow loading ExprTreeSet and CallTreeSet from a root file (just like load SchemeTreeSet and DataTreeSet). Thus, you can now subset directly from a root file: > sub.rma <- root.expr(scheme.test3, "Test3RMA.root", "mdp", c("TestA2", "TestB1")) Please let me know if the new version solves your problems. Best regards Christian Zhibin Lu wrote: > Dear Christian, > > I tested the new package with my linux box, so I compiled ROOT from source with the file 'root_v5.18.00.source.tar.gz'. Since I was using Linux, I think xps was also compiled from source. I followed your direction, it seems that the function 'exprs' gave the extra X. Here is what I got: > > >> treenames<-treeNames(Data.rma) >> treenames >> > [[1]] > [1] "10017_12.mdp" > > [[2]] > [1] "100M_11.mdp" > > [[3]] > [1] "11017_4.mdp" > > [[4]] > [1] "110M_3.mdp" > > [[5]] > [1] "11117_6.mdp" > > [[6]] > [1] "111M_5.mdp" > > [[7]] > [1] "9617_2.mdp" > > [[8]] > [1] "96M_1.mdp" > > [[9]] > [1] "9717_8.mdp" > > [[10]] > [1] "97M_7.mdp" > > [[11]] > [1] "9817_10.mdp" > > [[12]] > [1] "98M_9.mdp" > > >> treenames=getTreeNames("rma_all.root") >> treenames >> > [1] "10017_12.rbg" "10017_12.int" "100M_11.rbg" "100M_11.int" "11017_4.rbg" > [6] "11017_4.int" "110M_3.rbg" "110M_3.int" "11117_6.rbg" "11117_6.int" > [11] "111M_5.rbg" "111M_5.int" "9617_2.rbg" "9617_2.int" "96M_1.rbg" > [16] "96M_1.int" "9717_8.rbg" "9717_8.int" "97M_7.rbg" "97M_7.int" > [21] "9817_10.rbg" "9817_10.int" "98M_9.rbg" "98M_9.int" "10017_12.cqu" > [26] "100M_11.cqu" "11017_4.cqu" "110M_3.cqu" "11117_6.cqu" "111M_5.cqu" > [31] "9617_2.cqu" "96M_1.cqu" "9717_8.cqu" "97M_7.cqu" "9817_10.cqu" > [36] "98M_9.cqu" "10017_12.mdp" "100M_11.mdp" "11017_4.mdp" "110M_3.mdp" > [41] "11117_6.mdp" "111M_5.mdp" "9617_2.mdp" "96M_1.mdp" "9717_8.mdp" > [46] "97M_7.mdp" "9817_10.mdp" "98M_9.mdp" > > >> treenames=getTreeNames("rma_all.root", "mdp") >> treenames >> > [1] "10017_12.mdp" "100M_11.mdp" "11017_4.mdp" "110M_3.mdp" "11117_6.mdp" > [6] "111M_5.mdp" "9617_2.mdp" "96M_1.mdp" "9717_8.mdp" "97M_7.mdp" > [11] "9817_10.mdp" "98M_9.mdp" > > >> value<-exprs(Data.rma) >> treenames<-colnames(value) >> treenames >> > [1] "UNIT_ID" "UnitName" "X10017_12.mdp_LEVEL" > [4] "X100M_11.mdp_LEVEL" "X11017_4.mdp_LEVEL" "X110M_3.mdp_LEVEL" > [7] "X11117_6.mdp_LEVEL" "X111M_5.mdp_LEVEL" "X9617_2.mdp_LEVEL" > [10] "X96M_1.mdp_LEVEL" "X9717_8.mdp_LEVEL" "X97M_7.mdp_LEVEL" > [13] "X9817_10.mdp_LEVEL" "X98M_9.mdp_LEVEL" > > >> treenames <- treenames[c(4,6)] >> sub.rma<-Data.rma >> exprs(sub.rma, treenames) <- value >> str(sub.rma) >> > > ..@ treenames:List of 2 > .. ..$ : chr "X100M_11.mdp" > .. ..$ : chr "X110M_3.mdp" > > > Regards, > > Zhibin > > >> Date: Thu, 3 Jul 2008 21:58:38 +0200 >> From: cstrato at aon.at >> To: zhbluweb at hotmail.com >> CC: bioconductor at stat.math.ethz.ch >> Subject: Re: [BioC] subset in XPS >> >> Dear Zhibin >> >> In general, xps offers two ways to get the treenames from an ExprTreeSet: >> >> 1. method treeNames applied to the ExprTreeSet: >> >>> treenames <- treeNames(data.rma) >>> treenames >>> >> 2. function getTreeNames applied to the root file directly: >> >>> treenames <- getTreeNames("Test3RMA.root") >>> treenames >>> treenames <- getTreeNames("Test3RMA.root","mdp") >>> treenames >>> >> Then you can select the treenames of interest by doing: >> >>> treenames <- treenames[c(2,4)] >>> >> Of course, the following also works: >> >>> value <- exprs(data.rma) >>> treenames <- colnames(value) >>> treenames >>> treenames <- treenames[c(4,6)] >>> >> In any case you get the subset: >> >>> sub.rma <- data.rma >>> exprs(subset.rma, treenames) <- value >>> str(sub.rma) >>> >> which results in: >> ..@ treenames:List of 2 >> .. ..$ : chr "TestA2.mdp" >> .. ..$ : chr "TestB2.mdp" >> >> Could you please send me the code you used for subsetting, which >> resulted in an "X" in front of treenames. >> >> Do above mentioned solutions result in the same error? >> >> Furthermore, could you give me the following information: >> - which version of ROOT did you install? >> - did you install the ROOT binary or compile from source? >> - did you download/install the xps binary or compile from source? >> >> P.S.: >> I am glad to hear that running R through Terminal on your Mac works fine. >> >> Best regards >> Christian >> >> >> Zhibin Lu wrote: >> >>> Dear Christian, >>> >>> When I tried to use str(sub.rma) to check the sub set, I found there was an extra 'X' in front of each tree name. For the example you provided, the treenames were: >>> .. at treenames:List of 2 >>> .. ..$ : chr "XTestA2.mdp" >>> .. ..$ : chr "XTestB1.mdp" >>> >>> When I applied filters to the sub.rma, I got an error "ERROR: Could not get tree .". After I changed the treenames manually, the error was gone. >>> >>> I was running R 2.8/BioC 2.3 and xps 1.1.2 under Ubuntu 8.04. >>> >>> Regards, >>> >>> Zhibin >>> >>> >>> > > _________________________________________________________________ > > > >
ADD REPLY
0
Entering edit mode
Dear Christian, The new functions are working great! I really appreciate your help, Zhibin > Date: Sat, 5 Jul 2008 21:49:24 +0200 > From: cstrato at aon.at > To: zhbluweb at hotmail.com > CC: bioconductor at stat.math.ethz.ch > Subject: Re: [BioC] subset in XPS > > Dear Zhibin > > I have just uploaded a new version xps_1.1.3 to BioC devel: > http://bioconductor.org/packages/2.3/bioc/html/xps.html > which hopefully satisfies your requests: > > 1. to allow CEL-names starting with a number, "check.names=FALSE" > is added to read.table() in all methods. > > 2. functions root.expr() and root.call() are added to allow > loading ExprTreeSet and CallTreeSet from a root file > (just like load SchemeTreeSet and DataTreeSet). > > Thus, you can now subset directly from a root file: >> sub.rma <- root.expr(scheme.test3, "Test3RMA.root", "mdp", > c("TestA2", "TestB1")) > > Please let me know if the new version solves your problems. > > Best regards > Christian > > > Zhibin Lu wrote: >> Dear Christian, >> >> I tested the new package with my linux box, so I compiled ROOT from source with the file 'root_v5.18.00.source.tar.gz'. Since I was using Linux, I think xps was also compiled from source. I followed your direction, it seems that the function 'exprs' gave the extra X. Here is what I got: >> >> >>> treenames<-treeNames(Data.rma) >>> treenames >>> >> [[1]] >> [1] "10017_12.mdp" >> >> [[2]] >> [1] "100M_11.mdp" >> >> [[3]] >> [1] "11017_4.mdp" >> >> [[4]] >> [1] "110M_3.mdp" >> >> [[5]] >> [1] "11117_6.mdp" >> >> [[6]] >> [1] "111M_5.mdp" >> >> [[7]] >> [1] "9617_2.mdp" >> >> [[8]] >> [1] "96M_1.mdp" >> >> [[9]] >> [1] "9717_8.mdp" >> >> [[10]] >> [1] "97M_7.mdp" >> >> [[11]] >> [1] "9817_10.mdp" >> >> [[12]] >> [1] "98M_9.mdp" >> >> >>> treenames=getTreeNames("rma_all.root") >>> treenames >>> >> [1] "10017_12.rbg" "10017_12.int" "100M_11.rbg" "100M_11.int" "11017_4.rbg" >> [6] "11017_4.int" "110M_3.rbg" "110M_3.int" "11117_6.rbg" "11117_6.int" >> [11] "111M_5.rbg" "111M_5.int" "9617_2.rbg" "9617_2.int" "96M_1.rbg" >> [16] "96M_1.int" "9717_8.rbg" "9717_8.int" "97M_7.rbg" "97M_7.int" >> [21] "9817_10.rbg" "9817_10.int" "98M_9.rbg" "98M_9.int" "10017_12.cqu" >> [26] "100M_11.cqu" "11017_4.cqu" "110M_3.cqu" "11117_6.cqu" "111M_5.cqu" >> [31] "9617_2.cqu" "96M_1.cqu" "9717_8.cqu" "97M_7.cqu" "9817_10.cqu" >> [36] "98M_9.cqu" "10017_12.mdp" "100M_11.mdp" "11017_4.mdp" "110M_3.mdp" >> [41] "11117_6.mdp" "111M_5.mdp" "9617_2.mdp" "96M_1.mdp" "9717_8.mdp" >> [46] "97M_7.mdp" "9817_10.mdp" "98M_9.mdp" >> >> >>> treenames=getTreeNames("rma_all.root", "mdp") >>> treenames >>> >> [1] "10017_12.mdp" "100M_11.mdp" "11017_4.mdp" "110M_3.mdp" "11117_6.mdp" >> [6] "111M_5.mdp" "9617_2.mdp" "96M_1.mdp" "9717_8.mdp" "97M_7.mdp" >> [11] "9817_10.mdp" "98M_9.mdp" >> >> >>> value<-exprs(Data.rma) >>> treenames<-colnames(value) >>> treenames >>> >> [1] "UNIT_ID" "UnitName" "X10017_12.mdp_LEVEL" >> [4] "X100M_11.mdp_LEVEL" "X11017_4.mdp_LEVEL" "X110M_3.mdp_LEVEL" >> [7] "X11117_6.mdp_LEVEL" "X111M_5.mdp_LEVEL" "X9617_2.mdp_LEVEL" >> [10] "X96M_1.mdp_LEVEL" "X9717_8.mdp_LEVEL" "X97M_7.mdp_LEVEL" >> [13] "X9817_10.mdp_LEVEL" "X98M_9.mdp_LEVEL" >> >> >>> treenames <- treenames[c(4,6)] >>> sub.rma<-Data.rma >>> exprs(sub.rma, treenames) <- value >>> str(sub.rma) >>> >> >> ..@ treenames:List of 2 >> .. ..$ : chr "X100M_11.mdp" >> .. ..$ : chr "X110M_3.mdp" >> >> >> Regards, >> >> Zhibin >> >> >>> Date: Thu, 3 Jul 2008 21:58:38 +0200 >>> From: cstrato at aon.at >>> To: zhbluweb at hotmail.com >>> CC: bioconductor at stat.math.ethz.ch >>> Subject: Re: [BioC] subset in XPS >>> >>> Dear Zhibin >>> >>> In general, xps offers two ways to get the treenames from an ExprTreeSet: >>> >>> 1. method treeNames applied to the ExprTreeSet: >>> >>>> treenames <- treeNames(data.rma) >>>> treenames >>>> >>> 2. function getTreeNames applied to the root file directly: >>> >>>> treenames <- getTreeNames("Test3RMA.root") >>>> treenames >>>> treenames <- getTreeNames("Test3RMA.root","mdp") >>>> treenames >>>> >>> Then you can select the treenames of interest by doing: >>> >>>> treenames <- treenames[c(2,4)] >>>> >>> Of course, the following also works: >>> >>>> value <- exprs(data.rma) >>>> treenames <- colnames(value) >>>> treenames >>>> treenames <- treenames[c(4,6)] >>>> >>> In any case you get the subset: >>> >>>> sub.rma <- data.rma >>>> exprs(subset.rma, treenames) <- value >>>> str(sub.rma) >>>> >>> which results in: >>> ..@ treenames:List of 2 >>> .. ..$ : chr "TestA2.mdp" >>> .. ..$ : chr "TestB2.mdp" >>> >>> Could you please send me the code you used for subsetting, which >>> resulted in an "X" in front of treenames. >>> >>> Do above mentioned solutions result in the same error? >>> >>> Furthermore, could you give me the following information: >>> - which version of ROOT did you install? >>> - did you install the ROOT binary or compile from source? >>> - did you download/install the xps binary or compile from source? >>> >>> P.S.: >>> I am glad to hear that running R through Terminal on your Mac works fine. >>> >>> Best regards >>> Christian >>> >>> >>> Zhibin Lu wrote: >>> >>>> Dear Christian, >>>> >>>> When I tried to use str(sub.rma) to check the sub set, I found there was an extra 'X' in front of each tree name. For the example you provided, the treenames were: >>>> .. at treenames:List of 2 >>>> .. ..$ : chr "XTestA2.mdp" >>>> .. ..$ : chr "XTestB1.mdp" >>>> >>>> When I applied filters to the sub.rma, I got an error "ERROR: Could not get tree .". After I changed the treenames manually, the error was gone. >>>> >>>> I was running R 2.8/BioC 2.3 and xps 1.1.2 under Ubuntu 8.04. >>>> >>>> Regards, >>>> >>>> Zhibin >>>> >>>> >>>> >> >> _________________________________________________________________ >> >> >> >> >
ADD REPLY
0
Entering edit mode
cstrato ★ 3.9k
@cstrato-908
Last seen 6.1 years ago
Austria
Dear Zhibin It is good to know that both methods worked for you. Regarding your problem with MacOS 10.5 I assume that you are using R.app? Please note that I do all my development on a MacBook Pro using MacOS 10.4.8 and currently R-2.7.1, and command "data<-import.data()" is as fast as on Linux w/o any output problems. However, I never use R.app but always start R from an xterm! I have just tested R.app and do not see a slowdown, however, I get some strange error messages. Maybe there are even more problems with R.app on MacOS 10.5, which I currently do not have. Since most of the output is from the C++ code, which can be used independently of R, I am not able to use Rprintf. I have tested my package on MacOS X, Linux and Winodws XP, and if you use the command line, everything works fine on all three machines. I would appreciate if you could try to run your data on your Mac using either Apple's Terminal or xterm (for xterm you need to install X11 from the system CD first) and let me know if you still experience a slowdown. Regarding your second question: Since you can use save.image() I did not yet implement to load an ExprTreeSet, however, this is on my to-do list. Best regards Christian Zhibin Lu wrote: > Dear Christian, > > I tried both methods and both of them worked well! > > Maybe you have known this problem. When I loaded CEL files under Mac OS 10.5/R 2.7.1/BioC 2.2 with the command > Data=import.data(scheme, "Data", celdir=".", celfiles=files) > it was very very slow and I also got a warning message "(WARNING: partial output only, ask package author to use Rprintf instead!)". > But it was fine when I ran the same command under linux. > > RMA normalization costs lots of time. I know I can save the result using save.image() and use load() to continue the work next time, but just for curiosity, is there a way to load ExprTreeSet from root file just like load SchemeTreeSet and DataTreeSet? > > Thanks so much for your help, > > Zhibin > > >> Date: Mon, 30 Jun 2008 21:29:23 +0200 >> From: cstrato at aon.at >> To: zhbluweb at hotmail.com >> CC: bioconductor at stat.math.ethz.ch >> Subject: Re: [BioC] subset in XPS >> >> Dear Zhibin >> >> Meanwhile, I have uploaded a new version to BioC devel: >> http://bioconductor.org/packages/2.3/bioc/html/xps.html >> which simplifies your request as follows: >> >> 1. get expression values >> >>> value <- exprs(data.rma) >>> >> 2. select treenames of choice (no extension necessary) >> >>> treenames <- c("TestA2", "TestB1") >>> >> 3. make a copy of your object if you do not want to replace it >> >>> sub.rma <- data.rma >>> >> 4. replace slot data with subset >> exprs(sub.rma, treenames) <- value >> 5. check if the new ExprTreeSet is correct: >> >>> str(sub.rma) >>> >> Best regards >> Christian >> >> >> Zhibin Lu wrote: >> >>> Dear Christian, >>> >>> Thanks so much for such a detailed explanation. I will try this when I >>> get to work next week, and I do not see why I can not follow the >>> direction. >>> >>> Thanks again and have a nice weekend, >>> >>> Zhibin >>> >>> >>>> Date: Sat, 28 Jun 2008 15:46:26 +0200 >>>> From: cstrato at aon.at >>>> To: zhbluweb at hotmail.com >>>> CC: bioconductor at stat.math.ethz.ch >>>> Subject: Re: [BioC] subset in XPS >>>> >>>> Dear Zhibin >>>> >>>> Since you have already done RMA you have now an ExprTreeSet, >>>> called e.g. "data.rma". You can see the structure with: >>>> >>>>> str(data.rma) >>>>> >>>> Since currently there is no direct possibility to use a >>>> subset of type ExprTreeSet only, you can create a new class >>>> ExprTreeSet in the following way: >>>> >>>> 1. Make a subset of slot "data" which is a dataframe >>>> (assuming that you want to use samples 1,2,3,7,8,9): >>>> >>>>> subdata <- exprs(data.rma) >>>>> subdata <- subdata[,c(1:2,3:5, 9:11)] >>>>> >>>> Please note that it is important to keep the first >>>> two columns. >>>> >>>> 2. Create a copy "sub.rma" of class "data.rma" >>>> >>>>> sub.rma <- data.rma >>>>> >>>> 3. Replace slot "data" with "subdata": >>>> >>>>> exprs(sub.rma) <- subdata >>>>> >>>> For the moment you need to replace slots "treenames" and >>>> "numtrees", too, which I will change in the future to be >>>> done automatically. >>>> >>>> 4. Replace slot "treenames" with the names of your subset: >>>> a, create list containing the sub samples >>>> >>>>> subtrees <- unlist(treeNames(data.g.rma)) >>>>> subtrees <- as.list(subtrees[c(1:3,7:9)]) >>>>> >>>> b, check if the names are correct: >>>> >>>>> subtrees >>>>> >>>> c, replace slot "treenames": >>>> >>>>> sub.rma at treenames <- subtrees >>>>> >>>> 5. Replace slot "numtrees" with the number of subsamples >>>> >>>>> sub.rma at numtrees <- length(subtrees) >>>>> >>>> 6. Check if the new ExprTreeSet is correct: >>>> >>>>> str(sub.rma) >>>>> >>>> Now you can use the new ExprTreeSet "sub.rma" as input for >>>> method unifilter: >>>> >>>>> rma.ufr <- unifilter(sub.rma, .......) >>>>> >>>> If you want to take advantage of the advanced capabilties >>>> of package "limma", then you can create a Biobase class >>>> "ExpressionSet" containing only your 6 samples as described >>>> in Appendix A.3 of the vignette xps.pdf: >>>> >>>> 1. extract the normalized expression data: >>>> >>>>> subdata <- validData(data.rma) >>>>> >>>> 2. Since "subdata" is a dataframe, simply create a subframe: >>>> >>>>> subdata <- subdata[,c(1:3,7:9)] >>>>> >>>> 3. Create a Biobase class "ExpressionSet", called "subset" >>>> >>>>> subset <- new("ExpressionSet", exprs = as.matrix(subdata)) >>>>> >>>> Now you have an ExpressionSet ready for use with "limma". >>>> >>>> Please let me know if you succeeded with this info. >>>> >>>> Best regards >>>> Christian >>>> _._._._._._._._._._._._._._._._ >>>> C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a >>>> V.i.e.n.n.a A.u.s.t.r.i.a >>>> e.m.a.i.l: cstrato at aon.at >>>> _._._._._._._._._._._._._._._._ >>>> >>>> Zhibin Lu wrote: >>>> >>>>> Hi, >>>>> >>>>> I am new in R/bioconductor. I am using xps package to analyze >>>>> >>> Affymetrix Gene ST 1.0 data. After I loaded CEL files into the >>> DataTreeSet and compute the expression level with RMA, can I work on a >>> subset of the data? Say, I have 12 samples. After RMA, can I just work >>> on 6 of them and divide them into two groups and apply UniFilter to >>> just these 6 ones? >>> >>>>> Thanks, >>>>> >>>>> Zhibin >>>>> >>>>> _______________________________________________ >>>>> 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 >>> >>>>> >>>>> >>> ------------------------------------------------------------------ ------ >>> > > _________________________________________________________________ > Try Chicktionary, a game that tests how many words you can form from the letters given. Find this and more puzzles at Live Search Games! > http://g.msn.ca/ca55/207 > >
ADD COMMENT
0
Entering edit mode
Dear Christian, You were right! When I ran R through Terminal under Mac OS 10.5, there was no error at all to load CEL files, and the loading process was quite fast. Thanks, Zhibin > Date: Thu, 3 Jul 2008 00:16:23 +0200 > From: cstrato at aon.at > To: zhbluweb at hotmail.com > CC: bioconductor at stat.math.ethz.ch > Subject: Re: [BioC] subset in XPS > > Dear Zhibin > > It is good to know that both methods worked for you. > > Regarding your problem with MacOS 10.5 I assume that you are using R.app? > > Please note that I do all my development on a MacBook Pro using MacOS > 10.4.8 and currently R-2.7.1, and command "data<-import.data()" is as > fast as on Linux w/o any output problems. However, I never use R.app but > always start R from an xterm! > > I have just tested R.app and do not see a slowdown, however, I get some > strange error messages. Maybe there are even more problems with R.app > on MacOS 10.5, which I currently do not have. > > Since most of the output is from the C++ code, which can be used > independently of R, I am not able to use Rprintf. I have tested my > package on MacOS X, Linux and Winodws XP, and if you use the command > line, everything works fine on all three machines. > > I would appreciate if you could try to run your data on your Mac using > either Apple's Terminal or xterm (for xterm you need to install X11 > from the system CD first) and let me know if you still experience a > slowdown. > > Regarding your second question: Since you can use save.image() I did not > yet implement to load an ExprTreeSet, however, this is on my to-do list. > > Best regards > Christian > > > Zhibin Lu wrote: >> Dear Christian, >> >> I tried both methods and both of them worked well! >> >> Maybe you have known this problem. When I loaded CEL files under Mac OS 10.5/R 2.7.1/BioC 2.2 with the command >> Data=import.data(scheme, "Data", celdir=".", celfiles=files) >> it was very very slow and I also got a warning message "(WARNING: partial output only, ask package author to use Rprintf instead!)". >> But it was fine when I ran the same command under linux. >> >> RMA normalization costs lots of time. I know I can save the result using save.image() and use load() to continue the work next time, but just for curiosity, is there a way to load ExprTreeSet from root file just like load SchemeTreeSet and DataTreeSet? >> >> Thanks so much for your help, >> >> Zhibin >> >> >>> Date: Mon, 30 Jun 2008 21:29:23 +0200 >>> From: cstrato at aon.at >>> To: zhbluweb at hotmail.com >>> CC: bioconductor at stat.math.ethz.ch >>> Subject: Re: [BioC] subset in XPS >>> >>> Dear Zhibin >>> >>> Meanwhile, I have uploaded a new version to BioC devel: >>> http://bioconductor.org/packages/2.3/bioc/html/xps.html >>> which simplifies your request as follows: >>> >>> 1. get expression values >>> >>>> value <- exprs(data.rma) >>>> >>> 2. select treenames of choice (no extension necessary) >>> >>>> treenames <- c("TestA2", "TestB1") >>>> >>> 3. make a copy of your object if you do not want to replace it >>> >>>> sub.rma <- data.rma >>>> >>> 4. replace slot data with subset >>> exprs(sub.rma, treenames) <- value >>> 5. check if the new ExprTreeSet is correct: >>> >>>> str(sub.rma) >>>> >>> Best regards >>> Christian >>> >>> >>> Zhibin Lu wrote: >>> >>>> Dear Christian, >>>> >>>> Thanks so much for such a detailed explanation. I will try this when I >>>> get to work next week, and I do not see why I can not follow the >>>> direction. >>>> >>>> Thanks again and have a nice weekend, >>>> >>>> Zhibin >>>> >>>> >>>>> Date: Sat, 28 Jun 2008 15:46:26 +0200 >>>>> From: cstrato at aon.at >>>>> To: zhbluweb at hotmail.com >>>>> CC: bioconductor at stat.math.ethz.ch >>>>> Subject: Re: [BioC] subset in XPS >>>>> >>>>> Dear Zhibin >>>>> >>>>> Since you have already done RMA you have now an ExprTreeSet, >>>>> called e.g. "data.rma". You can see the structure with: >>>>> >>>>>> str(data.rma) >>>>>> >>>>> Since currently there is no direct possibility to use a >>>>> subset of type ExprTreeSet only, you can create a new class >>>>> ExprTreeSet in the following way: >>>>> >>>>> 1. Make a subset of slot "data" which is a dataframe >>>>> (assuming that you want to use samples 1,2,3,7,8,9): >>>>> >>>>>> subdata <- exprs(data.rma) >>>>>> subdata <- subdata[,c(1:2,3:5, 9:11)] >>>>>> >>>>> Please note that it is important to keep the first >>>>> two columns. >>>>> >>>>> 2. Create a copy "sub.rma" of class "data.rma" >>>>> >>>>>> sub.rma <- data.rma >>>>>> >>>>> 3. Replace slot "data" with "subdata": >>>>> >>>>>> exprs(sub.rma) <- subdata >>>>>> >>>>> For the moment you need to replace slots "treenames" and >>>>> "numtrees", too, which I will change in the future to be >>>>> done automatically. >>>>> >>>>> 4. Replace slot "treenames" with the names of your subset: >>>>> a, create list containing the sub samples >>>>> >>>>>> subtrees <- unlist(treeNames(data.g.rma)) >>>>>> subtrees <- as.list(subtrees[c(1:3,7:9)]) >>>>>> >>>>> b, check if the names are correct: >>>>> >>>>>> subtrees >>>>>> >>>>> c, replace slot "treenames": >>>>> >>>>>> sub.rma at treenames <- subtrees >>>>>> >>>>> 5. Replace slot "numtrees" with the number of subsamples >>>>> >>>>>> sub.rma at numtrees <- length(subtrees) >>>>>> >>>>> 6. Check if the new ExprTreeSet is correct: >>>>> >>>>>> str(sub.rma) >>>>>> >>>>> Now you can use the new ExprTreeSet "sub.rma" as input for >>>>> method unifilter: >>>>> >>>>>> rma.ufr <- unifilter(sub.rma, .......) >>>>>> >>>>> If you want to take advantage of the advanced capabilties >>>>> of package "limma", then you can create a Biobase class >>>>> "ExpressionSet" containing only your 6 samples as described >>>>> in Appendix A.3 of the vignette xps.pdf: >>>>> >>>>> 1. extract the normalized expression data: >>>>> >>>>>> subdata <- validData(data.rma) >>>>>> >>>>> 2. Since "subdata" is a dataframe, simply create a subframe: >>>>> >>>>>> subdata <- subdata[,c(1:3,7:9)] >>>>>> >>>>> 3. Create a Biobase class "ExpressionSet", called "subset" >>>>> >>>>>> subset <- new("ExpressionSet", exprs = as.matrix(subdata)) >>>>>> >>>>> Now you have an ExpressionSet ready for use with "limma". >>>>> >>>>> Please let me know if you succeeded with this info. >>>>> >>>>> Best regards >>>>> Christian >>>>> _._._._._._._._._._._._._._._._ >>>>> C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a >>>>> V.i.e.n.n.a A.u.s.t.r.i.a >>>>> e.m.a.i.l: cstrato at aon.at >>>>> _._._._._._._._._._._._._._._._ >>>>> >>>>> Zhibin Lu wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I am new in R/bioconductor. I am using xps package to analyze >>>>>> >>>> Affymetrix Gene ST 1.0 data. After I loaded CEL files into the >>>> DataTreeSet and compute the expression level with RMA, can I work on a >>>> subset of the data? Say, I have 12 samples. After RMA, can I just work >>>> on 6 of them and divide them into two groups and apply UniFilter to >>>> just these 6 ones? >>>> >>>>>> Thanks, >>>>>> >>>>>> Zhibin >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >>>> >>>>>> >>>>>> >>>> ----------------------------------------------------------------- ------- >>>> >> >> _________________________________________________________________ >> Try Chicktionary, a game that tests how many words you can form from the letters given. Find this and more puzzles at Live Search Games! >> http://g.msn.ca/ca55/207 >> >> > _________________________________________________________________ If you like crossword puzzles, then you'll love Flexicon, a game which comb[[elided Hotmail spam]]
ADD REPLY

Login before adding your answer.

Traffic: 947 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