to extract just some columns of an exprsSet
3
0
Entering edit mode
@florence-combes-906
Last seen 10.2 years ago
Dear all, I have a programming problem with R, but in connection with arrays: My goal is to extract just some columns (for which I have the label of each) of an object of exprsSet type: the resulting object of the expresso() command from the affy package. To be precise, let's say that I have 12 arrays, so my exprsSet object is a matrix of some thousands of lines by 12 columns. My problem is that I don't have the rank of the columns I want to extract, but just the labels. Let's say I have a matrix of 12 colums labelled "sample1" to sample12". I want to extract the columns labelled "sample1", sample4" and sample6", which are non contiguous on my exprsSet matrix, in order to create a new matrix with these columns only. I do not know how to obtain the indices (coordonates is maybe better?) of these 3 columns. I think that when I will have these indices I will the be possible to use the subset() command ? Does anyone could help me with this, because it seems I won't be able to do .... Thanks a lot for your help, Florence.
affy affy • 1.2k views
ADD COMMENT
0
Entering edit mode
@florence-combes-906
Last seen 10.2 years ago
In fact I just found out (one of) the way to do it, really sorry for this everybody. I put there my command line if it can be useful for someone.... let's say you have the label(s) of the column(s) you want to extract in a variable called "ext", and that the exprSet object is called "eset" , I think you can do you can do: > extracted <- exprs(eset[, ext]) apologize again, Florence. >Dear all, > >I have a programming problem with R, but in connection with arrays: >My goal is to extract just some columns (for which I have the label of >each) of an object of exprsSet type: the resulting object of the >expresso() command from the affy package. > >To be precise, let's say that I have 12 arrays, so my exprsSet object is a >matrix of some thousands of lines by 12 columns. > >My problem is that I don't have the rank of the columns I want to extract, >but just the labels. >Let's say I have a matrix of 12 colums labelled "sample1" to sample12". I >want to extract the columns labelled "sample1", sample4" and sample6", >which are non contiguous on my exprsSet matrix, in order to create a new >matrix with these columns only. > >I do not know how to obtain the indices (coordonates is maybe better?) of >these 3 columns. >I think that when I will have these indices I will the be possible to use >the subset() command ? > >Does anyone could help me with this, because it seems I won't be able to >do .... > >Thanks a lot for your help, > >Florence. > >_______________________________________________ >Bioconductor mailing list >Bioconductor@stat.math.ethz.ch >https://stat.ethz.ch/mailman/listinfo/bioconductor
ADD COMMENT
0
Entering edit mode
@florence-combes-906
Last seen 10.2 years ago
In fact I just found out (one of) the way to do it, really sorry for this everybody. I put there my command line if it can be useful for someone.... let's say you have the label(s) of the column(s) you want to extract in a variable called "ext", and that the exprSet object is called "eset" , I think you can do you can do: > extracted <- exprs(eset[, ext]) apologize again, Florence. >Dear all, > >I have a programming problem with R, but in connection with arrays: >My goal is to extract just some columns (for which I have the label of >each) of an object of exprsSet type: the resulting object of the >expresso() command from the affy package. > >To be precise, let's say that I have 12 arrays, so my exprsSet object is a >matrix of some thousands of lines by 12 columns. > >My problem is that I don't have the rank of the columns I want to extract, >but just the labels. >Let's say I have a matrix of 12 colums labelled "sample1" to sample12". I >want to extract the columns labelled "sample1", sample4" and sample6", >which are non contiguous on my exprsSet matrix, in order to create a new >matrix with these columns only. > >I do not know how to obtain the indices (coordonates is maybe better?) of >these 3 columns. >I think that when I will have these indices I will the be possible to use >the subset() command ? > >Does anyone could help me with this, because it seems I won't be able to >do .... > >Thanks a lot for your help, > >Florence. > >_______________________________________________ >Bioconductor mailing list >Bioconductor@stat.math.ethz.ch >https://stat.ethz.ch/mailman/listinfo/bioconductor
ADD COMMENT
0
Entering edit mode
Hi, I have Linux Fedora 32 bit with 512 RAM I would like to use Rgraphviz package.so, I did: $ [root@localhost packages]# rpm -i graphviz-1.12-1.i386.rpm package graphviz-1.12-1 is already installed [root@localhost packages]# R CMD INSTALL -l /usr/local/lib/R/library Rgraphviz_1.4.0.tar.gz --------------------------------------------- * Installing *source* package 'Rgraphviz' ... ** libs gcc -I/usr/local/lib/R/include `dotneato-config --cflags` -I/usr/local/include -D__NO_MATH_INLINES -mieee-fp -Wall -fPIC -g -O2 -c Rgraphviz.c -o Rgraphviz.o In file included from /usr/local/include/graphviz/render.h:45, from common.h:21, from Rgraphviz.c:1: /usr/local/include/graphviz/macros.h:34:1: warning: "NEW" redefined In file included from common.h:13, from Rgraphviz.c:1: /usr/local/lib/R/include/Rdefines.h:129:1: warning: this is the location of the previous definition Rgraphviz.c: In function `Rgraphviz_agopen': Rgraphviz.c:244: warning: implicit declaration of function `GD_gvc' Rgraphviz.c:244: error: invalid lvalue in assignment make: *** [Rgraphviz.o] Error 1 ERROR: compilation failed for package 'Rgraphviz' ** Removing '/usr/local/lib/R/library/Rgraphviz' ----------------------------------------------------- anyone has this before....? thanks, Saurin
ADD REPLY
0
Entering edit mode
On Thu, 23 Sep 2004, Saurin Jani wrote: > Rgraphviz.c: In function `Rgraphviz_agopen': > Rgraphviz.c:244: warning: implicit declaration of > function `GD_gvc' > Rgraphviz.c:244: error: invalid lvalue in assignment > make: *** [Rgraphviz.o] Error 1 > ERROR: compilation failed for package 'Rgraphviz' > ** Removing '/usr/local/lib/R/library/Rgraphviz' > ----------------------------------------------------- > anyone has this before....? First: Please quite CC'ing R-devel on these emails, I'm sure they don't really appreciate questions about Bioconductor packages there. That being said, I'm fairly certain that you are picking up graphviz headers that you don't think you're picking up as this is the first time that you've got things setup in such a way that it actually should work ... I know that in one of your offlist emails you had quite a lot of RPM problems between, either from graphviz or from your system administration - did you manage to get those properly sorted out? This could quite likely be the source of your problem. Do you have the devel RPMs installed as well? this could also be it.
ADD REPLY
0
Entering edit mode
@vincent-j-carey-jr-4
Last seen 10 weeks ago
United States
> Dear all, > > I have a programming problem with R, but in connection with arrays: > My goal is to extract just some columns (for which I have the label of > each) of an object of exprsSet type: the resulting object of the expresso() > command from the affy package. > > To be precise, let's say that I have 12 arrays, so my exprsSet object is a > matrix of some thousands of lines by 12 columns. > > My problem is that I don't have the rank of the columns I want to extract, > but just the labels. > Let's say I have a matrix of 12 colums labelled "sample1" to sample12". I > want to extract the columns labelled "sample1", sample4" and sample6", > which are non contiguous on my exprsSet matrix, in order to create a new > matrix with these columns only. the exprSet structure is designed to make such operations extremely simple. to illustrate, consider the example exprSet called eset in Biobase library(Biobase) data(eset) colnames(exprs(eset)) now you will see that the column names are the letters A-Z for this example; in your case, they should be sample1-sample12 in some arbitrary order suppose I just want the columns "D", "H", "J": eset2 <- eset[, c("D", "H", "J")] eset2 is now the desired exprSet [if for some reason your exprSet lacks column labels in the exprs component, you can add them, but be sure to add the same labels as the rownames(pData(yourEset))]
ADD COMMENT

Login before adding your answer.

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