comparison NmrBucketing_script.R @ 3:58679e85745f draft

planemo upload for repository https://github.com/workflow4metabolomics/nmr_bucketing commit 7cd224b2cbddcb2535640a3f76194bd235acb602-dirty
author lecorguille
date Fri, 12 Aug 2016 05:47:27 -0400
parents 761312f27add
children d61f6ceef5d6
comparison
equal deleted inserted replaced
2:761312f27add 3:58679e85745f
204 # Graphic Device opening 204 # Graphic Device opening
205 pdf(nomFichier,onefile=TRUE) 205 pdf(nomFichier,onefile=TRUE)
206 206
207 if (graph == "Overlay") 207 if (graph == "Overlay")
208 { 208 {
209 x <- 1:length(bucketedSpectra[,1])
209 ymax <- max(bucketedSpectra) 210 ymax <- max(bucketedSpectra)
210 plot(1:length(bucketedSpectra[,1]),bucketedSpectra[,1],ylim=c(0,ymax),type='l',col=1,xlab="Chemical shift",ylab="Intensity") 211 plot(x,bucketedSpectra[,1],ylim=c(0,ymax),type='l',col=1,xlab="",xaxt="n",ylab="Intensity")
212 # x-axis labels
213 axis(1, at=seq(1,length(x),by=50),labels=gsub("B","",rownames(bucketedSpectra)[seq(1,length(x),by=50)]), las=2)
211 for (i in 2:ncol(bucketedSpectra)) 214 for (i in 2:ncol(bucketedSpectra))
212 { 215 {
213 spectre <- bucketedSpectra[,i] 216 spectre <- bucketedSpectra[,i]
214 lines(spectre,col=i) 217 lines(spectre,col=i)
215 } 218 }
217 } 220 }
218 else 221 else
219 { 222 {
220 for (i in 1:ncol(bucketedSpectra)) 223 for (i in 1:ncol(bucketedSpectra))
221 { 224 {
222 plot(1:length(bucketedSpectra[,i]),bucketedSpectra[,i],type='l',col=1,xlab="Chemical shift",ylab="Intensity") 225 x <- 1:length(bucketedSpectra[,1])
226 plot(x,bucketedSpectra[,i],type='l',col=1,xlab="",xaxt="n",ylab="Intensity")
227 axis(1, at=seq(1,length(x),by=50),labels=gsub("B","",rownames(bucketedSpectra)[seq(1,length(x),by=50)]), las=2)
223 } 228 }
224 } 229 }
225 dev.off() 230 dev.off()
226 } 231 }
227 return(list(bucketedSpectra,sampleMetadata,variableMetadata)) # ,truncatedSpectrum_matrice 232 return(list(bucketedSpectra,sampleMetadata,variableMetadata)) # ,truncatedSpectrum_matrice