diff nmr_alignement/NmrAlignment_script.R @ 4:265ee538e120 draft default tip

Uploaded
author marie-tremblay-metatoul
date Wed, 09 Aug 2017 06:28:10 -0400
parents 908e1345d7ca
children
line wrap: on
line diff
--- a/nmr_alignement/NmrAlignment_script.R	Wed Apr 12 04:32:23 2017 -0400
+++ b/nmr_alignement/NmrAlignment_script.R	Wed Aug 09 06:28:10 2017 -0400
@@ -202,8 +202,10 @@
     pList[[i]] = sort(pList[[i]])
     if (verbose) 
       cat("\n Spectrum ", i, " has ", length(pList[[i]]), 
-          " peaks")
+          " peaks \n")
+      cat(myPeakRes)
   }
+  cat("\n")
   return(pList)
 }
 
@@ -368,18 +370,19 @@
                             verbose)
 {
   ## Peak picking
-  cat("\n detect peaks....")
+  cat("\t PEAK DETECTION \n")
   startTime <- proc.time()
   peakList <- detectSpecPeaks(X=data, nDivRange=nDivRange, scales=scales, baselineThresh=baselineThresh,  
                               SNR.Th = SNR.Th, verbose=verbose)
   endTime <- proc.time()
-  cat("Peak detection time:",(endTime[3]-startTime[3])/60," minutes")
+  cat("\t Peak detection time:",(endTime[3]-startTime[3])/60," minutes \n")
+  cat("\n")
 
   ## Reference spectrum determination
   if (reference == 0)
   {
-    cat("\n Find the spectrum reference...")
-    resFindRef<- findRef(peakList)
+    cat("\t DETERMINATION OF THE REFERENCE SPECTRUM \n")
+    resFindRef <- findRef(peakList)
     refInd <- resFindRef$refInd
     cat("\n Order of spectrum for reference \n")
     for (i in 1:length(resFindRef$orderSpec))
@@ -388,15 +391,19 @@
       if (i %% 10 == 0) 
         cat("\n")
     }
-    cat("\n The reference is: ", refInd)
+	cat("\n")
+	cat("\t Reference spectrum:", refInd, "\n")
+    cat("\n")
   }
   else
   {
     refInd=reference
   }
   ## Spectra alignment to the reference
+  cat("\t SPECTRA ALIGNMENT")
   maxshift <- 50
   Y <- dohCluster(data, peakList=peakList, refInd=refInd, maxShift=maxShift, acceptLostPeak, verbose)
+  cat("\n")
 
   ## Output  
   return(Y)