diff 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
line wrap: on
line diff
--- a/NmrBucketing_script.R	Fri Apr 08 10:56:14 2016 -0400
+++ b/NmrBucketing_script.R	Mon Jul 04 11:51:22 2016 -0400
@@ -206,8 +206,11 @@
 
     if (graph == "Overlay")
     {
+      x <- 1:length(BucketedData[,1])
       ymax <- max(bucketedSpectra)
-      plot(1:length(bucketedSpectra[,1]),bucketedSpectra[,1],ylim=c(0,ymax),type='l',col=1,xlab="Chemical shift",ylab="Intensity")
+      plot(x,BucketedData[,1],ylim=c(0,ymax),type='l',col=1,xlab="",xaxt="n",ylab="Intensity")
+      # x-axis labels
+      axis(1, at=seq(1,length(x),by=50),labels=gsub("B","",rownames(BucketedData)[seq(1,length(x),by=50)]), las=2)
       for (i in 2:ncol(bucketedSpectra))
       {
         spectre <- bucketedSpectra[,i]
@@ -219,7 +222,9 @@
     {
       for (i in 1:ncol(bucketedSpectra))
       {
-        plot(1:length(bucketedSpectra[,i]),bucketedSpectra[,i],type='l',col=1,xlab="Chemical shift",ylab="Intensity")
+        x <- 1:length(BucketedData[,1])
+        plot(x,bucketedSpectra[,i],type='l',col=1,xlab="",xaxt="n",ylab="Intensity")
+        axis(1, at=seq(1,length(x),by=50),labels=gsub("B","",rownames(BucketedData)[seq(1,length(x),by=50)]), las=2)
       }
     }
     dev.off()