comparison lib.r @ 15:77a191e37af4 draft

planemo upload commit 9d47e3b467dbbe0af0d90a937c5e9f2c4b958c4b
author lecorguille
date Mon, 25 Apr 2016 11:06:59 -0400
parents e98ca7f0dcbd
children 85b8351ded6c
comparison
equal deleted inserted replaced
14:e98ca7f0dcbd 15:77a191e37af4
112 return(list("xa"=xa,"diffrep"=diffrep,"variableMetadata"=variableMetadataOri)); 112 return(list("xa"=xa,"diffrep"=diffrep,"variableMetadata"=variableMetadataOri));
113 113
114 } 114 }
115 115
116 116
117 combinexsAnnos_function <- function(xaP, xaN, diffrepP=NULL,diffrepN=NULL,convert_param=FALSE,pos=TRUE,tol=2,ruleset=NULL,keep_meta=TRUE, variableMetadataOutput="variableMetadata.tsv"){ 117 combinexsAnnos_function <- function(xaP, xaN, listOFlistArgumentsP,listOFlistArgumentsN, diffrepP=NULL,diffrepN=NULL,convert_param=FALSE,pos=TRUE,tol=2,ruleset=NULL,keep_meta=TRUE, variableMetadataOutput="variableMetadata.tsv"){
118 118
119 #Load the two Rdata to extract the xset objects from positive and negative mode 119 #Load the two Rdata to extract the xset objects from positive and negative mode
120 cat("\tObject xset from positive mode\n") 120 cat("\tObject xset from positive mode\n")
121 print(xaP) 121 print(xaP)
122 cat("\n") 122 cat("\n")
141 141
142 142
143 143
144 if(pos){ 144 if(pos){
145 xa=xaP 145 xa=xaP
146 listOFlistArgumentsP=listOFlistArguments
146 mode="neg. Mode" 147 mode="neg. Mode"
147 } else { 148 } else {
148 xa=xaN 149 xa=xaN
150 listOFlistArgumentsN=listOFlistArguments
149 mode="pos. Mode" 151 mode="pos. Mode"
150 } 152 }
151 peakList=getPeaklist(xa,intval=listArguments[["intval"]]) 153 intval = "into"; for (steps in names(listOFlistArguments)) { if (!is.null(listOFlistArguments[[steps]]$intval)) intval = listOFlistArguments[[steps]]$intval }
154 peakList=getPeaklist(xa,intval=intval)
152 peakList=cbind(groupnames(xa@xcmsSet),peakList); colnames(peakList)[1] = c("name"); 155 peakList=cbind(groupnames(xa@xcmsSet),peakList); colnames(peakList)[1] = c("name");
153 variableMetadata=cbind(peakList, cAnnot[, c("isotopes", "adduct", "pcgroup",mode)]); 156 variableMetadata=cbind(peakList, cAnnot[, c("isotopes", "adduct", "pcgroup",mode)]);
154 variableMetadata=variableMetadata[,!(colnames(variableMetadata) %in% c(sampnames(xa@xcmsSet)))] 157 variableMetadata=variableMetadata[,!(colnames(variableMetadata) %in% c(sampnames(xa@xcmsSet)))]
155 158
156 #Test if there are more than two classes (conditions) 159 #Test if there are more than two classes (conditions)