# HG changeset patch # User marie-tremblay-metatoul # Date 1580807138 18000 # Node ID a4d2b1926e132a37be8b4fc7f00e00225f759490 # Parent 8035235e46c7a5c3472e6ae63a8f5c521970641b Uploaded diff -r 8035235e46c7 -r a4d2b1926e13 nmr_annotation2d/.shed.yml --- a/nmr_annotation2d/.shed.yml Mon Dec 23 09:26:20 2019 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -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 diff -r 8035235e46c7 -r a4d2b1926e13 nmr_annotation2d/.travis.yml --- a/nmr_annotation2d/.travis.yml Mon Dec 23 09:26:20 2019 -0500 +++ b/nmr_annotation2d/.travis.yml Tue Feb 04 04:05:38 2020 -0500 @@ -1,17 +1,20 @@ - # 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 +env: + - TESTFOLDER=. + before_install: + - export GALAXY_RELEASE=release_19.05 + +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 + - sudo pip install planemo==0.58.1 + +script: + - planemo lint ${TRAVIS_BUILD_DIR}/${TESTFOLDER} + - planemo test --galaxy_branch $GALAXY_RELEASE --galaxy_source "$GALAXY_REPO" --no_cache_galaxy ${TRAVIS_BUILD_DIR}/${TESTFOLDER} -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/ diff -r 8035235e46c7 -r a4d2b1926e13 nmr_annotation2d/README.md.rej --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nmr_annotation2d/README.md.rej Tue Feb 04 04:05:38 2020 -0500 @@ -0,0 +1,4 @@ +diff a/README.md b/README.md (rejected hunks) +@@ -0,0 +1,2 @@ ++# nmr_annotation2d ++Algorithm for automated annotation of bi-dimensional NMR spectre (BARSA) diff -r 8035235e46c7 -r a4d2b1926e13 nmr_annotation2d/annotationRmn2D_xml.xml --- a/nmr_annotation2d/annotationRmn2D_xml.xml Mon Dec 23 09:26:20 2019 -0500 +++ b/nmr_annotation2d/annotationRmn2D_xml.xml Tue Feb 04 04:05:38 2020 -0500 @@ -1,172 +1,188 @@ - - Annotation of complex mixture bidimensional NMR spectra + + Annotation of complex mixture bidimensional NMR spectra + + + r-batch + r-dplyr + r-ggplot2 + r-openxlsx + r-stringr + r-tidyr + - + + + + ## 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 - - ## Wrapper + Libraries of 2D-NMR sequences for reference compounds - Rscript '$__tool_directory__/annotationRmn2DWrapper.R' + ## In-house databases + inHouse_DB_choices.choice ${inHouse_DB_choices.choice} + #if str($inHouse_DB_choices.choice) == 'yes': + inHouse_DB_cosy.choice ${inHouse_DB_choices.inHouse_DB_cosy.choice} + #if str($inHouse_DB_choices.inHouse_DB_cosy.choice) == 'yes': + cosyDB $inHouse_DB_choices.inHouse_DB_cosy.cosyDB + #end if + inHouse_DB_hmbc.choice ${inHouse_DB_choices.inHouse_DB_hmbc.choice} + #if str($inHouse_DB_choices.inHouse_DB_hmbc.choice) == 'yes': + hmbcDB $inHouse_DB_choices.inHouse_DB_hmbc.hmbcDB + #end if + inHouse_DB_hsqc.choice ${inHouse_DB_choices.inHouse_DB_hsqc.choice} + #if str($inHouse_DB_choices.inHouse_DB_hsqc.choice) == 'yes': + hsqcDB $inHouse_DB_choices.inHouse_DB_hsqc.hsqcDB + #end if + inHouse_DB_jres.choice ${inHouse_DB_choices.inHouse_DB_jres.choice} + #if str($inHouse_DB_choices.inHouse_DB_jres.choice) == 'yes': + jresDB $inHouse_DB_choices.inHouse_DB_jres.jresDB + #end if + inHouse_DB_tocsy.choice ${inHouse_DB_choices.inHouse_DB_tocsy.choice} + #if str($inHouse_DB_choices.inHouse_DB_tocsy.choice) == 'yes': + tocsyDB $inHouse_DB_choices.inHouse_DB_tocsy.tocsyDB + #end if + #end if + + ## Tolerances + tolppm1 $tolppm1 + tolppm2 $tolppm2 + tolppmJRES $tolppmJRES - ## XLS file - xlsfile $zip_xlsfile + ## 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' + + - ## 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 - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + - - - - + + + + - + - - + + cosy_2dsequences != "no" @@ -203,9 +219,30 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + .. class:: infomark @@ -226,7 +263,7 @@ ----------- BARSA is an automatic algorithm for bi-dimensional NMR spectra annotation - + ----------------- Workflow position ----------------- @@ -236,7 +273,7 @@ ========================= ================= ======= ========= Name output file format parameter ========================= ================= ======= ========= -NA NA NA NA +NA NA NA NA ========================= ================= ======= ========= @@ -245,7 +282,7 @@ ========================= ================= ======= ========= Name output file format parameter ========================= ================= ======= ========= -NA NA NA NA +NA NA NA NA ========================= ================= ======= ========= @@ -263,13 +300,13 @@ **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 @@ -283,14 +320,14 @@ | 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 + | Default values: 0.01 and 0.01 ppm; 0.002 Hz | @@ -358,7 +395,7 @@ AnnotationGraph.pdf | pdf output | Bi-dimensional graphical chart of real pairs of chemical shifts, with name of identified metabolites - + --------------------------------------------------- @@ -370,7 +407,10 @@ .. image:: ./static/images/OutputsExampleMix.png :width: 500 - - - + + + + 10.1093/bioinformatics/btu813 + + diff -r 8035235e46c7 -r a4d2b1926e13 nmr_annotation2d/test-data/annotationHsqc.tabular --- a/nmr_annotation2d/test-data/annotationHsqc.tabular Mon Dec 23 09:26:20 2019 -0500 +++ b/nmr_annotation2d/test-data/annotationHsqc.tabular Tue Feb 04 04:05:38 2020 -0500 @@ -1,77 +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 +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 diff -r 8035235e46c7 -r a4d2b1926e13 nmr_annotation2d/viridis.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nmr_annotation2d/viridis.R Tue Feb 04 04:05:38 2020 -0500 @@ -0,0 +1,28 @@ +viridis <- function (n, alpha = 1, begin = 0, end = 1, direction = 1, option = "D") +{ + if (begin < 0 | begin > 1 | end < 0 | end > 1) { + stop("begin and end must be in [0,1]") + } + if (abs(direction) != 1) { + stop("direction must be 1 or -1") + } + if (direction == -1) { + tmp <- begin + begin <- end + end <- tmp + } + option <- switch(EXPR = option, A = "A", magma = "A", + B = "B", inferno = "B", C = "C", plasma = "C", + D = "D", viridis = "D", E = "E", cividis = "E", + { + warning(paste0("Option '", option, "' does not exist. Defaulting to 'viridis'.")) + "D" + }) + map <- viridisLite::viridis.map[viridisLite::viridis.map$opt == + option, ] + map_cols <- grDevices::rgb(map$R, map$G, map$B) + fn_cols <- grDevices::colorRamp(map_cols, space = "Lab", + interpolate = "spline") + cols <- fn_cols(seq(begin, end, length.out = n))/255 + grDevices::rgb(cols[, 1], cols[, 2], cols[, 3], alpha = alpha) +} \ No newline at end of file