marrayQuality & marray : empty ?
2
0
Entering edit mode
@ghislaine-guigon-749
Last seen 9.6 years ago
hi, I have a control column : "ctl" in gal file with control information, and I define maLayout like this : manip.layout <- read.marrayLayout(fname=file.gal,ngr=ngr,ngc=ngc,nsr=nsr,nsc=nsc,skip= skip, ctl.col = "ctl") x <- as.character(maInfo(manip.gnames)[,"ctl"]) y <- rep("probes", maNspots(manip.layout)) y[x == "control"] <- "control" slot(manip.layout, "maControls") <- as.factor(y) By this way, fonction maQualityPlots from the marrayQuality package creates DotPlots with control spots (in green) but not with empty spots. How and where empty spots are they defined in the marray format ? thanks
marray marray • 982 views
ADD COMMENT
0
Entering edit mode
Ian Jeffery ▴ 30
@ian-jeffery-789
Last seen 9.6 years ago
Hi, I have a programming problem that I have ran into once or twice before Using the command ls returns the names of the files in the active R environment. I need to use the data contained in these files but ls() only returns the names of the files. I'm wondering if there is a function that can be used to access the data? An example of the problem is as follows. > ag<-1:10 > bu<-c('h','e','l','p') > Ci<-ag > length(ag) [1] 10 > length(ls()[1]) [1] 1 > ls()[1] [1] "ag" The length of ag is 10 but the length of its name is 1. How do I get the length command to look at the data instead of the name? Thanks Ian
ADD COMMENT
0
Entering edit mode
On Mar 1, 2005, at 8:32 AM, Ian Jeffery wrote: > Hi, > > I have a programming problem that I have ran into once or twice > before > Using the command ls returns the names of the files in the active R > environment. I need to use the data contained in these files but ls() > only > returns the names of the files. I'm wondering if there is a function > that > can be used to access the data? > An example of the problem is as follows. > >> ag<-1:10 >> bu<-c('h','e','l','p') >> Ci<-ag >> length(ag) > [1] 10 >> length(ls()[1]) > [1] 1 >> ls()[1] > [1] "ag" > > The length of ag is 10 but the length of its name is 1. How do I get > the > length command to look at the data instead of the name? > sapply(ls(),function(x) {length(get(x))}) See ?get. However, you may also want to consider using a list. I think this is tangentially covered by an R-FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html Look at 7.21. Sean
ADD REPLY
0
Entering edit mode
You can use get(name, environment) with name a character string. So the length example can be solved with length(get("ag")) # the default environment is the workspace In case name is a vector (and not just a single name), you can use mget(name.vector, environment) which will return a list of objects. This is basically what you use to access the annotation objects in Bioconductor. For the whole deal: if you want to do the reverse: create an object of name "name" with a value, you use assign(name, value, environment). In this case the vectorized version is called multiassign. Kasper On Tue, Mar 01, 2005 at 01:32:49PM +0000, Ian Jeffery wrote: > Hi, > > I have a programming problem that I have ran into once or twice before > Using the command ls returns the names of the files in the active R > environment. I need to use the data contained in these files but ls() only > returns the names of the files. I'm wondering if there is a function that > can be used to access the data? > An example of the problem is as follows. > > > ag<-1:10 > > bu<-c('h','e','l','p') > > Ci<-ag > > length(ag) > [1] 10 > > length(ls()[1]) > [1] 1 > > ls()[1] > [1] "ag" > > The length of ag is 10 but the length of its name is 1. How do I get the > length command to look at the data instead of the name? > > Thanks > Ian > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor -- Kasper Daniel Hansen, Research Assistant Department of Biostatistics, University of Copenhagen
ADD REPLY
0
Entering edit mode
Paquet, Agnes ▴ 500
@paquet-agnes-807
Last seen 9.6 years ago
Hi, marray is using a reference table named controlCode to check the control status of the spotted probes. controlCode is a matrix with 2 columns named: Pattern and Name. You can check the default controlCode by typing in R: library(marray) controlCode Pattern Name 1 "Buffer" "Buffer" 2 "Empty" "Empty" 3 "EMPTY" "Empty" 4 "AT" "Negative" 5 "NC" "Negative" 6 "M200009348" "Positive" 7 "M200012700" "Positive" 8 To specify your own controls, you have to create your own controlCode matrix. This can be done by either using the readcontrolCode function in marray or by reading a tab-delimited text file directly. controlCode <- as.matrix(read.table("mycontrolCode.txt", sep="\t",header=TRUE, quote="\"", fill=TRUE))) Then, you can fill up the maControls slot by calling the function maGenControls. It is easier to use read.Galfile instead of read.marrayLayout and read.marrayInfo to read your array information. You will need to add your control column name in the info.id argument: Assume mraw is a marrayRaw object: test <- read.Galfileinfo.id = c("ID", "Name", "ctl")) maLayout(mraw) <- test$layout maGnames(mraw) <- test$gnames Then, you can define your controls using the function maGenControls, specifying your control column in the id argument: maControls(mraw) <- maGenControls(Gnames, controlcode=newControlCode, id = "correctCtlID") Regards, Agnes -----Original Message----- From: bioconductor-bounces@stat.math.ethz.ch [mailto:bioconductor-bounces@stat.math.ethz.ch] On Behalf Of Ghislaine Guigon Sent: Tuesday, March 01, 2005 4:46 AM To: bioconductor@stat.math.ethz.ch Subject: [BioC] marrayQuality & marray : empty ? hi, I have a control column : "ctl" in gal file with control information, and I define maLayout like this : manip.layout <- read.marrayLayout(fname=file.gal,ngr=ngr,ngc=ngc,nsr=nsr,nsc=nsc,skip= sk ip, ctl.col = "ctl") x <- as.character(maInfo(manip.gnames)[,"ctl"]) y <- rep("probes", maNspots(manip.layout)) y[x == "control"] <- "control" slot(manip.layout, "maControls") <- as.factor(y) By this way, fonction maQualityPlots from the marrayQuality package creates DotPlots with control spots (in green) but not with empty spots. How and where empty spots are they defined in the marray format ? thanks _______________________________________________ Bioconductor mailing list Bioconductor@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/bioconductor
ADD COMMENT

Login before adding your answer.

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