Rarmec-package {Rarmec} | R Documentation |
Set of functions to query ARMeC directly from the data analysis process - This is why it is in R! This is a first version and would probably improvements.
Package: | Rarmec |
Type: | Package |
Version: | 1.0 |
Date: | 2007-09-18 |
License: | GPL version 2. |
David Enot
### Real example using Brachypodium from the FIEmspro package library(Rarmec) library(FIEmspro) library(gplots) ### used in ar.corplot ### Select classes 1 and 2 data(abr1) dat <- abr1$pos[,110:1000] l=which(abr1$fact$class==1 | abr1$fact$class==2) y <- factor(abr1$fact$class[l]) x <- preproc(dat[l,],y, method=c("log10","TICnorm")) #### Use randomForest to rank variables res=fs.rf(x,y,ntree=2000) #### Select variables with importance score >0.003 lvar=names(which(res$stats>0.003)) #### who are they? print(lvar) #### Let's retrieve all possible solutions ## measured adducts is enough for the time being all.sol<-ar.getlist(lvar,type="meas") #### Let's dump them in a CSV file for Excel manipulation write.table(all.sol,"tmp-allsolutions.csv",row.names=FALSE,sep=",") #### Perform cluster analysis and plot clustering analysis result hc<-ar.clust(x,lvar,method="complete") #### plot overall correlation matrix ## Not run: ar.corplot(hc,x) #### Retrieve candidates for those adducts have been measured ### Dissimilarity is set to 0.3 to form the clusters cl.res=ar.splitcl(hc,all.sol,x,h=0.3) #### Output in the console only nominal masses in each cluster ar.writecl(cl.res,icl = NULL, cor.mat = FALSE, armec.mat = FALSE) #### Output in the console guesses for cluster 1 and 2 except the pathway ar.writecl(cl.res,icl = c(1,2), cor.mat = FALSE, armec.mat = TRUE, path=FALSE) #### Output in the console guesses for cluster 1 with correlation matrices ## but no pathway information ar.writecl(cl.res,icl = 1, cor.mat = TRUE, armec.mat = TRUE, path=FALSE) #### Dump everything in file="tmp-ex-armec.csv" ar.writecl(cl.res,file="tmp-ex-armec.csv")