reg Golub Data set
2
0
Entering edit mode
dibakar ray ▴ 40
@dibakar-ray-413
Last seen 9.6 years ago
Recently I have started working with R and bioconductor package. I was going through the documentation and tutorial availbale at bioconductor site. In one of the tutorial the following commands are shown - LS<-exprs(golubTrain) cl<-golubTrain$ALL.AML TS<-exprs(golubTest) clts<-golubTest$ALL.AML ##mmfilt is in the library LS[LS<100]<-100 TS[TS<100]<-100 LS[LS>16000]<-16000 TS[TS>16000]<-16000 mmfilt <- function(r=5, d=500, na.rm=TRUE) { function(x) { minval <- min(x, na.rm=na.rm) maxval <- max(x, na.rm=na.rm) (maxval/minval > 5) && (maxval-minval > 500) } } mmfun <- mmfilt() ffun <- filterfun(mmfun) good <- genefilter(cbind(LS, TS), ffun ) sum(good) ##I get 3571 LSsub <- log10(LS[good,]) TSsub <- log10(TS[good,]) LTsub <- cbind(LSsub, TSsub) ============= My question is realted to the object good. If I use typeof(good), it shows logical. So what I understand is good is a logical vector. But when I type good at the R prompt, it gives me a list of gene name along with TRUE FALSE value. My understanding of logical vector is that it contains elements which are TRUE or FALSE. So my question is how gene names are accomodated into good. Thanks Dibakar Ray
• 797 views
ADD COMMENT
0
Entering edit mode
@wolfgang-huber-3550
Last seen 3 months ago
EMBL European Molecular Biology Laborat…
Hi - vectors in R can, in addition to their values, also have a "names" attribute, which is a character vector of the same length. See the help page for "names": ? names As far as I know, you cannot recurse this, i.e. the names vector itself cannot have names. Best, Wolfgang ------------------------------------- Wolfgang Huber Division of Molecular Genome Analysis German Cancer Research Center Heidelberg, Germany Phone: +49 6221 424709 Fax: +49 6221 42524709 Http: www.dkfz.de/mga/whuber ------------------------------------- > ============= > My question is realted to the object good. If I use typeof(good), it shows > logical. So what I understand is good is a logical vector. > > But when I type good at the R prompt, it gives me a list of gene name > along with TRUE FALSE value. > My understanding of logical vector is that it contains elements which are > TRUE or FALSE. So my question is how gene names are accomodated into good. > Thanks > Dibakar Ray > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://www.stat.math.ethz.ch/mailman/listinfo/bioconductor >
ADD COMMENT
0
Entering edit mode
@rafael-a-irizarry-205
Last seen 9.6 years ago
in R you can use characters as indexes. for vectors and lists you can use the names function to assign these. for matrices you an use colnames and rownames. and for arrays you canuse dimnames. for example: x <- c(TRUE,FALSE,TRUE) names(x) <- c("a","b","c") show(x) On Tue, 2 Sep 2003, Dibakar Ray wrote: > > Recently I have started working with R and bioconductor package. > I was going through the documentation and tutorial availbale at > bioconductor site. In one of the tutorial the following commands are shown > - > LS<-exprs(golubTrain) > cl<-golubTrain$ALL.AML > TS<-exprs(golubTest) > clts<-golubTest$ALL.AML > ##mmfilt is in the library > LS[LS<100]<-100 > TS[TS<100]<-100 > LS[LS>16000]<-16000 > TS[TS>16000]<-16000 > mmfilt <- function(r=5, d=500, na.rm=TRUE) { > function(x) { > minval <- min(x, na.rm=na.rm) > maxval <- max(x, na.rm=na.rm) > (maxval/minval > 5) && (maxval-minval > 500) > } > } > mmfun <- mmfilt() > ffun <- filterfun(mmfun) > good <- genefilter(cbind(LS, TS), ffun ) > sum(good) ##I get 3571 > LSsub <- log10(LS[good,]) > TSsub <- log10(TS[good,]) > LTsub <- cbind(LSsub, TSsub) > ============= > My question is realted to the object good. If I use typeof(good), it shows > logical. So what I understand is good is a logical vector. > > But when I type good at the R prompt, it gives me a list of gene name > along with TRUE FALSE value. > My understanding of logical vector is that it contains elements which are > TRUE or FALSE. So my question is how gene names are accomodated into good. > Thanks > Dibakar Ray > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://www.stat.math.ethz.ch/mailman/listinfo/bioconductor >
ADD COMMENT

Login before adding your answer.

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