#check results with: class(z); exprs(z); pData(z); fData(z); annotation(z)
x <- matrix(runif(4 * 7, min = -1, max = 1), 4, 7)
y <- matrix(runif(4 * 7, min = -1, max = 1), 4, 7)
#data matrix without names, with rows and columns with nonfinite elements
x[1, ] <- NA; x[, 2] <- Inf; x[, 4] <- NaN
z0 <- nxprnSetPair(x = x, y = y, paired = TRUE, annot = c("mutant", "wild"))
z1 <- xprnSetPair(x = x, y = y)
#data matrix with duplicated sample names
colnames(x) <- paste("C", 1:ncol(x), sep="")
colnames(x)[c(7, 3, 5)] <- colnames(x)[1]
z2<-nxprnSetPair(x = x, y = y ,paired = FALSE)
#data matrix with fdata and pdata (matrix, character and data.frame) specified:
pDx <- cbind(class.1 = rep("rat.A", ncol(x)),
class.2 = c(rep("rat.C", 3), rep("rat.B", ncol(x) - 3)))
pDy <- data.frame(class.1 = rep("rat.B", ncol(y)))
z3 <- nxprnSetPair(x = x, y = y, x.pdata = pDx, y.pdata = pDy, fdata = "lip.A",
annot = c("mutant","wild"))
#from XprnSets:
fD<-data.frame(class.1=c(rep("lipidA",2),rep("lipidB",nrow(x)-2)))
xfD<-data.frame(class.x=c(rep("A",3),rep("B",nrow(x)-3)))
yfD<-data.frame(class.y=c(rep("CA",1),rep("CB",nrow(y)-1)))
zX<-nXprnSet(x=abs(x),fdata="lipids",pdata="sick",annot="ratsA")
zY<-nXprnSet(x=abs(y),fdata=fD,pdata="healthy",annot="ratsB")
z4<-nxprnSetPair(x=zX,y=zY,paired=FALSE,annot=c("A","B"))
z5<-nxprnSetPair(x=zX,y=zY,x.fdata=xfD,y.fdata=yfD,fdata=fD)
#if x input data is XprnSet and y is missing log will be made:
pDx <- data.frame(rat.type = c(rep("rat.C", 3), rep("rat.B", ncol(x) - 3)))
zX <- nXprnSet(abs(x), pdata = pDx)
zx <- nxprnSet(abs(x), pdata = pDx)
z4 <- xprnSetPair(x = zX, factor.name = "rat.type")
z5 <- nxprnSetPair(x = zx, factor.name = "rat.type")
Run the code above in your browser using DataLab