[BioC] marrayInput problems following fresh 1.2 install
Rafael A. Irizarry
ririzarr at jhsph.edu
Thu Jun 19 10:28:31 MEST 2003
this is a bug (that only affects windows users). the fix should appear
soon. in the meantime you can use the code below.
the difference is line 6 (descript <- ...)
read.marrayInfo <- function (fname, info.id = NULL, labels = NULL,
notes = fname,
sep = " ", skip = 0, quote = "", ...)
{
h <- strsplit(readLines(fname, n = skip + 1), split = sep)
h <- as.list(unlist(h[[length(h)]]))
names(h) <- gsub("\"", "", unlist(h))
dat <- read.table(fname, sep = sep, skip = skip + 1, fill = TRUE,
quote = quote, ...)
colnames(dat) <- h
descript <- new("marrayInfo", maInfo=data.frame(),maNotes = notes)
if (is.null(info.id))
info.id <- 1:ncol(dat)
maInfo(descript) <- as.data.frame(dat[, info.id])
if (length(labels) == nrow(dat))
maLabels(descript) <- as.vector(labels)
else {
if (is.null(labels))
labels <- 1
maLabels(descript) <- as.character(as.vector(dat[, labels]))
}
return(descript)
}
-r
On Thu, 19 Jun 2003, Barry
Henderson wrote:
> Hi
>
> I just installed R 1.71 and BioC to 1.2. Under this configuration BioC
> fails to to read in data/sample info. If I take the same code and try
> it with my previous installation (R 1.62 and BioC v1.1). I've looked at
> the traceback output but can't make any sense of it. Any suggestions?
> Has anything changed with marrayInfo, classes or the way R is handling
> paths under windows? I haven't been able to locate changes in the
> vignetes or help pages. Code and traceback output below from the new
> installation is below.
>
> Thanks
> Barry
>
> > exp <- "complete"
> > datadir <- paste("C:\\Array Data\\tox\\", exp, sep="")
> > setwd(datadir)
> >
> >
> > library(marrayInput)
> > exp.layout <- read.marrayLayout(fname=file.path(datadir, "genes.txt"),
> ngr= 4, ngc = 4, nsr = 12, nsc = 14, skip=0, ctl.col= 6)
> > ctl <- rep("Control", maNspots(exp.layout))
> > ctl[maControls(exp.layout) != "Control"] <- "normal"
> > maControls(exp.layout) <- factor(ctl)
> >
> > #Load Sample data from samples.txt
> >
> > exp.samples <- read.marrayInfo(file.path(datadir, "samples.txt"), sep
> = "\t")
> Error in validObject(.Object) : Invalid "marrayInfo" object: Invalid
> object for slot "maInfo" in class "marrayInfo": got class "NULL", should
> be or extend class "data.frame"
> > traceback()
> 6: stop(paste("Invalid \"", Class, "\" object: ", errors, sep = ""))
> 5: validObject(.Object)
> 4: initialize(value, ...)
> 3: initialize(value, ...)
> 2: new("marrayInfo", maNotes = notes)
> 1: read.marrayInfo(file.path(datadir, "samples.txt"), sep = " ")
> >
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://www.stat.math.ethz.ch/mailman/listinfo/bioconductor
>
More information about the Bioconductor
mailing list