comparison NmrBucketing_script.R @ 1:301d7adf862e draft

planemo upload for repository https://github.com/workflow4metabolomics/nmr_bucketing commit df8740e6849320412c96468d3c99830b25b9f0d6
author lecorguille
date Mon, 04 Jul 2016 11:51:22 -0400
parents a99a6026c972
children 761312f27add
comparison
equal deleted inserted replaced
0:a99a6026c972 1:301d7adf862e
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(BucketedData[,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,BucketedData[,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(BucketedData)[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(BucketedData[,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(BucketedData)[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