changeset 0:8035235e46c7 draft

Uploaded
author marie-tremblay-metatoul
date Mon, 23 Dec 2019 09:26:20 -0500
parents
children a4d2b1926e13
files nmr_annotation2d/.shed.yml nmr_annotation2d/.travis.yml nmr_annotation2d/BdDReference_COSY.RData nmr_annotation2d/BdDReference_HMBC.RData nmr_annotation2d/BdDReference_HSQC.RData nmr_annotation2d/BdDReference_JRES.RData nmr_annotation2d/BdDReference_NOESY.RData nmr_annotation2d/BdDReference_TOCSY.RData nmr_annotation2d/README.md nmr_annotation2d/README.txt nmr_annotation2d/annotationRmn2D.R nmr_annotation2d/annotationRmn2DGlobale.R nmr_annotation2d/annotationRmn2DWrapper.R nmr_annotation2d/annotationRmn2D_xml.xml nmr_annotation2d/static/2DNMR_Annotation_graph.pdf nmr_annotation2d/static/2DNmr_FileToAnnotate_xlsxFormat.png nmr_annotation2d/static/OutputsExampleMix.png nmr_annotation2d/test-data/2DNMR_Annotation_annotationCombination.tabular nmr_annotation2d/test-data/2DNMR_Annotation_log.txt nmr_annotation2d/test-data/Template_melange.xlsm nmr_annotation2d/test-data/annotationHsqc.tabular nmr_annotation2d/test-data/annotationJres.tabular nmr_annotation2d/test-data/duplicateHsqc.tabular nmr_annotation2d/test-data/duplicateJres.tabular
diffstat 24 files changed, 1854 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nmr_annotation2d/.shed.yml	Mon Dec 23 09:26:20 2019 -0500
@@ -0,0 +1,7 @@
+categories: [Metabolomics]
+description: '[Metabolomics][W4M][NMR] BARSA - BidimensionAl nmR Spectra Annotation'
+homepage_url: http://workflow4metabolomics.org
+long_description: 'Part of the W4M project: http://workflow4metabolomics.org'
+name: 2DNmrAnnotation
+owner: marie-tremblay-metatoul
+remote_repository_url: https://github.com/workflow4metabolomics/nmr_annotation2d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nmr_annotation2d/.travis.yml	Mon Dec 23 09:26:20 2019 -0500
@@ -0,0 +1,17 @@
+
+# This is a special configuration file to run tests on Travis-CI via
+# GitHub notifications when changes are committed.
+#
+# See http://travis-ci.org/ for details
+language: python
+
+before_install:
+ - sudo apt-get install -y python-virtualenv
+ - virtualenv planemo-venv
+ - . planemo-venv/bin/activate
+ - pip install --upgrade pip setuptools
+ - pip install planemo==0.37.0
+
+script:
+ - planemo lint ${TRAVIS_BUILD_DIR}/galaxy/2DNmrAnnotation/
+# - planemo test --conda_auto_init --conda_auto_install --conda_dependency_resolution --galaxy_branch release_17.01 --no_cache_galaxy ${TRAVIS_BUILD_DIR}/galaxy/2DNmrAnnotation/
Binary file nmr_annotation2d/BdDReference_COSY.RData has changed
Binary file nmr_annotation2d/BdDReference_HMBC.RData has changed
Binary file nmr_annotation2d/BdDReference_HSQC.RData has changed
Binary file nmr_annotation2d/BdDReference_JRES.RData has changed
Binary file nmr_annotation2d/BdDReference_NOESY.RData has changed
Binary file nmr_annotation2d/BdDReference_TOCSY.RData has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nmr_annotation2d/README.md	Mon Dec 23 09:26:20 2019 -0500
@@ -0,0 +1,54 @@
+Bidimensional NMR annotation for Galaxy
+=======================================
+
+[![bioconda-badge](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat-square)](http://bioconda.github.io) [![Build Status](https://travis-ci.org/workflow4metabolomics/2DNmrAnnotation.svg?branch=master)](https://travis-ci.org/workflow4metabolomics/2DNmrAnnotation)
+
+Our project
+-----------
+The [Workflow4Metabolomics](http://workflow4metabolomics.org), W4M in short, is a French infrastructure offering software tool processing, analyzing and annotating metabolomics data. It is based on the Galaxy platform.
+
+
+BARSA
+-----
+
+Algorithm for Bidimensional NMR Spectra Annotation
+
+Galaxy
+------
+Galaxy is an open, web-based platform for data intensive biomedical research. Whether on the free public server or your own instance, you can perform, reproduce, and share complete analyses. 
+
+Homepage: [https://galaxyproject.org/](https://galaxyproject.org/)
+
+
+Dependencies using Conda
+------------------------
+[![bioconda-badge](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat-square)](http://bioconda.github.io)
+
+The main recipe: [https://github.com/bioconda/bioconda-recipes/tree/master/recipes/r-ptw](https://github.com/bioconda/bioconda-recipes/tree/master/recipes/r-ptw)
+
+```
+#To install miniconda2
+#http://conda.pydata.org/miniconda.html
+#To install the needed R library using conda:
+conda install r-batch r-dplyr r-ggplot2 r-openxlsx r-stringr r-tidyr
+
+#To set an environment:
+conda create -n 2DNmrAnnotation r-dplyr r-ggplot2 r-openxlsx r-stringr r-tidyr
+
+#To activate the environment:
+. activate 2DNmrAnnotation
+```
+
+[Conda](http://conda.pydata.org/) is package manager that among many other things can be used to manage Python packages.
+
+Travis
+------
+[![Build Status](https://travis-ci.org/workflow4metabolomics/2DNmrAnnotation.svg?branch=master)](https://travis-ci.org/workflow4metabolomics/2DNmrAnnotation)
+
+Test and Deploy with Confidence. Easily sync your GitHub projects with Travis CI and you'll be testing your code in minutes!
+
+Historic contributors
+---------------------
+ - Marie Tremblay-Franco @mtremblayfr - [French Metabolomics and Fluxomics Infrastructure (MetaboHUB)](http://www.metabohub.fr/en) - [MetaToul](http://www.metatoul.fr/)
+ - Coline Gardou
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nmr_annotation2d/README.txt	Mon Dec 23 09:26:20 2019 -0500
@@ -0,0 +1,53 @@
+2D-NMR annotation for Galaxy
+============================
+
+[![bioconda-badge](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat-square)](http://bioconda.github.io) [![Build Status](https://travis-ci.org/workflow4metabolomics/nmr_annotation2d.svg?branch=master)](https://travis-ci.org/workflow4metabolomics/nmr_annotation2d)
+
+Our project
+-----------
+The [Workflow4Metabolomics](http://workflow4metabolomics.org), W4M in short, is a French infrastructure offering software tool processing, analyzing and annotating metabolomics data. It is based on the Galaxy platform.
+
+
+2D-NMR annotation
+-----------------
+
+Annotation of 2D NMR spectra
+
+Galaxy
+------
+Galaxy is an open, web-based platform for data intensive biomedical research. Whether on the free public server or your own instance, you can perform, reproduce, and share complete analyses. 
+
+Homepage: [https://galaxyproject.org/](https://galaxyproject.org/)
+
+
+Dependencies using Conda
+------------------------
+[![bioconda-badge](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat-square)](http://bioconda.github.io)
+
+The main recipe: [https://github.com/bioconda/bioconda-recipes/tree/master/recipes/r-ptw](https://github.com/bioconda/bioconda-recipes/tree/master/recipes/r-ptw)
+
+```
+#To install miniconda2
+#http://conda.pydata.org/miniconda.html
+#To install the needed R library using conda:
+conda install r-batch r-ptw
+#To set an environment:
+conda create -n nmr_annotation2d r-batch openxlsx dplyr tidyr ggplot2 colormap stringr`
+
+#To activate the environment:
+. activate nmr_annotation2d
+```
+
+[Conda](http://conda.pydata.org/) is package manager that among many other things can be used to manage Python packages.
+
+Travis
+------
+[![Build Status](https://travis-ci.org/workflow4metabolomics/nmr_annotation2d.svg?branch=master)](https://travis-ci.org/workflow4metabolomics/nmr_annotation2d)
+
+Test and Deploy with Confidence. Easily sync your GitHub projects with Travis CI and you'll be testing your code in minutes!
+
+Historic contributors
+---------------------
+ - Marie Tremblay-Franco @mtremblayfr - [French Metabolomics and Fluxomics Infrastructure (MetaboHUB)](http://www.metabohub.fr/en) - [MetaToul](http://www.metatoul.fr/)
+ - Coline Gardou
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nmr_annotation2d/annotationRmn2D.R	Mon Dec 23 09:26:20 2019 -0500
@@ -0,0 +1,246 @@
+###########################################################################################################################################
+# ANNOTATION SPECTRE 2D MATRICE COMPLEXE BASEE SUR UNE SEQUENCE RMN                                                                       #
+# matriceComplexe : data.frame liste couples ppm de la matrice a annoter                                                                  #
+# BdDStandards : objet contenant la base de donnees des composes standards                                                                #
+# nom_séquence : nom sequence 2D a utiliser pour annotation ("JRES","COSY","TOCSY","HMBC","HSQC")                                         #
+# ppm1Tol : tolerance ppm axe abscisses                                                                                                   #
+# ppm2Tol : tolerance ppm axe ordonnees                                                                                                   #
+# nb_ligne_template : préciser le nombre total de ligne de la feuille de calcul à annoter                                                 #
+###########################################################################################################################################
+annotationRmn2D <- function(matriceComplexe, BdDStandards, nom_sequence, ppm1Tol=0.01, ppm2Tol=0.01, 
+                            seuil=0, unicite="NO")
+{
+  ## Longueur de la peak-list de la matrice a annoter
+  PeakListLength <- length(matriceComplexe[, 1])
+
+  ## Nombre de metabolites inclus dans BdD de composes standards
+  nbMetabolitesBdD <- length(BdDStandards)
+  matrixAnnotation <- data.frame()
+  allMetabolitesList <- data.frame()
+  seuil_score <- seuil
+  
+  ## Boucle sur les metabolites inclus dans BdD
+  for (i in 1:nbMetabolitesBdD)
+  {
+    ## Infos metabolite en cours
+    iMetabolite <- BdDStandards[[i]]
+    ppm1M <- iMetabolite[,1] 
+    ppm2M <- iMetabolite[,2]
+    nbPeakMetabolite <- length(ppm1M)
+    MetaboliteName <- names(BdDStandards[i])
+##    print(MetaboliteName)
+    ## Initialisation
+    k <- 0
+    presenceScore <- 0
+    annotatedPpmRef <- data.frame()
+    annotatedPpmList <- data.frame()
+    annotatedPeakLength <- 0
+    metabolites <- data.frame()
+    metabolitesList <- data.frame()
+  
+    ## Boucle sur les couples de pics de la matrice a annoter
+    for (p in 1:PeakListLength)
+    { 
+      ppmAnnotationF1 <- as.numeric(matriceComplexe[p, 3])
+      ppmAnnotationF2 <- as.numeric(matriceComplexe[p, 2])
+      e <- simpleMessage("end of file")
+      tryCatch({
+        if (!is.na(ppmAnnotationF1))
+        {
+          matrixAnnotation <- unique.data.frame(rbind.data.frame(matrixAnnotation, matriceComplexe[p, ]))
+        }
+        # Recherche du couple de pics de la matrice la liste des couples du metabolite standard
+        metaboliteIn <- (ppm1M >= (ppmAnnotationF2-ppm1Tol) & ppm1M <= (ppmAnnotationF2+ppm1Tol) & 
+                     ppm2M >= (ppmAnnotationF1-ppm2Tol) & ppm2M <= (ppmAnnotationF1+ppm2Tol))
+        WhichMetaboliteIn <- which(metaboliteIn)
+        # Si au moins un couple de la matrice a annoter dans liste couples metabolite standard
+        if (length(WhichMetaboliteIn) > 0)
+        {
+          for (a in 1:length(WhichMetaboliteIn))
+          {
+            annotatedPpmList <- data.frame(ppm1=ppm1M[WhichMetaboliteIn[a]], ppm2=ppm2M[WhichMetaboliteIn[a]], theoricalLength=nbPeakMetabolite)
+            annotatedPpmRef <- rbind(annotatedPpmRef,annotatedPpmList)
+          }
+        }
+      }, error=function(e){cat ("End of file \n");})
+    }
+
+    # Au - 1 couple de ppm de la matrice complexe annote
+    if (nrow(annotatedPpmRef) >= 1)
+    {
+      ## Nombre couples annotes
+      annotatedPeakLength <- nrow(annotatedPpmRef)
+      
+      ## Recherche doublons
+      annotatedDoublons <- duplicated(annotatedPpmRef)
+      if (sum(duplicated(annotatedPpmRef)) > 0)
+      {
+        annotatedPeakLength <- nrow(annotatedPpmRef) - sum(duplicated(annotatedPpmRef))
+        annotatedPpmRef <- annotatedPpmRef[-duplicated(annotatedPpmRef), ]
+      }
+      presenceScore <- annotatedPeakLength/nbPeakMetabolite
+    }
+    
+    ## Conservation metabolites dont score > seuil
+    if (presenceScore > seuil_score)
+    {
+      metabolites <- data.frame(Metabolite=MetaboliteName, score=presenceScore)
+      metabolitesList <- cbind.data.frame(annotatedPpmRef, metabolites) 
+      allMetabolitesList <- rbind.data.frame(allMetabolitesList, metabolitesList)
+    }
+  }
+  
+  # Initialisation
+  commonPpm <- data.frame()
+  commonPpmList <- data.frame()
+  metaboliteAdd <- data.frame()
+  metaboliteAddList <- data.frame()
+#  metabolite_ref <- data.frame()
+  commonMetabolitesList <- data.frame()
+  commonMetabolitesPpmList <- data.frame()
+  commonMetabolitesPpmAllList1 <- data.frame()
+  commonMetabolitesPpmAllList <- data.frame()
+  listeTotale_2D_unicite <- allMetabolitesList[, 1:4]
+  allMetabolitesList <- allMetabolitesList[, -3]
+  metabolitesAllUnicite <- data.frame()
+  
+  ## Boucle sur tous couples annotes
+  for (j in 1:length(allMetabolitesList$ppm1))
+  {
+    ## Boucle sur metabolites dans BdD composes standards
+    for (i in 1:nbMetabolitesBdD)
+    {
+      ppmMetaboliteBdD <- BdDStandards[[i]]
+      ppm1M <- ppmMetaboliteBdD[,1] 
+      ppm2M <- ppmMetaboliteBdD[,2]
+      # Nombre de couples metabolite
+      nbPeakMetabolite <- length(ppm1M)
+      MetaboliteName <- names(BdDStandards[i])
+
+      metabolitesInAll <- (ppm1M >= (allMetabolitesList[j,1]-ppm1Tol) & ppm1M <= (allMetabolitesList[j,1]+ppm1Tol) & 
+                            ppm2M >= (allMetabolitesList[j,2]-ppm2Tol) & ppm2M <= (allMetabolitesList[j,2]+ppm2Tol))
+      WhichMetabolitesInAll <- which(metabolitesInAll)
+
+      if (MetaboliteName != allMetabolitesList[j, 3] & length(WhichMetabolitesInAll) > 0)
+      {
+        metabolitesAllUnicite <- rbind.data.frame(metabolitesAllUnicite, listeTotale_2D_unicite[j,])
+        commonPpm <- data.frame(ppm1=allMetabolitesList[j,1], ppm2=allMetabolitesList[j,2])
+        commonPpmList <- rbind.data.frame(commonPpmList, commonPpm)
+        commonPpmList <- unique(commonPpmList)
+        metaboliteAdd <- data.frame(nom_metabolite=MetaboliteName)
+        metaboliteAddList <- rbind.data.frame(metaboliteAddList, metaboliteAdd)
+#        metabolite_ref <- data.frame(nom_metabolite=allMetabolitesList[j,3])
+        commonMetabolitesList <- rbind.data.frame(data.frame(nom_metabolite=allMetabolitesList[j, 3]), metaboliteAddList)
+        commonMetabolitesPpmList <- cbind.data.frame(commonPpm, commonMetabolitesList)
+        commonMetabolitesPpmAllList1 <- rbind.data.frame(commonMetabolitesPpmAllList1, commonMetabolitesPpmList)
+        commonMetabolitesPpmAllList1 <- unique.data.frame(commonMetabolitesPpmAllList1)
+      }
+    }
+    commonMetabolitesPpmAllList <- rbind.data.frame(commonMetabolitesPpmAllList, commonMetabolitesPpmAllList1)
+    commonMetabolitesPpmAllList <- unique.data.frame(commonMetabolitesPpmAllList)
+    
+    #initialisation des data.frame
+    commonPpm <- data.frame()
+    metaboliteAdd <- data.frame()
+    metaboliteAddList <- data.frame()
+    metabolite_ref <- data.frame()
+    commonMetabolitesList <- data.frame()
+    commonMetabolitesPpmList <- data.frame()
+    commonMetabolitesPpmAllList1 <- data.frame()
+  }
+
+  unicityAllList <- listeTotale_2D_unicite
+  if (nrow(listeTotale_2D_unicite)!=0 & nrow(metabolitesAllUnicite)!=0)
+    unicityAllList <- setdiff(listeTotale_2D_unicite, metabolitesAllUnicite)
+
+  unicitynbCouplesRectif <- data.frame()
+  for (g in 1:nrow(unicityAllList))
+  {
+    metaboliteUnicity <- (unicityAllList$Metabolite == unicityAllList$Metabolite[g])
+    WhichMetaboliteUnicity <- which(metaboliteUnicity)
+    nb_occurence <- length(WhichMetaboliteUnicity)
+    unicitynbCouplesRectif <- rbind.data.frame(unicitynbCouplesRectif, nb_occurence)
+  }
+  names(unicitynbCouplesRectif) <- "NbCouplesAnnotes"
+  unicityAllList <- cbind.data.frame(unicityAllList, unicitynbCouplesRectif)
+  
+  unicityAllList <- cbind.data.frame(unicityAllList, score_unicite=unicityAllList$NbCouplesAnnotes/unicityAllList$theoricalLength)
+  unicityAllList <- unicityAllList[, -3]
+  unicityAllList <- unicityAllList[, -4]
+
+##  unicityAllList <- filter(unicityAllList, unicityAllList$score_unicite > seuil_score)
+  unicityAllList <- unicityAllList[unicityAllList$score_unicite > seuil_score,]
+
+  listeTotale_metabo <- data.frame()
+  if (nrow(commonPpmList) !=0)
+  {
+    for (o in 1:length(commonPpmList[, 1]))
+    {
+      tf6 <- (commonMetabolitesPpmAllList$ppm1 == commonPpmList[o,1] & commonMetabolitesPpmAllList$ppm2 == commonPpmList[o,2])
+      w6 <- which(tf6) 
+      
+      for (s in 1:length(w6))
+      {
+        metaboliteAdd <- data.frame(nom_metabolite=commonMetabolitesPpmAllList[w6[s],3])
+        commonMetabolitesList <- paste(commonMetabolitesList, metaboliteAdd[1,], sep = " ")
+      }
+      liste_metabo_ppm <- cbind.data.frame(ppm1=commonPpmList[o,1],ppm2=commonPpmList[o,2], commonMetabolitesList)
+      listeTotale_metabo <- rbind.data.frame(listeTotale_metabo, liste_metabo_ppm)
+      commonMetabolitesList <- data.frame()
+    }
+  }
+
+  # Representation graphique
+  if (nom_sequence == "HSQC" | nom_sequence == "HMBC")
+  {
+    atome <- "13C"
+    indice_positif <- 1
+    indice_negatif <- -10
+  }else{
+    atome <- "1H"
+    indice_positif <- 0.5
+    indice_negatif <- -0.5
+  }
+  
+  matriceComplexe <- matrixAnnotation
+  ppm1 <- as.numeric(matriceComplexe[,2])
+  ppm2 <- as.numeric(matriceComplexe[,3])
+  
+  if (unicite == "NO")
+  {
+    listeTotale_2D_a_utiliser <- allMetabolitesList
+    d1.ppm <- allMetabolitesList$ppm1 
+    d2.ppm <- allMetabolitesList$ppm2
+  }else{
+    listeTotale_2D_a_utiliser <- unicityAllList
+    d1.ppm <- listeTotale_2D_a_utiliser$ppm1 
+    d2.ppm <- listeTotale_2D_a_utiliser$ppm2
+  }
+
+  if (nrow(listeTotale_2D_a_utiliser) > 0)
+  {
+    ## Taches de correlations
+    # Matrice biologique + Annotations
+    maxX <- max(round(max(as.numeric(matriceComplexe[,2])))+0.5, round(max(as.numeric(matriceComplexe[,2]))))
+    maxY <- max(round(max(as.numeric(matriceComplexe[,3])))+indice_positif, round(max(as.numeric(matriceComplexe[,3]))))
+    probability.score <- as.factor(round(listeTotale_2D_a_utiliser[,4],2))
+    lgr <- length(unique(probability.score))
+    sp <- ggplot(matriceComplexe, aes(x=ppm1, y=ppm2))
+    sp <- sp + geom_point(size=2) + scale_x_reverse(breaks=seq(maxX, 0, -0.5)) + 
+      scale_y_reverse(breaks=seq(maxY, 0, indice_negatif)) + 
+      xlab("1H chemical shift (ppm)") + ylab(paste(atome, " chemical shift (ppm)")) + ggtitle(nom_sequence) +
+      geom_text(data=listeTotale_2D_a_utiliser, aes(d1.ppm, d2.ppm, label=str_to_lower(substr(listeTotale_2D_a_utiliser[,3],1,3)), 
+                                                    col=probability.score), 
+                size=4, hjust=0, nudge_x=0.02, vjust=0, nudge_y=0.2) + scale_colour_manual(values=viridis(lgr))
+##      scale_color_colormap('Annotation', discrete=T, reverse=T)
+    print(sp)
+  }
+  
+  # Liste des résultats (couples pmm / metabolite / score) + liste ppms metabolites communs
+  if (unicite == "NO")
+  {
+    return(list(liste_resultat=allMetabolitesList, listing_ppm_commun=listeTotale_metabo))
+  }else{
+    return(list(liste_resultat_unicite=unicityAllList, listing_ppm_commun_affichage=listeTotale_metabo))
+  }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nmr_annotation2d/annotationRmn2DGlobale.R	Mon Dec 23 09:26:20 2019 -0500
@@ -0,0 +1,121 @@
+###########################################################################################################################################
+# ANNOTATION SPECTRE 2D MATRICE COMPLEXE BASEE SUR UNE (OU PLUSIEURS) SEQUENCE(s) RMN                                                     #
+# template : dataframe contenant la liste des couples de deplacements chimiques de la matrice complexe a annoter                          # 
+# cosy : 1 si sequence a utiliser / 0 sinon                                                                                               #
+# hmbc : 1 si sequence a utiliser / 0 sinon                                                                                               #
+# hsqc : 1 si sequence a utiliser / 0 sinon                                                                                               #
+# jres : 1 si sequence a utiliser / 0 sinon                                                                                               #
+# tocsy : 1 si sequence a utiliser / 0 sinon                                                                                              #
+# tolPpm1 : tolerance autorisee autour de la valeur1 du couple de deplacements chimiques                                                  #
+# tolPpm2HJRes : tolerance autorisee autour de la valeur2 du couple de deplacements chimiques si H dans dimension 2                       #
+# tolPpm2C : tolerance autorisee autour de la valeur2 du couple de deplacements chimiques si C dans dimension 2                           #
+# seuil : valeur du score de presence en deça de laquelle les metabolites annotes ne sont pas retenus                                     #
+# unicite : boolean pour ne retenir que les ...                                                                                           #
+###########################################################################################################################################
+## CALCUL MOYENNE SANS VALEUR(S) MANQUANTE(S)
+mean.rmNa <- function(x)
+{
+  mean(x, na.rm=TRUE)
+}
+
+annotationRmn2DGlobale <- function(template, tolPpm1=0.01, tolPpm2HJRes=0.002, tolPpm2C=0.5, cosy=1, hmbc=1, hsqc=1, jres=1, tocsy=1, 
+                                   seuil, unicite="NO")
+{
+  ## Initialisation
+  options (max.print=999999999)
+  annotationCOSY <- data.frame()
+  annotationHMBC <- data.frame()
+  annotationHSQC <- data.frame()
+  annotationJRES <- data.frame()
+  annotationTOCSY <- data.frame()
+
+  dataCOSY <- "NA"
+  dataHMBC <- "NA"
+  dataHSQC <- "NA"
+  dataJRES <- "NA"
+  dataTOCSY <- "NA"
+  
+  ## Application seuil seulement si annotation avec 1 seule sequence
+##   seuilPls2D <- 0
+##   if ((sum(cosy, hmbc, hsqc, jres, tocsy)) == 1)
+##     seuilPls2D <- seuil
+  seuilPls2D <- seuil
+  
+  if (cosy == 1)
+  {
+    matrice.cosy <- read.xlsx(template, sheet="COSY", startRow=2, colNames=TRUE, rowNames=FALSE, cols=1:3, na.strings="NA")
+    matrice.cosy <- matrice.cosy[matrice.cosy$peak.index != "x", ]
+    annotationCOSY <- annotationRmn2D(matrice.cosy, BdDReference_COSY, "COSY", ppm1Tol=tolPpm1, ppm2Tol=tolPpm1, seuil=seuilPls2D, 
+                                      unicite=unicite)
+    dataCOSY <- data.frame(Metabolite=str_to_lower(annotationCOSY$liste_resultat$Metabolite), score.COSY=annotationCOSY$liste_resultat$score)
+    dataCOSY <- unique.data.frame(dataCOSY)
+  }
+  
+  if (hmbc == 1) 
+  {
+    matrice.hmbc <- read.xlsx(template, sheet="HMBC", startRow=2, colNames=TRUE, rowNames=FALSE, cols=1:3, na.strings="NA")
+    matrice.hmbc <- matrice.hmbc[matrice.hmbc$peak.index != "x", ]
+    annotationHMBC <- annotationRmn2D(matrice.hmbc, BdDReference_HMBC, "HMBC", ppm1Tol=tolPpm1, ppm2Tol=tolPpm2C, seuil=seuilPls2D, 
+                                      unicite=unicite)
+    dataHMBC <- data.frame(Metabolite=str_to_lower(annotationHMBC$liste_resultat$Metabolite), score.HMBC=annotationHMBC$liste_resultat$score)
+    dataHMBC <- unique.data.frame(dataHMBC)
+  }
+
+  if (hsqc == 1)
+  {
+    matrice.hsqc <- read.xlsx(template, sheet="HSQC", startRow=2, colNames=TRUE, rowNames=FALSE, cols=1:3, na.strings="NA")
+    matrice.hsqc <- matrice.hsqc[matrice.hsqc$peak.index != "x", ]
+    annotationHSQC <- annotationRmn2D(matrice.hsqc, BdDReference_HSQC, "HSQC", ppm1Tol=tolPpm1, ppm2Tol=tolPpm2C, seuil=seuilPls2D, 
+                                      unicite=unicite)
+    dataHSQC <- data.frame(Metabolite=str_to_lower(annotationHSQC$liste_resultat$Metabolite), score.HSQC=annotationHSQC$liste_resultat$score)
+    dataHSQC <- unique.data.frame(dataHSQC)
+  }
+  
+  if (jres == 1)
+  {
+    matrice.jres <- read.xlsx(template, sheet="JRES", startRow=2, colNames=TRUE, rowNames=FALSE, cols=1:3, na.strings="NA")
+    matrice.jres <- matrice.jres[matrice.jres$peak.index != "x", ]
+    annotationJRES <- annotationRmn2D(matrice.jres, BdDReference_JRES, "JRES", ppm1Tol=tolPpm1, ppm2Tol=tolPpm2HJRes, seuil=seuilPls2D, 
+                                      unicite=unicite)
+    dataJRES <- data.frame(Metabolite=str_to_lower(annotationJRES$liste_resultat$Metabolite), score.JRES=annotationJRES$liste_resultat$score)
+    dataJRES <- unique.data.frame(dataJRES)
+  }
+  
+  if (tocsy == 1)
+  {
+    matrice.tocsy <- read.xlsx(template, sheet="TOCSY", startRow=2, colNames=TRUE, rowNames=FALSE, cols=1:3, na.strings="NA")
+    matrice.tocsy <- matrice.tocsy[matrice.tocsy$peak.index != "x", ]
+    annotationTOCSY <- annotationRmn2D(matrice.tocsy, BdDReference_TOCSY, "TOCSY", ppm1Tol=tolPpm1, ppm2Tol=tolPpm1, seuil=seuilPls2D, 
+                                       unicite=unicite)
+    dataTOCSY <- data.frame(Metabolite=str_to_lower(annotationTOCSY$liste_resultat$Metabolite), score.TOCSY=annotationTOCSY$liste_resultat$score)
+    dataTOCSY <- unique.data.frame(dataTOCSY)
+  }
+
+  sequencesCombinationAverageScoreSeuil <- data.frame()
+  sequencesCombinationAverageScoreSeuilFiltre <- data.frame()
+  
+  ## CONCATENATION RESULTATS DIFFERENTES SEQUENCES
+  data2D <- list(dataCOSY, dataHMBC, dataHSQC, dataJRES, dataTOCSY)
+  whichSequenceNaN <- which((data2D != "NA"))
+  data2D <- data2D[whichSequenceNaN]
+  sequencesCombination <- data.frame(data2D[1])
+  sequencesCombinationAverageScore <- sequencesCombination
+  
+    ## Si une seule sequence et seuil sur score = filtre applique dans la fonction annotationRmn2D
+  if (length(data2D) >= 2)
+  {
+    ## CONCATENATION SCORE PAR SEQUENCE
+    for (l in 2:length(data2D))
+        sequencesCombination <- merge.data.frame(sequencesCombination, data2D[l], by="Metabolite", all.x=TRUE, all.y=TRUE)
+    
+    ## SCORE MOYEN (sans prise en compte valeurs manquantes)
+    meanScore <- apply(sequencesCombination[, -1], 1, FUN=mean.rmNa)
+    sequencesCombinationAverageScore <- cbind.data.frame(sequencesCombination, averageScore=meanScore)
+        ## SUPPRESSION METABOLITE AVEC SCORE MOYEN < SEUIL
+##    sequencesCombinationAverageScoreSeuilFiltre <- filter(sequencesCombinationAverageScore, averageScore >= seuil)
+    sequencesCombinationAverageScoreSeuilFiltre <- sequencesCombinationAverageScore[sequencesCombinationAverageScore$averageScore > seuil, ]
+  }
+
+  return(list(COSY=annotationCOSY, HMBC=annotationHMBC, HSQC=annotationHSQC, JRES=annotationJRES, TOCSY=annotationTOCSY, 
+              combination=sequencesCombinationAverageScoreSeuilFiltre))
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nmr_annotation2d/annotationRmn2DWrapper.R	Mon Dec 23 09:26:20 2019 -0500
@@ -0,0 +1,227 @@
+#!/usr/local/public/bin/Rscript --vanilla --slave --no-site-file
+
+## 201919016 2DNmrAnnotation_1.0.0.R
+## Marie Tremblay-Franco
+## MetaboHUB: The French Infrastructure for Metabolomics and Fluxomics
+## www.metabohub.fr/en
+## marie.tremblay-franco@toulouse.inra.fr
+
+runExampleL <- FALSE
+
+if(runExampleL) {
+##------------------------------
+## Example of arguments
+##------------------------------
+}
+
+
+##------------------------------
+## Options
+##------------------------------
+strAsFacL <- options()$stringsAsFactors
+options(stringsAsFactors = FALSE)
+
+##------------------------------
+## Constants
+##------------------------------
+topEnvC <- environment()
+flagC <- "\n"
+
+
+##-------------------------
+## Input parameters reading
+##-------------------------
+
+##------------------------------
+## R libraries laoding
+##------------------------------
+library(batch)
+library(dplyr)
+library(ggplot2)
+library(openxlsx)
+library(stringr)
+library(tidyr)
+
+if(!runExampleL)
+    argLs <- parseCommandArgs(evaluate=FALSE)
+logFile <- argLs[["logOut"]]
+sink(logFile)
+
+cat("\tPACKAGE INFO\n")
+sessionInfo()
+
+##------------------------------
+## Functions
+##------------------------------
+source_local <- function(fname)
+{
+	argv <- commandArgs(trailingOnly = FALSE)
+	base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
+	source(paste(base_dir, fname, sep="/"))
+}
+#Import the different functions
+source_local("annotationRmn2D.R")
+source_local("annotationRmn2DGlobale.R")
+source_local("viridis.R")
+
+## Input parameter values
+fileToAnnotate <- argLs[[1]]
+  # Chosen sequence(s)
+cosy <- 0
+hmbc <- 0
+hsqc <- 0
+jres <- 0
+tocsy <- 0
+## sequences <- str_split(argLs[[2]], ",")[[1]]
+## for (s in 1:length(sequences))
+## {
+##   argv <- commandArgs(trailingOnly = FALSE)
+##   currentDir <- dirname(substring(argv[grep("--file=", argv)], 8))
+##   if (sequences[s]=="cosy"){
+##         cosy <- 1
+##         load(paste(currentDir, "BdDReference_COSY.RData", sep="/"))
+##   }else if(sequences[s]=="hmbc"){
+##         hmbc <- 1
+##         load(paste(currentDir, "BdDReference_HMBC.RData", sep="/"))
+##   }else if(sequences[s]=="hsqc"){
+##         hsqc <- 1
+##         load(paste(currentDir, "BdDReference_HSQC.RData", sep="/"))
+##   }else if(sequences[s]=="jres"){
+##         jres <- 1
+##         load(paste(currentDir, "BdDReference_JRES.RData", sep="/"))
+##   }else if(sequences[s]=="tocsy"){
+##         tocsy <- 1
+##         load(paste(currentDir, "BdDReference_TOCSY.RData", sep="/"))
+##   }else
+##     stop("No chosen sequence", call.=FALSE)
+## }
+
+if (argLs[[2]]=='yes')
+{
+  argv <- commandArgs(trailingOnly = FALSE)
+  currentDir <- dirname(substring(argv[grep("--file=", argv)], 8))
+  cosy <- 1
+  load(paste(currentDir, "BdDReference_COSY.RData", sep="/"))
+}
+
+if (argLs[[3]]=='yes')
+{
+  argv <- commandArgs(trailingOnly = FALSE)
+  currentDir <- dirname(substring(argv[grep("--file=", argv)], 8))
+  jres <- 1
+  load(paste(currentDir, "BdDReference_JRES.RData", sep="/"))
+}
+
+if (argLs[[4]]=='yes')
+{
+  argv <- commandArgs(trailingOnly = FALSE)
+  currentDir <- dirname(substring(argv[grep("--file=", argv)], 8))
+  hmbc <- 1
+  load(paste(currentDir, "BdDReference_HMBC.RData", sep="/"))
+}
+
+if (argLs[[5]]=='yes')
+{
+  argv <- commandArgs(trailingOnly = FALSE)
+  currentDir <- dirname(substring(argv[grep("--file=", argv)], 8))
+  hsqc <- 1
+  load(paste(currentDir, "BdDReference_HSQC.RData", sep="/"))
+}
+
+if (argLs[[6]]=='yes')
+{
+  argv <- commandArgs(trailingOnly = FALSE)
+  currentDir <- dirname(substring(argv[grep("--file=", argv)], 8))
+  tocsy <- 1
+  load(paste(currentDir, "BdDReference_TOCSY.RData", sep="/"))
+}
+
+if (argLs[[2]]=='no' & argLs[[3]]=='no' & argLs[[4]]=='no' & argLs[[5]]=='no' & argLs[[6]]=='no')
+  stop("No chosen sequence", call.=FALSE)
+
+
+  # User database
+
+
+  # Allowed chemical shifts
+tolPpm1 <- argLs$tolppm1
+tolPpm2HJRes <- argLs$tolppmJRES
+tolPpm2C <- argLs$tolppm2
+  # Threshold to remove metabolites (probability score < threshold)
+seuil <- argLs$threshold
+# Remove metabolites when multiple assignations?
+unicite <- str_to_upper(argLs$unicity)
+
+## Output paramater values
+AnnotationGraph <- argLs[["AnnotationGraph"]]
+
+print(argLs)
+
+## ANNOTATION
+st0=Sys.time()
+pdf(AnnotationGraph,onefile=TRUE)
+annotationMelange <- annotationRmn2DGlobale(fileToAnnotate, tolPpm1=tolPpm1, tolPpm2HJRes=tolPpm2HJRes, 
+                                             tolPpm2C=tolPpm2C, cosy=cosy, hmbc=hmbc, hsqc=hsqc, 
+                                             jres=jres, tocsy=tocsy, seuil=seuil, unicite=unicite)
+dev.off()
+
+if (cosy==1)
+{
+  write.table(annotationMelange$COSY$liste_resultat, file=argLs[["annotationCOSY"]], quote=FALSE, 
+              row.names=FALSE,sep="\t")
+  if (nrow(annotationMelange$COSY$listing_ppm_commun) != 0)
+      write.table(annotationMelange$COSY$listing_ppm_commun, file=argLs[["ppmCommunCOSY"]], quote=FALSE, 
+                  row.names=FALSE,sep="\t")
+}
+
+if (hmbc==1)
+{
+  write.table(annotationMelange$HMBC$liste_resultat, file=argLs[["annotationHMBC"]], quote=FALSE, 
+              row.names=FALSE,sep="\t")
+  if (nrow(annotationMelange$HMBC$listing_ppm_commun) != 0)
+    write.table(annotationMelange$HMBC$listing_ppm_commun, file=argLs[["ppmCommunHMBC"]], quote=FALSE, 
+                row.names=FALSE,sep="\t")
+}
+
+if (hsqc==1)
+{
+  write.table(annotationMelange$HSQC$liste_resultat, file=argLs[["annotationHSQC"]], quote=FALSE, 
+              row.names=FALSE,sep="\t")
+  if (nrow(annotationMelange$HSQC$listing_ppm_commun) != 0)
+    write.table(annotationMelange$HSQC$listing_ppm_commun, file=argLs[["ppmCommunHSQC"]], quote=FALSE, 
+                row.names=FALSE,sep="\t")
+}
+
+if (jres==1)
+{
+  write.table(annotationMelange$JRES$liste_resultat, file=argLs[["annotationJRES"]], quote=FALSE, 
+              row.names=FALSE,sep="\t")
+  if (nrow(annotationMelange$JRES$listing_ppm_commun) != 0)
+    write.table(annotationMelange$JRES$listing_ppm_commun, file=argLs[["ppmCommunJRES"]], quote=FALSE, 
+                row.names=FALSE,sep="\t")
+}
+
+if (tocsy==1)
+{
+  write.table(annotationMelange$TOCSY$liste_resultat, file=argLs[["annotationTOCSY"]], quote=FALSE, 
+              row.names=FALSE,sep="\t")
+  if (nrow(annotationMelange$TOCSY$listing_ppm_commun) != 0)
+    write.table(annotationMelange$TOCSY$listing_ppm_commun, file=argLs[["ppmCommunTOCSY"]], quote=FALSE, 
+                row.names=FALSE,sep="\t")
+}
+
+## Combinaison de sequences
+if (cosy + jres + hmbc + hsqc + tocsy > 1)
+{
+  write.table(annotationMelange$combination, file=argLs[["annotationCombination"]], quote=FALSE, 
+              row.names=FALSE,sep="\t")
+}
+st1=Sys.time()
+print(st1-st0)
+
+## Ending
+##--------
+cat("\nEnd of '2D NMR annotation' Galaxy module call: ", as.character(Sys.time()), sep = "")
+sink()
+options(stringsAsFactors = strAsFacL)
+rm(list = ls())
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nmr_annotation2d/annotationRmn2D_xml.xml	Mon Dec 23 09:26:20 2019 -0500
@@ -0,0 +1,376 @@
+<tool id="2DNmrAnnotation" name="2DNMR_Annotation" version="1.0.0">
+		
+	<description> Annotation of complex mixture bidimensional NMR spectra </description>
+
+    <stdio>
+        <exit_code range="1:" level="fatal" />
+    </stdio> 
+
+	<command>
+		## Wrapper + Libraries of 2D-NMR sequences for reference compounds
+		Rscript '$__tool_directory__/annotationRmn2DWrapper.R'
+
+
+		## XLS file
+		xlsfile $zip_xlsfile
+
+		## 2D-NMR sequences to annotate
+		cosy_2dsequences $cosy_2dsequences
+		jres_2dsequences $jres_2dsequences
+		hmbc_2dsequences $hmbc_2dsequences
+		hsqc_2dsequences $hsqc_2dsequences
+		tocsy_2dsequences $tocsy_2dsequences
+		
+		## In-house databases
+		inHouse_DB_choices.choice ${inHouse_DB_choices.choice}
+		#if str($inHouse_DB_choices.choice) == 'yes':
+			inHouse_DB_cosy.choice ${inHouse_DB_cosy.choice}
+			#if str($inHouse_DB_cosy.choice) == 'yes':
+				cosyDB $cosyDB
+			#end if
+			inHouse_DB_hmbc.choice ${inHouse_DB_hmbc.choice}
+			#if str($inHouse_DB_hmbc.choice) == 'yes':
+				hmbcDB $hmbcDB
+			#end if
+			inHouse_DB_hsqc.choice ${inHouse_DB_hsqc.choice}
+			#if str($inHouse_DB_hsqc.choice) == 'yes':
+				hsqcDB $hsqcDB
+			#end if
+			inHouse_DB_jres.choice ${inHouse_DB_jres.choice}
+			#if str($inHouse_DB_jres.choice) == 'yes':
+				jresDB $jresDB
+			#end if
+			inHouse_DB_tocsy.choice ${inHouse_DB_tocsy.choice}
+			#if str($inHouse_DB_tocsy.choice) == 'yes':
+				tocsyDB $tocsyDB
+			#end if
+		#end if
+
+		## Tolerances
+		tolppm1 $tolppm1
+		tolppm2 $tolppm2
+		tolppmJRES $tolppmJRES
+		
+		
+		## Treshold (probability score)
+		threshold $threshold
+
+		## Unicity
+		unicity $unicity
+
+		## Outputs
+		logOut $logOut
+        annotationCOSY $annotationCOSY
+        ppmCommunCOSY $ppmCommunCOSY
+        annotationJRES $annotationJRES
+        ppmCommunJRES $ppmCommunJRES
+        annotationHMBC $annotationHMBC
+        ppmCommunHMBC $ppmCommunHMBC
+        annotationHSQC $annotationHSQC
+        ppmCommunHSQC $ppmCommunHSQC
+        annotationTOCSY $annotationTOCSY
+        ppmCommunTOCSY $ppmCommunTOCSY
+        annotationCombination $annotationCombination
+        AnnotationGraph $AnnotationGraph
+		
+	</command>
+		
+	<inputs>
+		<param name="zip_xlsfile" type="data" format="xlsx" label="File to annotate in xlsx format" />
+
+		<param name="cosy_2dsequences" type="select" label="2D-NMR COSY sequence">
+			<option value="yes" > yes </option>
+			<option value="no" selected="true"> no </option>
+		</param>
+		<param name="jres_2dsequences" type="select" label="2D-NMR JRES sequence">
+			<option value="yes" > yes </option>
+			<option value="no" selected="true"> no </option>
+		</param>		
+		<param name="hmbc_2dsequences" type="select" label="2D-NMR HMBC sequence">
+			<option value="yes" > yes </option>
+			<option value="no" selected="true"> no </option>
+		</param>		
+		<param name="hsqc_2dsequences" type="select" label="2D-NMR HSQC sequence">
+			<option value="yes" > yes </option>
+			<option value="no" selected="true"> no </option>
+		</param>
+		<param name="tocsy_2dsequences" type="select" label="2D-NMR TOCSY sequence">
+			<option value="yes" > yes </option>
+			<option value="no" selected="true"> no </option>
+		</param>
+		
+		<conditional name="inHouse_DB_choices">
+			<param name="choice" type="select" label="In-house database" help="Choose if you want to use use in-house database to annotate" >
+				<option value="yes" > yes </option>
+				<option value="no" selected="true"> no </option>
+			</param>
+			<when value="yes">
+				<conditional name="inHouse_DB_cosy">
+					<param name="choice" type="select" label="COSY In-house database" help="Choose if you want to use use in-house database to annotate COSY sequence" >
+						<option value="yes" > yes </option>
+						<option value="no" selected="true"> no </option>
+					</param>
+						<when value="yes">
+							<param name="cosyDB" type="data" format="no_unzip.zip" label="Zip file of the COSY RData object" />
+						</when>
+				</conditional>
+				<conditional name="inHouse_DB_hmbc">
+					<param name="choice" type="select" label="HMBC In-house database" help="Choose if you want to use use in-house database to annotate HMBC sequence" >
+						<option value="yes" > yes </option>
+						<option value="no" selected="true"> no </option>
+					</param>
+						<when value="yes">
+							<param name="hmbcDB" type="data" format="no_unzip.zip" label="Zip file of the HMBC RData object" />
+						</when>
+				</conditional>			<conditional name="inHouse_DB_hsqc">
+					<param name="choice" type="select" label="HSQC In-house database" help="Choose if you want to use use in-house database to annotate HSQC sequence" >
+						<option value="yes" > yes </option>
+						<option value="no" selected="true"> no </option>
+					</param>
+						<when value="yes">
+							<param name="hsqcDB" type="data" format="no_unzip.zip" label="Zip file of the HSQC RData object" />
+						</when>
+				</conditional>			<conditional name="inHouse_DB_jres">
+					<param name="choice" type="select" label="JRES In-house database" help="Choose if you want to use use in-house database to annotate JRES sequence" >
+						<option value="yes" > yes </option>
+						<option value="no" selected="true"> no </option>
+					</param>
+						<when value="yes">
+							<param name="jresDB" type="data" format="no_unzip.zip" label="Zip file of the JRES RData object" />
+						</when>
+				</conditional>			
+				<conditional name="inHouse_DB_tocsy">
+					<param name="choice" type="select" label="TOCSY In-house database" help="Choose if you want to use use in-house database to annotate TOCSY sequence" >
+						<option value="yes" > yes </option>
+						<option value="no" selected="true"> no </option>
+					</param>
+						<when value="yes">
+							<param name="tocsyDB" type="data" format="no_unzip.zip" label="Zip file of the TOCSY RData object" />
+						</when>
+				</conditional>			
+				</when>
+			<when value="no" />
+	</conditional>
+	
+	<param name="tolppm1" type="float" value="0.01" help="Tolerance on chemical shift for the x-axis (H). Default value is 0.01ppm" />
+	<param name="tolppm2" type="float" value="0.5" help="Tolerance on chemical shift for the y-axis (C). Default value is 0.01ppm" />
+	<param name="tolppmJRES" type="float" value="0.002" help="Tolerance on chemical shift for the y-axis for the JRES sequence. Default value is 0.002 (Hz)" />
+
+	<param name="threshold" type="float" value="0" help="Treshold on score of presence. Default value is 0" />
+
+    <param name="unicity" label="Unicity of annotation" type="select" display="radio" help="">
+      <option value="no">No</option>
+      <option value="yes"></option>
+    </param>
+
+	</inputs>
+
+	<outputs>
+		<data format="txt" name="logOut" label="${tool.name}_log" />
+        <data format="tabular" name="annotationCOSY" label="annotationCosy" >
+            <filter> cosy_2dsequences != "no" </filter>
+        </data>
+        <data format="tabular" name="ppmCommunCOSY" label="duplicateCosy" >
+            <filter> cosy_2dsequences != "no" </filter>
+        </data>
+
+        <data format="tabular" name="annotationJRES" label="annotationJres" >
+            <filter> jres_2dsequences != "no" </filter>
+        </data>
+        <data format="tabular" name="ppmCommunJRES" label="duplicateJres" >
+            <filter> jres_2dsequences != "no" </filter>
+        </data>
+
+        <data format="tabular" name="annotationHMBC" label="annotationHmbc" >
+            <filter> hmbc_2dsequences != "no" </filter>
+        </data>
+        <data format="tabular" name="ppmCommunHMBC" label="duplicateHmbc" >
+            <filter> hmbc_2dsequences != "no" </filter>
+        </data>
+
+        <data format="tabular" name="annotationHSQC" label="annotationHsqc" >
+            <filter> hsqc_2dsequences != "no" </filter>
+        </data>
+        <data format="tabular" name="ppmCommunHSQC" label="duplicateHsqc" >
+            <filter> hsqc_2dsequences != "no" </filter>
+        </data>
+
+        <data format="tabular" name="annotationTOCSY" label="annotationTocsy" >
+            <filter> tocsy_2dsequences != "no" </filter>
+        </data>
+        <data format="tabular" name="ppmCommunTOCSY" label="duplicateTocsy" >
+            <filter> tocsy_2dsequences != "no" </filter>
+        </data>
+
+        <data format="tabular" name="annotationCombination" label="${tool.name}_annotationCombination" />
+		<data format="pdf" name="AnnotationGraph" label="${tool.name}_graph" />
+	</outputs>
+
+<help>
+
+.. class:: infomark
+
+**Authors** Marie Tremblay-Franco (marie.tremblay-franco@inra.fr), Coline Gardou
+
+.. class:: infomark
+
+
+---------------------------------------------------
+
+============================
+Bidimensional NMR Annotation
+============================
+
+-----------
+Description
+-----------
+
+BARSA is an automatic algorithm for bi-dimensional NMR spectra annotation
+ 
+-----------------
+Workflow position
+-----------------
+
+**Upstream tools**
+
+========================= ================= ======= =========
+Name                      output file       format  parameter
+========================= ================= ======= =========
+NA                        NA                NA      NA      
+========================= ================= ======= =========
+
+
+**Downstream tools**
+
+========================= ================= ======= =========
+Name                      output file       format  parameter
+========================= ================= ======= =========
+NA                        NA                NA      NA      
+========================= ================= ======= =========
+
+
+
+-----------
+Input files
+-----------
+
++---------------------------+------------+
+| Parameter : num + label   |   Format   |
++===========================+============+
+| 1 : Choose your inputs    |   xlsx     |
++---------------------------+------------+
+
+**Choose your inputs**
+    | xlsx file can include several peak lists, coming from several 2D NMR sequences
+    |
+	
+.. image:: ./static/images/2DNmr_FileToAnnotate_xlsxFormat.png
+
+----------
+Parameters
+----------
+	
+Bi-dimensional NMR peak list(s) to annotate; select one or more sequence(s)
+    | COSY: yes/no
+    | JRES: yes/no
+    | HMBC: yes/no
+    | HSQC: yes/no
+    | TOCSY: yes/no
+    | Default value is no
+    |
+
+In-house databases
+    | Use of your own databases to annotate peak list(s)
+    | If YES: parameters **COSY In-house database**, **JRES In-house database**, ** HMBC In-house database**, **HSQC In-house database** and **TOCSY In-house database** are visible
+    | Select one or more in-house database
+	|
+
+
+Tolerances
+    | tolppm1: Maximum variation of the chemical shift (due to experimental conditions) of a peak along the x-axis
+    | tolppm2: Maximum variation of the chemical shift (due to experimental conditions) of a peak along the y-axis
+    | tolppmJRES: Maximum variation of the chemical shift (due to experimental conditions) of a peak for the JRES sequence
+    | Default values: 0.01 and 0.01 ppm; 0.002 Hz 
+    |
+
+
+Threshold
+    | All metabolites with a presence probability (number of detected peak(s)/number of theoretical peak(s)) under this threshold are removed
+    | Default value: 0
+    |
+
+
+Unicity of annotation
+    | All the peaks assigned to more than one metabolite are removed
+    |
+
+
+------------
+Output files
+------------
+COSY
+    | tabular outputs
+    | annotationCOSY: Array with p rows (corresponding to the identified metabolites) and 4 columns containing the chemical shift on the x-axis, the chemical shift on the y-axis, the metabolite name and the presence probability
+    | ppmCommunCOSY: Array containing for all the peaks assigned to more than one metabolite: the chemical shift on the x-axis, the chemical shift on the y-axis and the list of assigned metabolites
+    | Only display if COSY was chosen
+    |
+
+
+JRES
+    | tabular outputs
+    | annotationJRES: Array with p rows (corresponding to the identified metabolites) and 4 columns containing the chemical shift on the x-axis, the chemical shift on the y-axis, the metabolite name and the presence probability
+    | ppmCommunJRES: Array containing for all the peaks assigned to more than one metabolite: the chemical shift on the x-axis, the chemical shift on the y-axis and the list of assigned metabolites
+    | Only display if JRES was chosen
+    |
+
+
+HMBC
+    | tabular outputs
+    | annotationHMBC: Array with p rows (corresponding to the identified metabolites) and 4 columns containing the chemical shift on the x-axis, the chemical shift on the y-axis, the metabolite name and the presence probability
+    | ppmCommunHMBC: Array containing for all the peaks assigned to more than one metabolite: the chemical shift on the x-axis, the chemical shift on the y-axis and the list of assigned metabolites
+    | Only display if HMBC was chosen
+    |
+
+
+HSQC
+    | tabular outputs
+    | annotationHSQC: Array with p rows (corresponding to the identified metabolites) and 4 columns containing the chemical shift on the x-axis, the chemical shift on the y-axis, the metabolite name and the presence probability
+    | ppmCommunHSQC: Array containing for all the peaks assigned to more than one metabolite: the chemical shift on the x-axis, the chemical shift on the y-axis and the list of assigned metabolites
+    | Only display if HSQC was chosen
+    |
+
+
+TOCSY
+    | tabular outputs
+    | annotationTOCSY: Array with p rows (corresponding to the identified metabolites) and 4 columns containing the chemical shift on the x-axis, the chemical shift on the y-axis, the metabolite name and the presence probability
+    | ppmCommunTOCSY: Array containing for all the peaks assigned to more than one metabolite: the chemical shift on the x-axis, the chemical shift on the y-axis and the list of assigned metabolites
+    | Only display if TOCSY was chosen
+    |
+
+
+annotationCombination
+    | tabular outputs
+    | Array with p rows (corresponding to the identified metabolites) including the Metabolite name, the COSY presence probability, the JRES presence probability, the HMBC presence probability, the HSQC presence probability, the TOCSY presence probability and the averageScore
+    | Depends on the chosen sequences
+    | Only display if 2 or more sequences have be chosen
+
+
+AnnotationGraph.pdf
+    | pdf output
+    | Bi-dimensional graphical chart of real pairs of chemical shifts, with name of identified metabolites
+ 
+
+
+---------------------------------------------------
+
+-------
+Example
+-------
+Example of output files obtaining wehn running the algorithm on a mix of 23 known compounds
+
+.. image:: ./static/images/OutputsExampleMix.png
+        :width: 500
+		
+   </help>
+    
+</tool>
Binary file nmr_annotation2d/static/2DNMR_Annotation_graph.pdf has changed
Binary file nmr_annotation2d/static/2DNmr_FileToAnnotate_xlsxFormat.png has changed
Binary file nmr_annotation2d/static/OutputsExampleMix.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nmr_annotation2d/test-data/2DNMR_Annotation_annotationCombination.tabular	Mon Dec 23 09:26:20 2019 -0500
@@ -0,0 +1,34 @@
+Metabolite	score.HSQC	score.JRES	averageScore
+4_hydroxyphenylpropionic_acid	NA	0.5	0.5
+alanine	1	1	1
+arabinose	NA	0.348837209302326	0.348837209302326
+asparagine	1	1	1
+aspartic_acid	1	1	1
+betaine	1	1	1
+butyric acid	0.333333333333333	0.916666666666667	0.625
+cadaverine	0.333333333333333	0.615384615384615	0.474358974358974
+carnitine	1	0.611111111111111	0.805555555555556
+cholinechloride	0.666666666666667	0.714285714285714	0.69047619047619
+creatine	NA	0.5	0.5
+desaminotyrosine	NA	0.4	0.4
+dimethylamine	NA	1	1
+dimethylglycine	NA	0.333333333333333	0.333333333333333
+fumaric acid	1	1	1
+gaba	0.333333333333333	NA	0.333333333333333
+galactose	0.833333333333333	0.473684210526316	0.653508771929825
+glucose	0.666666666666667	0.8125	0.739583333333333
+glycerol	NA	0.666666666666667	0.666666666666667
+glycine	1	1	1
+hippuric_acid	1	1	1
+histidine	1	0.428571428571429	0.714285714285714
+indoxylsulfate	NA	0.545454545454545	0.545454545454545
+isoleucine	1	0.379310344827586	0.689655172413793
+lactic acid	1	1	1
+mannose	NA	0.3125	0.3125
+myo_inositol	NA	0.384615384615385	0.384615384615385
+proline	1	0.409090909090909	0.704545454545455
+taurine	NA	0.333333333333333	0.333333333333333
+threonine	1	1	1
+tryptophan	1	0.521739130434783	0.760869565217391
+uracil	NA	0.5	0.5
+valine	0.75	0.75	0.75
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nmr_annotation2d/test-data/2DNMR_Annotation_log.txt	Mon Dec 23 09:26:20 2019 -0500
@@ -0,0 +1,112 @@
+	PACKAGE INFO
+R version 3.4.3 (2017-11-30)
+Platform: x86_64-pc-linux-gnu (64-bit)
+Running under: Ubuntu 14.04.5 LTS
+
+Matrix products: default
+BLAS: /usr/lib/libblas/libblas.so.3.0
+LAPACK: /usr/lib/lapack/liblapack.so.3.0
+
+locale:
+ [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
+ [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
+ [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
+ [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
+ [9] LC_ADDRESS=C               LC_TELEPHONE=C            
+[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
+
+attached base packages:
+[1] stats     graphics  grDevices utils     datasets  base     
+
+other attached packages:
+[1] tidyr_0.7.2    stringr_1.2.0  openxlsx_4.1.3 ggplot2_2.2.1  dplyr_0.7.4   
+[6] batch_1.1-4   
+
+loaded via a namespace (and not attached):
+ [1] Rcpp_0.12.14     bindr_0.1        magrittr_1.5     munsell_0.4.3   
+ [5] colorspace_1.3-2 R6_2.2.2         rlang_0.4.2      plyr_1.8.4      
+ [9] tools_3.4.3      grid_3.4.3       gtable_0.2.0     cli_1.1.0       
+[13] lazyeval_0.2.1   assertthat_0.2.0 tibble_1.3.4     crayon_1.3.4    
+[17] bindrcpp_0.2     zip_1.0.0        purrr_0.3.3      glue_1.2.0      
+[21] stringi_1.1.6    compiler_3.4.3   methods_3.4.3    scales_0.5.0    
+[25] pkgconfig_2.0.1 
+$xlsfile
+[1] "/home/vagrant/galaxy/database/datasets/001/dataset_1825.dat"
+
+$cosy_2dsequences
+[1] "no"
+
+$jres_2dsequences
+[1] "yes"
+
+$hmbc_2dsequences
+[1] "no"
+
+$hsqc_2dsequences
+[1] "yes"
+
+$tocsy_2dsequences
+[1] "no"
+
+$inHouse_DB_choices.choice
+[1] "no"
+
+$tolppm1
+[1] 0.01
+
+$tolppm2
+[1] 0.5
+
+$tolppmJRES
+[1] 0.002
+
+$threshold
+[1] 0.3
+
+$unicity
+[1] "no"
+
+$logOut
+[1] "/home/vagrant/galaxy/database/datasets/002/dataset_2767.dat"
+
+$annotationCOSY
+[1] "None"
+
+$ppmCommunCOSY
+[1] "None"
+
+$annotationJRES
+[1] "/home/vagrant/galaxy/database/datasets/002/dataset_2768.dat"
+
+$ppmCommunJRES
+[1] "/home/vagrant/galaxy/database/datasets/002/dataset_2769.dat"
+
+$annotationHMBC
+[1] "None"
+
+$ppmCommunHMBC
+[1] "None"
+
+$annotationHSQC
+[1] "/home/vagrant/galaxy/database/datasets/002/dataset_2770.dat"
+
+$ppmCommunHSQC
+[1] "/home/vagrant/galaxy/database/datasets/002/dataset_2771.dat"
+
+$annotationTOCSY
+[1] "None"
+
+$ppmCommunTOCSY
+[1] "None"
+
+$annotationCombination
+[1] "/home/vagrant/galaxy/database/datasets/002/dataset_2772.dat"
+
+$AnnotationGraph
+[1] "/home/vagrant/galaxy/database/datasets/002/dataset_2773.dat"
+
+null device 
+          1 
+Time difference of 1.566586 mins
+
+End of '2D NMR annotation' Galaxy module call: 2019-12-23 10:55:29
\ No newline at end of file
Binary file nmr_annotation2d/test-data/Template_melange.xlsm has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nmr_annotation2d/test-data/annotationHsqc.tabular	Mon Dec 23 09:26:20 2019 -0500
@@ -0,0 +1,77 @@
+ppm1	ppm2	Metabolite	score
+1.487	19.022	alanine	1
+3.791	53.343	alanine	1
+2.883	37.372	asparagine	1
+2.964	37.382	asparagine	1
+4.016	54.04	asparagine	1
+2.694	39.367	Aspartic_acid	1
+2.816	39.387	Aspartic_acid	1
+3.905	54.962	Aspartic_acid	1
+3.264	56.272	betaine	1
+3.901	69.074	betaine	1
+2.164	42.369	Butyric acid	0.333333333333333
+3.024	41.961	Cadaverine	0.333333333333333
+2.444	45.792	carnitine	1
+3.232	56.932	carnitine	1
+3.44	72.954	carnitine	1
+4.571	66.903	carnitine	1
+3.208	56.704	CholineChloride	0.666666666666667
+4.072	58.227	CholineChloride	0.666666666666667
+6.526	138.157	Fumaric acid	1
+3.015	42.093	gaba	0.333333333333333
+3.502	74.756	galactose	0.833333333333333
+3.661	75.593	galactose	0.833333333333333
+3.717	78.019	galactose	0.833333333333333
+3.815	71.175	galactose	0.833333333333333
+3.866	71.993	galactose	0.833333333333333
+3.942	71.619	galactose	0.833333333333333
+4	72.162	galactose	0.833333333333333
+4.096	73.292	galactose	0.833333333333333
+4.598	99.277	galactose	0.833333333333333
+5.277	95.132	galactose	0.833333333333333
+3.425	72.307	glucose	0.666666666666667
+3.46	78.647	glucose	0.666666666666667
+3.549	74.169	glucose	0.666666666666667
+3.745	63.514	glucose	0.666666666666667
+3.841	74.223	glucose	0.666666666666667
+3.847	63.4	glucose	0.666666666666667
+4.66	98.737	glucose	0.666666666666667
+5.252	94.768	glucose	0.666666666666667
+3.566	44.267	glycine	1
+3.967	46.611	hippuric_acid	1
+7.556	131.578	hippuric_acid	1
+7.643	135.065	hippuric_acid	1
+7.837	130.019	hippuric_acid	1
+3.209	30.164	Histidine	1
+3.29	30.194	Histidine	1
+4.014	57.269	Histidine	1
+7.155	119.969	Histidine	1
+8.04	138.39	Histidine	1
+0.944	14.001	Isoleucine	1
+1.017	17.526	Isoleucine	1
+1.27	27.262	Isoleucine	1
+1.479	27.34	Isoleucine	1
+1.987	38.709	Isoleucine	1
+3.68	62.433	Isoleucine	1
+1.336	22.913	Lactic acid	1
+4.12	71.318	Lactic acid	1
+2.009	26.543	Proline	1
+2.062	31.789	Proline	1
+2.357	31.817	Proline	1
+3.346	48.831	Proline	1
+3.422	48.867	Proline	1
+4.14	63.947	Proline	1
+1.342	22.349	threonine	1
+3.609	63.354	threonine	1
+4.261	68.825	threonine	1
+3.321	29.248	tryptophan	1
+3.492	29.268	tryptophan	1
+4.066	57.824	tryptophan	1
+7.209	122.251	tryptophan	1
+7.292	124.963	tryptophan	1
+7.337	127.891	tryptophan	1
+7.554	114.838	tryptophan	1
+7.743	121.238	tryptophan	1
+1	19.497	valine	0.75
+1.049	20.77	valine	0.75
+2.281	31.893	valine	0.75
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nmr_annotation2d/test-data/annotationJres.tabular	Mon Dec 23 09:26:20 2019 -0500
@@ -0,0 +1,314 @@
+ppm1	ppm2	Metabolite	score
+2.452	0	4_hydroxyphenylpropionic_acid	0.5
+2.452	-0.013	4_hydroxyphenylpropionic_acid	0.5
+2.452	0.013	4_hydroxyphenylpropionic_acid	0.5
+2.818	-0.013	4_hydroxyphenylpropionic_acid	0.5
+2.818	0.013	4_hydroxyphenylpropionic_acid	0.5
+1.487	0.006	alanine	1
+1.487	-0.006	alanine	1
+3.791	-0.006	alanine	1
+3.791	-0.018	alanine	1
+3.791	0.006	alanine	1
+3.791	0.018	alanine	1
+3.517	0.002	arabinose	0.348837209302326
+3.655	-0.013	arabinose	0.348837209302326
+3.655	0.013	arabinose	0.348837209302326
+3.671	-0.005	arabinose	0.348837209302326
+3.824	-0.011	arabinose	0.348837209302326
+3.824	0.005	arabinose	0.348837209302326
+3.824	-0.005	arabinose	0.348837209302326
+3.824	0.011	arabinose	0.348837209302326
+3.905	-0.012	arabinose	0.348837209302326
+3.905	-0.009	arabinose	0.348837209302326
+3.905	0.009	arabinose	0.348837209302326
+3.905	0.009	arabinose	0.348837209302326
+3.905	-0.012	arabinose	0.348837209302326
+3.905	-0.009	arabinose	0.348837209302326
+4.013	0.004	arabinose	0.348837209302326
+5.248	-0.002	arabinose	0.348837209302326
+5.248	0.003	arabinose	0.348837209302326
+2.881	-0.008	asparagine	1
+2.881	0.02	asparagine	1
+2.881	0.008	asparagine	1
+2.881	-0.02	asparagine	1
+2.961	0.01	asparagine	1
+2.961	-0.018	asparagine	1
+2.961	-0.011	asparagine	1
+2.961	0.018	asparagine	1
+4.014	-0.01	asparagine	1
+4.014	0.01	asparagine	1
+4.014	-0.002	asparagine	1
+4.014	0.002	asparagine	1
+2.694	0.007	Aspartic_acid	1
+2.694	0.022	Aspartic_acid	1
+2.694	-0.008	Aspartic_acid	1
+2.817	-0.011	Aspartic_acid	1
+2.817	0.011	Aspartic_acid	1
+2.817	0.018	Aspartic_acid	1
+2.817	-0.018	Aspartic_acid	1
+3.906	-0.01	Aspartic_acid	1
+3.906	0.01	Aspartic_acid	1
+3.906	-0.004	Aspartic_acid	1
+3.906	0.004	Aspartic_acid	1
+3.906	0.01	Aspartic_acid	1
+3.906	-0.01	Aspartic_acid	1
+3.273	0	betaine	1
+3.908	0	betaine	1
+0.898	-0.012	Butyric acid	0.916666666666667
+0.902	0	Butyric acid	0.916666666666667
+0.907	0.013	Butyric acid	0.916666666666667
+1.565	0.007	Butyric acid	0.916666666666667
+1.57	0.019	Butyric acid	0.916666666666667
+1.565	-0.03	Butyric acid	0.916666666666667
+1.565	-0.006	Butyric acid	0.916666666666667
+1.57	-0.018	Butyric acid	0.916666666666667
+2.165	0	Butyric acid	0.916666666666667
+2.17	0.013	Butyric acid	0.916666666666667
+2.17	-0.012	Butyric acid	0.916666666666667
+1.726	0.025	Cadaverine	0.615384615384615
+1.73	-0.026	Cadaverine	0.615384615384615
+1.729	0	Cadaverine	0.615384615384615
+1.729	0.013	Cadaverine	0.615384615384615
+1.731	-0.013	Cadaverine	0.615384615384615
+3.022	0.012	Cadaverine	0.615384615384615
+3.022	-0.012	Cadaverine	0.615384615384615
+3.024	0	Cadaverine	0.615384615384615
+2.426	-0.018	carnitine	0.611111111111111
+2.426	0.007	carnitine	0.611111111111111
+2.426	0.018	carnitine	0.611111111111111
+2.446	0.013	carnitine	0.611111111111111
+2.446	-0.013	carnitine	0.611111111111111
+2.445	0.027	carnitine	0.611111111111111
+2.445	0	carnitine	0.611111111111111
+2.445	-0.027	carnitine	0.611111111111111
+2.445	0	carnitine	0.611111111111111
+2.446	-0.038	carnitine	0.611111111111111
+2.445	-0.027	carnitine	0.611111111111111
+2.445	0.027	carnitine	0.611111111111111
+2.446	0.038	carnitine	0.611111111111111
+2.446	-0.013	carnitine	0.611111111111111
+2.446	0.013	carnitine	0.611111111111111
+2.465	-0.007	carnitine	0.611111111111111
+2.465	0.007	carnitine	0.611111111111111
+2.465	0.019	carnitine	0.611111111111111
+2.465	0.019	carnitine	0.611111111111111
+2.465	-0.007	carnitine	0.611111111111111
+2.465	-0.019	carnitine	0.611111111111111
+2.465	0.007	carnitine	0.611111111111111
+3.234	0	carnitine	0.611111111111111
+3.422	0.015	carnitine	0.611111111111111
+3.422	-0.015	carnitine	0.611111111111111
+3.434	0	carnitine	0.611111111111111
+3.422	-0.009	carnitine	0.611111111111111
+3.438	-0.008	carnitine	0.611111111111111
+3.438	0.008	carnitine	0.611111111111111
+3.209	-0.001	CholineChloride	0.714285714285714
+3.529	0.008	CholineChloride	0.714285714285714
+3.529	-0.008	CholineChloride	0.714285714285714
+4.069	0	CholineChloride	0.714285714285714
+4.069	0.009	CholineChloride	0.714285714285714
+3.937	0	creatine	0.5
+2.454	-0.013	Desaminotyrosine	0.4
+2.454	0.013	Desaminotyrosine	0.4
+2.822	-0.013	Desaminotyrosine	0.4
+2.822	0.012	Desaminotyrosine	0.4
+2.729	0	Dimethylamine	1
+3.741	0	Dimethylglycine	0.333333333333333
+6.519	0	Fumaric acid	1
+3.5	-0.002	galactose	0.473684210526316
+3.498	0.015	galactose	0.473684210526316
+3.658	-0.011	galactose	0.473684210526316
+3.658	-0.005	galactose	0.473684210526316
+3.658	0.005	galactose	0.473684210526316
+3.658	0.011	galactose	0.473684210526316
+3.723	-0.016	galactose	0.473684210526316
+3.723	0.016	galactose	0.473684210526316
+3.723	0.016	galactose	0.473684210526316
+3.723	-0.004	galactose	0.473684210526316
+3.723	-0.016	galactose	0.473684210526316
+3.723	0.004	galactose	0.473684210526316
+3.736	0	galactose	0.473684210526316
+3.76	-0.002	galactose	0.473684210526316
+3.762	0.008	galactose	0.473684210526316
+3.763	-0.009	galactose	0.473684210526316
+3.812	-0.012	galactose	0.473684210526316
+3.812	0.005	galactose	0.473684210526316
+3.812	-0.006	galactose	0.473684210526316
+3.812	0.012	galactose	0.473684210526316
+3.863	-0.012	galactose	0.473684210526316
+3.863	-0.006	galactose	0.473684210526316
+3.863	0.006	galactose	0.473684210526316
+3.863	0.012	galactose	0.473684210526316
+4.595	-0.007	galactose	0.473684210526316
+4.595	0.007	galactose	0.473684210526316
+5.274	-0.004	galactose	0.473684210526316
+5.274	0.004	galactose	0.473684210526316
+3.256	-0.014	glucose	0.8125
+3.255	0	glucose	0.8125
+3.422	0.016	glucose	0.8125
+3.411	0.016	glucose	0.8125
+3.422	-0.016	glucose	0.8125
+3.411	-0.016	glucose	0.8125
+3.422	0	glucose	0.8125
+3.475	0	glucose	0.8125
+3.475	-0.011	glucose	0.8125
+3.475	-0.005	glucose	0.8125
+3.475	0.005	glucose	0.8125
+3.475	0.011	glucose	0.8125
+3.475	0.015	glucose	0.8125
+3.502	-0.015	glucose	0.8125
+3.502	0	glucose	0.8125
+3.502	0.015	glucose	0.8125
+3.545	0.011	glucose	0.8125
+3.545	-0.005	glucose	0.8125
+3.545	0.005	glucose	0.8125
+3.545	-0.012	glucose	0.8125
+3.731	-0.015	glucose	0.8125
+3.721	-0.016	glucose	0.8125
+3.732	0.015	glucose	0.8125
+3.721	0.016	glucose	0.8125
+3.732	0.015	glucose	0.8125
+3.732	-0.006	glucose	0.8125
+3.731	-0.015	glucose	0.8125
+3.732	0.005	glucose	0.8125
+3.843	0.009	glucose	0.8125
+3.839	0.011	glucose	0.8125
+3.844	-0.01	glucose	0.8125
+3.839	-0.011	glucose	0.8125
+3.901	-0.012	glucose	0.8125
+3.901	-0.009	glucose	0.8125
+3.901	0.008	glucose	0.8125
+3.902	0.012	glucose	0.8125
+3.901	-0.012	glucose	0.8125
+3.901	-0.009	glucose	0.8125
+4.655	0.007	glucose	0.8125
+4.655	-0.006	glucose	0.8125
+5.243	-0.003	glucose	0.8125
+5.243	0.003	glucose	0.8125
+3.656	-0.013	glycerol	0.666666666666667
+3.656	-0.006	glycerol	0.666666666666667
+3.656	0.006	glycerol	0.666666666666667
+3.791	-0.011	glycerol	0.666666666666667
+3.791	0	glycerol	0.666666666666667
+3.791	0.01	glycerol	0.666666666666667
+3.791	-0.007	glycerol	0.666666666666667
+3.791	-0.018	glycerol	0.666666666666667
+3.791	0.007	glycerol	0.666666666666667
+3.791	0.018	glycerol	0.666666666666667
+3.568	0	glycine	1
+3.969	0	hippuric_acid	1
+7.555	0.013	hippuric_acid	1
+7.555	0	hippuric_acid	1
+7.555	-0.013	hippuric_acid	1
+7.642	0	hippuric_acid	1
+7.642	-0.013	hippuric_acid	1
+7.642	0.012	hippuric_acid	1
+7.836	-0.007	hippuric_acid	1
+7.836	0.007	hippuric_acid	1
+4.015	-0.011	Histidine	0.428571428571429
+4.015	0.01	Histidine	0.428571428571429
+4.015	-0.002	Histidine	0.428571428571429
+4.015	0.002	Histidine	0.428571428571429
+7.156	0	Histidine	0.428571428571429
+8.043	0	Histidine	0.428571428571429
+7.21	0.013	indoxylsulfate	0.545454545454545
+7.21	-0.013	indoxylsulfate	0.545454545454545
+7.21	0	indoxylsulfate	0.545454545454545
+7.283	-0.013	indoxylsulfate	0.545454545454545
+7.283	0.013	indoxylsulfate	0.545454545454545
+7.283	0	indoxylsulfate	0.545454545454545
+0.946	-0.012	Isoleucine	0.379310344827586
+0.948	0.012	Isoleucine	0.379310344827586
+0.949	0	Isoleucine	0.379310344827586
+1.017	0.007	Isoleucine	0.379310344827586
+1.017	-0.006	Isoleucine	0.379310344827586
+1.269	0.025	Isoleucine	0.379310344827586
+1.269	-0.024	Isoleucine	0.379310344827586
+1.269	-0.011	Isoleucine	0.379310344827586
+1.269	0.011	Isoleucine	0.379310344827586
+3.687	-0.004	Isoleucine	0.379310344827586
+3.683	0.003	Isoleucine	0.379310344827586
+1.333	0.006	Lactic acid	1
+1.333	-0.006	Lactic acid	1
+1.333	0.006	Lactic acid	1
+4.117	-0.017	Lactic acid	1
+4.118	0.017	Lactic acid	1
+4.117	-0.006	Lactic acid	1
+4.117	0.006	Lactic acid	1
+3.741	-0.005	mannose	0.3125
+3.741	-0.015	mannose	0.3125
+3.741	0.005	mannose	0.3125
+3.823	0.004	mannose	0.3125
+3.823	-0.004	mannose	0.3125
+3.856	-0.011	mannose	0.3125
+3.856	-0.005	mannose	0.3125
+3.856	0.005	mannose	0.3125
+3.856	0.011	mannose	0.3125
+3.91	-0.012	mannose	0.3125
+3.91	0.009	mannose	0.3125
+3.91	0.009	mannose	0.3125
+3.91	0.012	mannose	0.3125
+3.91	-0.012	mannose	0.3125
+3.943	0	mannose	0.3125
+3.956	0	mannose	0.3125
+3.544	0.011	myo_inositol	0.384615384615385
+3.544	-0.006	myo_inositol	0.384615384615385
+3.544	0.006	myo_inositol	0.384615384615385
+3.544	-0.011	myo_inositol	0.384615384615385
+4.073	0	myo_inositol	0.384615384615385
+2.012	-0.021	Proline	0.409090909090909
+2.011	-0.01	Proline	0.409090909090909
+2.012	0.01	Proline	0.409090909090909
+2.012	0.021	Proline	0.409090909090909
+2.011	0	Proline	0.409090909090909
+2.356	-0.004	Proline	0.409090909090909
+2.356	-0.017	Proline	0.409090909090909
+2.356	0.004	Proline	0.409090909090909
+2.356	0.018	Proline	0.409090909090909
+3.347	-0.009	Proline	0.409090909090909
+3.347	0.01	Proline	0.409090909090909
+3.423	0.001	Proline	0.409090909090909
+3.423	-0.009	Proline	0.409090909090909
+3.423	0.01	Proline	0.409090909090909
+4.141	0.013	Proline	0.409090909090909
+4.141	-0.013	Proline	0.409090909090909
+4.14	-0.002	Proline	0.409090909090909
+4.142	0.002	Proline	0.409090909090909
+3.275	0	taurine	0.333333333333333
+3.43	0	taurine	0.333333333333333
+1.34	0.005	threonine	1
+1.339	-0.006	threonine	1
+1.34	0.005	threonine	1
+3.603	0.004	threonine	1
+3.604	-0.005	threonine	1
+4.26	-0.01	threonine	1
+4.258	-0.02	threonine	1
+4.26	0.01	threonine	1
+4.259	0	threonine	1
+4.259	0.021	threonine	1
+4.063	-0.002	tryptophan	0.521739130434783
+7.204	0.012	tryptophan	0.521739130434783
+7.204	-0.012	tryptophan	0.521739130434783
+7.204	0	tryptophan	0.521739130434783
+7.288	-0.012	tryptophan	0.521739130434783
+7.288	0.013	tryptophan	0.521739130434783
+7.288	0	tryptophan	0.521739130434783
+7.334	0	tryptophan	0.521739130434783
+7.548	-0.006	tryptophan	0.521739130434783
+7.549	0.007	tryptophan	0.521739130434783
+7.738	-0.006	tryptophan	0.521739130434783
+7.738	0.006	tryptophan	0.521739130434783
+7.552	-0.006	Uracil	0.5
+7.552	0.007	Uracil	0.5
+0.998	-0.006	valine	0.75
+0.996	0.006	valine	0.75
+1.047	-0.006	valine	0.75
+1.047	0.006	valine	0.75
+2.279	-0.004	valine	0.75
+2.28	0.003	valine	0.75
+2.28	0.016	valine	0.75
+2.281	-0.016	valine	0.75
+2.28	-0.008	valine	0.75
+2.28	0.008	valine	0.75
+3.62	-0.004	valine	0.75
+3.62	0.004	valine	0.75
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nmr_annotation2d/test-data/duplicateHsqc.tabular	Mon Dec 23 09:26:20 2019 -0500
@@ -0,0 +1,19 @@
+ppm1	ppm2	commonMetabolitesList
+3.024	41.961	 Cadaverine 5aminovalericacid gaba Lysine
+3.232	56.932	 carnitine gpc
+4.072	58.227	 CholineChloride tryptophan
+3.015	42.093	 gaba 5aminovalericacid Cadaverine
+3.502	74.756	 galactose cholic_acid
+3.661	75.593	 galactose mannose
+3.866	71.993	 galactose stachyose
+3.942	71.619	 galactose ribose
+4	72.162	 galactose stachyose
+3.425	72.307	 glucose maltose
+3.549	74.169	 glucose myo_inositol
+4.66	98.737	 glucose maltose
+5.252	94.768	 glucose maltose
+4.12	71.318	 Lactic acid ribose
+4.066	57.824	 tryptophan CholineChloride
+7.209	122.251	 tryptophan indoxylsulfate
+7.292	124.963	 tryptophan indoxylsulfate
+1	19.497	 valine cholic_acid
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nmr_annotation2d/test-data/duplicateJres.tabular	Mon Dec 23 09:26:20 2019 -0500
@@ -0,0 +1,197 @@
+ppm1	ppm2	commonMetabolitesList
+2.452	0	 4_hydroxyphenylpropionic_acid carnitine Desaminotyrosine glutamine
+2.452	-0.013	 4_hydroxyphenylpropionic_acid carnitine Desaminotyrosine glutamine
+2.452	0.013	 4_hydroxyphenylpropionic_acid carnitine Desaminotyrosine
+2.818	-0.013	 4_hydroxyphenylpropionic_acid Aspartic_acid Desaminotyrosine
+2.818	0.013	 4_hydroxyphenylpropionic_acid Aspartic_acid Desaminotyrosine
+3.791	-0.006	 alanine glycerol raffinose stachyose
+3.791	-0.018	 alanine glycerol maltose raffinose stachyose
+3.791	0.006	 alanine glycerol raffinose stachyose
+3.791	0.018	 alanine glycerol raffinose stachyose
+3.655	-0.013	 arabinose galactose glycerol maltose ribose
+3.655	0.013	 arabinose galactose glycerol ribose
+3.671	-0.005	 arabinose mannose ribose
+3.824	-0.011	 arabinose ribose stachyose
+3.824	0.005	 arabinose mannose ribose stachyose
+3.824	-0.005	 arabinose mannose ribose stachyose
+3.824	0.011	 arabinose Ethanolamine ribose stachyose
+3.905	-0.012	 arabinose Aspartic_acid glucose mannose raffinose ribose stachyose
+3.905	-0.009	 arabinose Aspartic_acid glucose mannose raffinose ribose stachyose sucrose
+3.905	0.009	 arabinose Aspartic_acid glucose mannose raffinose ribose stachyose sucrose
+4.013	0.004	 arabinose asparagine Histidine ribose
+5.248	-0.002	 arabinose glucose maltose
+5.248	0.003	 arabinose glucose maltose
+4.014	-0.01	 asparagine Histidine
+4.014	0.01	 asparagine Histidine
+4.014	-0.002	 asparagine Histidine raffinose ribose
+4.014	0.002	 asparagine arabinose Histidine raffinose
+2.817	-0.011	 Aspartic_acid 4_hydroxyphenylpropionic_acid Desaminotyrosine
+2.817	0.011	 Aspartic_acid 4_hydroxyphenylpropionic_acid Desaminotyrosine
+3.906	-0.01	 Aspartic_acid arabinose glucose mannose raffinose stachyose
+3.906	0.01	 Aspartic_acid arabinose glucose mannose raffinose stachyose
+3.906	-0.004	 Aspartic_acid raffinose stachyose
+3.906	0.004	 Aspartic_acid raffinose stachyose
+3.273	0	 betaine taurine
+3.908	0	 betaine cholic_acid raffinose stachyose
+0.898	-0.012	 Butyric acid 2_hydroxybutyric_acid 3_methyl-2-oxovaleric acid valeric_acid
+0.902	0	 Butyric acid 2_hydroxybutyric_acid 3_methyl-2-oxovaleric acid valeric_acid
+0.907	0.013	 Butyric acid 2_hydroxybutyric_acid 3_methyl-2-oxovaleric acid
+1.57	0.019	 Butyric acid cholic_acid
+1.57	-0.018	 Butyric acid cholic_acid
+2.17	0.013	 Butyric acid octanoic_acid
+2.17	-0.012	 Butyric acid octanoic_acid
+1.73	-0.026	 Cadaverine Lysine
+1.729	0	 Cadaverine Lysine
+1.729	0.013	 Cadaverine Lysine
+1.731	-0.013	 Cadaverine Lysine
+3.022	0.012	 Cadaverine 5aminovalericacid gaba
+3.022	-0.012	 Cadaverine 5aminovalericacid gaba
+3.024	0	 Cadaverine 5aminovalericacid gaba Lysine
+2.446	0.013	 carnitine 4_hydroxyphenylpropionic_acid Desaminotyrosine
+2.446	-0.013	 carnitine 4_hydroxyphenylpropionic_acid Desaminotyrosine
+2.445	0.027	 carnitine glutamine
+2.445	0	 carnitine 4_hydroxyphenylpropionic_acid Desaminotyrosine
+3.234	0	 carnitine gpc
+3.422	0.015	 carnitine glucose
+3.422	-0.015	 carnitine glucose
+3.434	0	 carnitine maltose rahmnose taurine
+3.422	-0.009	 carnitine Proline taurine
+3.529	0.008	 CholineChloride ribose
+3.529	-0.008	 CholineChloride ribose
+4.069	0	 CholineChloride cholic_acid myo_inositol raffinose stachyose sucrose tryptophan
+4.069	0.009	 CholineChloride tryptophan
+3.937	0	 creatine mannose ribose
+2.454	-0.013	 Desaminotyrosine 4_hydroxyphenylpropionic_acid carnitine glutamine
+2.454	0.013	 Desaminotyrosine 4_hydroxyphenylpropionic_acid carnitine
+2.822	-0.013	 Desaminotyrosine 4_hydroxyphenylpropionic_acid Aspartic_acid
+2.822	0.012	 Desaminotyrosine 4_hydroxyphenylpropionic_acid Aspartic_acid
+3.741	0	 Dimethylglycine galactose
+3.5	-0.002	 galactose cholic_acid glucose
+3.498	0.015	 galactose glucose
+3.658	-0.011	 galactose arabinose glycerol
+3.658	-0.005	 galactose Ethanol glycerol ribose stachyose
+3.658	0.005	 galactose Ethanol glycerol ribose stachyose
+3.658	0.011	 galactose arabinose
+3.723	-0.016	 galactose glucose
+3.723	0.016	 galactose glucose
+3.723	-0.004	 galactose glucose
+3.723	0.004	 galactose glucose
+3.736	0	 galactose Dimethylglycine
+3.76	-0.002	 galactose Lysine phenylacetylglycine
+3.762	0.008	 galactose glucose Lysine maltose raffinose ribose
+3.763	-0.009	 galactose glutamic acid Lysine raffinose ribose
+3.812	-0.012	 galactose maltose rahmnose ribose
+3.812	0.005	 galactose maltose rahmnose sucrose
+3.812	-0.006	 galactose maltose rahmnose ribose sucrose
+3.812	0.012	 galactose maltose rahmnose ribose
+3.863	-0.012	 galactose maltose mannose Methionine rahmnose stachyose
+3.863	-0.006	 galactose Ethanolamine maltose mannose Serine stachyose
+3.863	0.006	 galactose maltose mannose ribose Serine stachyose
+3.863	0.012	 galactose maltose mannose Methionine rahmnose stachyose
+3.255	0	 glucose arginine
+3.422	0.016	 glucose carnitine
+3.422	-0.016	 glucose carnitine
+3.422	0	 glucose Proline taurine
+3.475	0	 glucose sucrose
+3.475	0.015	 glucose sucrose
+3.502	-0.015	 glucose galactose
+3.502	0	 glucose cholic_acid galactose
+3.502	0.015	 glucose galactose
+3.545	0.011	 glucose myo_inositol
+3.545	-0.005	 glucose myo_inositol ribose
+3.545	0.005	 glucose myo_inositol ribose
+3.545	-0.012	 glucose myo_inositol
+3.731	-0.015	 glucose galactose stachyose
+3.721	-0.016	 glucose galactose
+3.732	0.015	 glucose galactose mannose stachyose
+3.721	0.016	 glucose galactose
+3.732	-0.006	 glucose galactose mannose stachyose
+3.732	0.005	 glucose galactose mannose stachyose
+3.843	0.009	 glucose inosine raffinose sucrose
+3.839	0.011	 glucose raffinose ribose
+3.844	-0.01	 glucose Ethanolamine raffinose sucrose
+3.839	-0.011	 glucose raffinose ribose
+3.901	-0.012	 glucose arabinose Aspartic_acid mannose raffinose ribose stachyose
+3.901	-0.009	 glucose arabinose Aspartic_acid mannose raffinose ribose stachyose sucrose
+3.901	0.008	 glucose arabinose Aspartic_acid mannose raffinose ribose sucrose
+3.902	0.012	 glucose arabinose Aspartic_acid mannose raffinose ribose stachyose
+5.243	-0.003	 glucose arabinose maltose
+5.243	0.003	 glucose arabinose maltose
+3.656	-0.013	 glycerol arabinose galactose maltose ribose
+3.656	-0.006	 glycerol arabinose Ethanol galactose ribose stachyose
+3.656	0.006	 glycerol Ethanol galactose ribose stachyose
+3.791	-0.011	 glycerol arginine glutamine ornithine
+3.791	0	 glycerol arginine glutamine maltose ornithine
+3.791	0.01	 glycerol arginine glutamic acid glutamine ornithine
+3.791	-0.007	 glycerol alanine
+3.791	0.007	 glycerol alanine
+3.969	0	 hippuric_acid maltose raffinose
+4.015	-0.011	 Histidine asparagine
+4.015	0.01	 Histidine asparagine
+4.015	-0.002	 Histidine asparagine raffinose ribose
+4.015	0.002	 Histidine arabinose asparagine raffinose
+7.21	0.013	 indoxylsulfate tryptophan
+7.21	-0.013	 indoxylsulfate tryptophan
+7.21	0	 indoxylsulfate indole_3_propionic_acid tryptophan
+7.283	-0.013	 indoxylsulfate tryptophan
+7.283	0.013	 indoxylsulfate tryptophan
+7.283	0	 indoxylsulfate tryptophan
+3.687	-0.004	 Isoleucine raffinose ribose
+3.683	0.003	 Isoleucine raffinose sucrose
+1.333	0.006	 Lactic acid threonine
+1.333	-0.006	 Lactic acid threonine
+4.117	-0.006	 Lactic acid ribose
+4.117	0.006	 Lactic acid ribose
+3.741	-0.005	 mannose galactose glucose raffinose stachyose
+3.741	-0.015	 mannose galactose raffinose stachyose
+3.741	0.005	 mannose galactose glucose raffinose stachyose
+3.823	0.004	 mannose arabinose maltose ribose stachyose
+3.823	-0.004	 mannose arabinose maltose ribose stachyose
+3.856	-0.011	 mannose galactose maltose raffinose ribose stachyose
+3.856	-0.005	 mannose galactose hydroxyisovaleric inosine ribose stachyose
+3.856	0.005	 mannose galactose hydroxyisovaleric inosine ribose stachyose
+3.856	0.011	 mannose galactose maltose raffinose ribose stachyose sucrose
+3.91	-0.012	 mannose arabinose Aspartic_acid glucose maltose raffinose stachyose
+3.91	0.009	 mannose arabinose Aspartic_acid glucose maltose raffinose stachyose
+3.91	0.012	 mannose arabinose Aspartic_acid glucose maltose raffinose stachyose
+3.943	0	 mannose arabinose creatine ribose
+3.956	0	 mannose arabinose raffinose
+3.544	0.011	 myo_inositol glucose
+3.544	-0.006	 myo_inositol glucose ribose
+3.544	0.006	 myo_inositol glucose ribose
+3.544	-0.011	 myo_inositol glucose
+4.073	0	 myo_inositol cholic_acid CholineChloride raffinose stachyose
+2.012	-0.021	 Proline hydroxyisovaleric
+2.011	-0.01	 Proline hydroxyisovaleric
+2.012	0.01	 Proline hydroxyisovaleric
+2.012	0.021	 Proline hydroxyisovaleric
+3.423	0.001	 Proline glucose taurine
+3.423	-0.009	 Proline carnitine taurine
+3.423	0.01	 Proline carnitine taurine
+4.141	0.013	 Proline stachyose
+4.141	-0.013	 Proline ribose stachyose
+4.14	-0.002	 Proline ribose
+4.142	0.002	 Proline ribose stachyose
+3.275	0	 taurine betaine
+3.43	0	 taurine carnitine glucose maltose Proline
+1.34	0.005	 threonine Lactic acid
+1.339	-0.006	 threonine Lactic acid
+3.603	0.004	 threonine maltose rahmnose
+3.604	-0.005	 threonine rahmnose
+4.063	-0.002	 tryptophan cholic_acid CholineChloride raffinose stachyose sucrose
+7.204	0.012	 tryptophan indoxylsulfate
+7.204	-0.012	 tryptophan indoxylsulfate
+7.204	0	 tryptophan indoxylsulfate
+7.288	-0.012	 tryptophan indoxylsulfate
+7.288	0.013	 tryptophan indoxylsulfate
+7.288	0	 tryptophan indoxylsulfate
+7.548	-0.006	 tryptophan Uracil
+7.549	0.007	 tryptophan Uracil
+7.552	-0.006	 Uracil tryptophan
+7.552	0.007	 Uracil tryptophan
+0.998	-0.006	 valine cholic_acid
+0.996	0.006	 valine cholic_acid
+1.047	-0.006	 valine 2_methylbutyric_acid
+1.047	0.006	 valine 2_methylbutyric_acid
+3.62	-0.004	 valine gpc rahmnose
+3.62	0.004	 valine gpc rahmnose