comparison NmrBucketing_script.R @ 2:761312f27add draft

planemo upload for repository https://github.com/workflow4metabolomics/nmr_bucketing commit 32fa2b6914a12c8ee2109183af6d4b3ad60d8f13-dirty
author lecorguille
date Fri, 12 Aug 2016 03:45:27 -0400
parents 301d7adf862e
children 58679e85745f
comparison
equal deleted inserted replaced
1:301d7adf862e 2:761312f27add
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])
210 ymax <- max(bucketedSpectra) 209 ymax <- max(bucketedSpectra)
211 plot(x,BucketedData[,1],ylim=c(0,ymax),type='l',col=1,xlab="",xaxt="n",ylab="Intensity") 210 plot(1:length(bucketedSpectra[,1]),bucketedSpectra[,1],ylim=c(0,ymax),type='l',col=1,xlab="Chemical shift",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)
214 for (i in 2:ncol(bucketedSpectra)) 211 for (i in 2:ncol(bucketedSpectra))
215 { 212 {
216 spectre <- bucketedSpectra[,i] 213 spectre <- bucketedSpectra[,i]
217 lines(spectre,col=i) 214 lines(spectre,col=i)
218 } 215 }
220 } 217 }
221 else 218 else
222 { 219 {
223 for (i in 1:ncol(bucketedSpectra)) 220 for (i in 1:ncol(bucketedSpectra))
224 { 221 {
225 x <- 1:length(BucketedData[,1]) 222 plot(1:length(bucketedSpectra[,i]),bucketedSpectra[,i],type='l',col=1,xlab="Chemical shift",ylab="Intensity")
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)
228 } 223 }
229 } 224 }
230 dev.off() 225 dev.off()
231 } 226 }
232 return(list(bucketedSpectra,sampleMetadata,variableMetadata)) # ,truncatedSpectrum_matrice 227 return(list(bucketedSpectra,sampleMetadata,variableMetadata)) # ,truncatedSpectrum_matrice