# HG changeset patch
# User tomnl
# Date 1486139137 18000
# Node ID 5990ad11314551d7bd579340580005f5a35d7ccc
Uploaded
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/.gitignore
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nmrml2isa-galaxy/.gitignore Fri Feb 03 11:25:37 2017 -0500
@@ -0,0 +1,7 @@
+*.pyc
+.idea
+*.egg-info
+.egg
+*~
+*.
+.DS_Store
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/.travis.yml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nmrml2isa-galaxy/.travis.yml Fri Feb 03 11:25:37 2017 -0500
@@ -0,0 +1,16 @@
+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
+ - planemo conda_init
+
+install:
+ - planemo conda_install ${TRAVIS_BUILD_DIR}/galaxy/nmrml2isa/
+
+script:
+ - planemo test --install_galaxy --no_cache_galaxy --conda_dependency_resolution ${TRAVIS_BUILD_DIR}/galaxy/nmrml2isa/ --galaxy_branch "dev"
+
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/README.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nmrml2isa-galaxy/README.md Fri Feb 03 11:25:37 2017 -0500
@@ -0,0 +1,32 @@
+nmrml2isa for galaxy
+===============
+
+[![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat-square)](http://bioconda.github.io/recipes/nmrml2isa/README.html) [![Build Status](https://travis-ci.org/ISA-tools/nmrml2isa-galaxy.svg?branch=master)](https://travis-ci.org/ISA-tools/nmrml2isa-galaxy)
+
+This is a Galaxy wrapper for the nmrml2isa python package tool.
+
+- Full documentation: http://2isa.readthedocs.io/en/latest/
+- Python PyPi package: https://pypi.python.org/pypi/mzml2isa/
+- Github code: https://github.com/ISA-tools/mzml2isa
+
+nmrml2isa is a program that allows you to convert metabolomic studies in .mzML format to the open ISA-Tab standard supported by the MetaboLights database.
+
+Installation
+===============
+
+The recommended installation is by means of the toolshed (https://toolshed.g2.bx.psu.edu/). Dependencies should be installed automatically when using Galaxy version >= 16.10.
+
+The dependencies are dealt with Bioconda. To ensure that Bioconda is working check to make sure the following settings are in the config/galaxy.ini file.
+
+```
+# dependencies before each job runs.
+conda_auto_install = True
+# Set to True to instruct Galaxy to install Conda from the web automatically
+# if it cannot find a local copy and conda_exec is not configured.
+conda_auto_init = True
+```
+
+
+Licence
+===============
+GNU General Public License v3 (GPLv3)
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/galaxy/nmrml2isa/README.rst
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/galaxy/nmrml2isa/nmrml2isa.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nmrml2isa-galaxy/galaxy/nmrml2isa/nmrml2isa.xml Fri Feb 03 11:25:37 2017 -0500
@@ -0,0 +1,256 @@
+
+ Parser to get meta information from nmrML files and create an ISA-Tab structure
+
+
+ nmrml2isa_macros.xml
+
+
+
+
+
+ nmrml2isa
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 10.1002/0471250953.bi1413s53
+ 10.1007/s11306-015-0879-3
+ 10.1038/ng.1054
+
+
+
+
+
+
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/galaxy/nmrml2isa/nmrml2isa_macros.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nmrml2isa-galaxy/galaxy/nmrml2isa/nmrml2isa_macros.xml Fri Feb 03 11:25:37 2017 -0500
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/galaxy/nmrml2isa/ontology_search.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nmrml2isa-galaxy/galaxy/nmrml2isa/ontology_search.py Fri Feb 03 11:25:37 2017 -0500
@@ -0,0 +1,33 @@
+#!/usr/bin/python
+import os
+import csv
+import inspect
+
+
+def getNames(source="role"):
+
+
+ filename = inspect.getframeinfo(inspect.currentframe()).filename
+ path = os.path.dirname(os.path.abspath(filename))
+
+
+ if source == "role":
+ tablepth = os.path.join(path, 'pub_role.loc')
+ elif source == "status":
+ tablepth = os.path.join(path, 'pub_status.loc')
+ else:
+ print "Table not recognised"
+ return ""
+
+ print tablepth
+
+ with open(tablepth, "rb") as csvfile:
+ reader = csv.reader(csvfile, delimiter='\t')
+ l = list(reader)
+
+ l = [i + [""] for i in l]
+
+ l.sort(key=lambda x: x[0])
+
+ return l
+
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/galaxy/nmrml2isa/pub_role.loc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nmrml2isa-galaxy/galaxy/nmrml2isa/pub_role.loc Fri Feb 03 11:25:37 2017 -0500
@@ -0,0 +1,33 @@
+"Biographer" "http://purl.org/spar/pro/biographer"
+"Critic" "http://purl.org/spar/pro/critic"
+"Librarian" "http://purl.org/spar/pro/librarian"
+"Illustrator" "http://purl.org/spar/pro/illustrator"
+"Producer" "http://purl.org/spar/pro/producer"
+"Ghost writer" "http://purl.org/spar/pro/ghost-writer"
+"Deputy editor" "http://purl.org/spar/pro/deputy-editor"
+"Senior editor" "http://purl.org/spar/pro/senior-editor"
+"Production editor" "http://purl.org/spar/pro/production-editor"
+"Author" "http://purl.org/spar/pro/author"
+"Author's agent" "http://purl.org/spar/pro/authors-agent"
+"Translator" "http://purl.org/spar/pro/translator"
+"Commissioning editor" "http://purl.org/spar/pro/commissioning-editor"
+"Publisher" "http://purl.org/spar/pro/publisher"
+"Proof reader" "http://purl.org/spar/pro/proof-reader"
+"Managing editor" "http://purl.org/spar/pro/managing-editor"
+"Copy editor" "http://purl.org/spar/pro/copy-editor"
+"Journalist" "http://purl.org/spar/pro/journalist"
+"Blogger" "http://purl.org/spar/pro/blogger"
+"Guest editor" "http://purl.org/spar/pro/guest-editor"
+"Reader" "http://purl.org/spar/pro/reader"
+"Contributor" "http://purl.org/spar/pro/contributor"
+"Reviewer" "http://purl.org/spar/pro/reviewer"
+"Printer" "http://purl.org/spar/pro/printer"
+"Editor" "http://purl.org/spar/pro/editor"
+"Executive editor" "http://purl.org/spar/pro/executive-editor"
+"Archivist" "http://purl.org/spar/pro/archivist"
+"Distributor" "http://purl.org/spar/pro/distributor"
+"Copyright owner" "http://purl.org/spar/pro/copyright-owner"
+"Compiler" "http://purl.org/spar/pro/compiler"
+"Peer reviewer" "http://purl.org/spar/pro/peer-reviewer"
+"Editor-in-chief" "http://purl.org/spar/pro/editor-in-chief"
+"Series editor" "http://purl.org/spar/pro/series-editor"
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/galaxy/nmrml2isa/pub_status.loc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nmrml2isa-galaxy/galaxy/nmrml2isa/pub_status.loc Fri Feb 03 11:25:37 2017 -0500
@@ -0,0 +1,36 @@
+"Peer reviewed" "http://purl.org/spar/pso/peer-reviewed"
+"Published" "http://purl.org/spar/pso/published"
+"Draft" "http://purl.org/spar/pso/draft"
+"Anonymized" "http://purl.org/spar/pso/anonymized"
+"Intermediate draft" "http://purl.org/spar/pso/intermediate-draft"
+"Republished" "http://purl.org/spar/pso/republished"
+"Open access" "http://purl.org/spar/pso/open-access"
+"Closed access" "http://purl.org/spar/pso/closed-access"
+"Under review" "http://purl.org/spar/pso/under-review"
+"Corrected" "http://purl.org/spar/pso/corrected"
+"Confidential" "http://purl.org/spar/pso/confidential"
+"Rejected for publication" "http://purl.org/spar/pso/rejected-for-publication"
+"Unpublished" "http://purl.org/spar/pso/unpublished"
+"Catalogued" "http://purl.org/spar/pso/catalogued"
+"Enhanced" "http://purl.org/spar/pso/enhanced"
+"Green open access" "http://purl.org/spar/pso/green-open-access"
+"Reviewed" "http://purl.org/spar/pso/reviewed"
+"Restricted access" "http://purl.org/spar/pso/restricted-access"
+"Withdrawn from submission" "http://purl.org/spar/pso/withdrawn-from-submission"
+"Embargoed" "http://purl.org/spar/pso/embargoed"
+"Revised" "http://purl.org/spar/pso/revised"
+"Accepted for publication" "http://purl.org/spar/pso/accepted-for-publication"
+"Final draft" "http://purl.org/spar/pso/final-draft"
+"Archived" "http://purl.org/spar/pso/archived"
+"Proof" "http://purl.org/spar/pso/proof"
+"Version of record" "http://purl.org/spar/pso/version-of-record"
+"Gold open access" "http://purl.org/spar/pso/gold-open-access"
+"Gratis open access" "http://purl.org/spar/pso/gratis-open-access"
+"Subscription access" "http://purl.org/spar/pso/subscription-access"
+"Non-confidential" "http://purl.org/spar/pso/non-confidential"
+"Initial draft" "http://purl.org/spar/pso/initial-draft"
+"Retracted from publication" "http://purl.org/spar/pso/retracted-from-publication"
+"Copy-edited" "http://purl.org/spar/pso/copy-edited"
+"Submitted" "http://purl.org/spar/pso/submitted"
+"Libre open access" "http://purl.org/spar/pso/libre-open-access"
+"In press" "http://purl.org/spar/pso/in-press"
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/galaxy/nmrml2isa/shed.yml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nmrml2isa-galaxy/galaxy/nmrml2isa/shed.yml Fri Feb 03 11:25:37 2017 -0500
@@ -0,0 +1,15 @@
+name: nmrml2isa
+owner: rjmweber
+description: Contains a tool dependency definition that downloads and extract version 0.2.1 of nmrml2isa.
+homepage_url: https://github.com/ISA-tools/nmrml2isa
+long_description: nmrml2isa is a Python program that can be used to generate an ISA-Tab structure out of nmrML files, providing the backbone of a study which can then be edited with an ISA editing tool (see MetaboLights pre-packaged ISA Creator - http://www.ebi.ac.uk/metabolights/)
+remote_repository_url: https://github.com/ISA-tools/nmrml2isa
+type: unrestricted
+categories:
+ - "Metabolomics"
+include:
+ - nmrml2isa.xml
+ - static/images/**
+ - test-data/**
+ - README.rst
+
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/galaxy/nmrml2isa/test-data/metabolomics_study.zip
Binary file nmrml2isa-galaxy/galaxy/nmrml2isa/test-data/metabolomics_study.zip has changed
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/galaxy/nmrml2isa/test-data/metabolomics_study/test/a_test_metabolite_profiling_NMR_spectroscopy.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nmrml2isa-galaxy/galaxy/nmrml2isa/test-data/metabolomics_study/test/a_test_metabolite_profiling_NMR_spectroscopy.txt Fri Feb 03 11:25:37 2017 -0500
@@ -0,0 +1,4 @@
+"Sample Name" "Protocol REF" "Parameter Value[Extraction Method]" "Term Source REF" "Term Accession Number" "Extract Name" "Protocol REF" "Parameter Value[NMR tube type]" "Term Source REF" "Term Accession Number" "Parameter Value[Solvent]" "Term Source REF" "Term Accession Number" "Parameter Value[Sample pH]" "Parameter Value[Temperature]" "Unit" "Term Source REF" "Term Accession Number" "Labeled Extract Name" "Label" "Term Source REF" "Term Accession Number" "Protocol REF" "Parameter Value[Instrument manufacturer]" "Term Source REF" "Term Accession Number" "Parameter Value[Instrument]" "Term Source REF" "Term Accession Number" "Parameter Value[NMR Probe]" "Term Source REF" "Term Accession Number" "Parameter Value[Instrument software]" "Term Source REF" "Term Accession Number" "Parameter Value[Instrument software version]" "Parameter Value[Acquisition Nucleus]" "Term Source REF" "Term Accession Number" "Parameter Value[Number of transients]" "Parameter Value[Number of steady state scans]" "Parameter Value[Pulse sequence]" "Term Source REF" "Term Accession Number" "Parameter Value[Pulse Width]" "Unit" "Term Source REF" "Term Accession Number" "Parameter Value[Sweep Width]" "Unit" "Term Source REF" "Term Accession Number" "Parameter Value[Relaxation Delay]" "Unit" "Term Source REF" "Term Accession Number" "Parameter Value[Magnetic field strength]" "Unit" "Term Source REF" "Term Accession Number" "Parameter Value[Acquisition Parameter Data Format]" "Term Source REF" "Term Accession Number" "Protocol REF" "NMR Assay Name" "Free Induction Decay Data File" "Protocol REF" "Normalization Name" "Derived Spectral Data File" "Protocol REF" "Parameter Value[Data transformation software]" "Term Source REF" "Term Accession Number" "Parameter Value[Data Transformation software version]" "Data Transformation Name" "Term Source REF" "Term Accession Number" "Data Transformation Name" "Term Source REF" "Term Accession Number" "Metabolite Assignment File"
+"ADG10003u_007" "Extraction" "" "" "" "" "NMR sample" "Sample-tube" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400132" "" "" "" "" "300.0" "kelvin" "UO" "http://purl.obolibrary.org/obo/UO_0000012" "" "" "" "" "NMR spectroscopy" "Bruker" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400256" "Bruker NMR instrument" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400198" "5 mm PATXI 1H-13C/15N XYZ-GRD Z561501/0002" "" "" "Bruker UXNMR/XWIN-NMR format" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400320" "Version 3.5" "hydrogen atom" "CHEBI" "http://purl.obolibrary.org/obo/CHEBI_49637" "128" "8" "noesypr1d" "" "" "7.75" "microsecond" "UO" "http://purl.obolibrary.org/obo/UO_0000029" "14005.602241" "hertz" "UO" "http://purl.obolibrary.org/obo/UO_0000106" "3.0" "second" "UO" "http://purl.obolibrary.org/obo/UO_0000010" "16.438" "tesla" "UO" "http://purl.obolibrary.org/obo/UO_0000228" "Bruker UXNMR/XWIN-NMR format" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400320" "NMR assay" "ADG10003u_007" "ADG10003u_007/10/fid" "Data transformation" "" "" "Metabolite identification" "Bruker UXNMR/XWIN-NMR format" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400320" "Version 3.5" "phase correction" "NMRCV" "http://nmrML.org/nmrCV#NMR:1000071" "fourier transformation" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400044" ""
+"ADG10003u_008" "Extraction" "" "" "" "" "NMR sample" "Sample-tube" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400132" "" "" "" "" "300.0" "kelvin" "UO" "http://purl.obolibrary.org/obo/UO_0000012" "" "" "" "" "NMR spectroscopy" "Bruker" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400256" "Bruker NMR instrument" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400198" "5 mm PATXI 1H-13C/15N XYZ-GRD Z561501/0002" "" "" "Bruker UXNMR/XWIN-NMR format" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400320" "Version 3.5" "hydrogen atom" "CHEBI" "http://purl.obolibrary.org/obo/CHEBI_49637" "128" "8" "noesypr1d" "" "" "7.86" "microsecond" "UO" "http://purl.obolibrary.org/obo/UO_0000029" "14005.602241" "hertz" "UO" "http://purl.obolibrary.org/obo/UO_0000106" "3.0" "second" "UO" "http://purl.obolibrary.org/obo/UO_0000010" "16.438" "tesla" "UO" "http://purl.obolibrary.org/obo/UO_0000228" "Bruker UXNMR/XWIN-NMR format" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400320" "NMR assay" "ADG10003u_008" "ADG10003u_008/10/fid" "Data transformation" "" "" "Metabolite identification" "Bruker UXNMR/XWIN-NMR format" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400320" "Version 3.5" "phase correction" "NMRCV" "http://nmrML.org/nmrCV#NMR:1000071" "fourier transformation" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400044" ""
+"ADG10003u_009" "Extraction" "" "" "" "" "NMR sample" "Sample-tube" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400132" "" "" "" "" "300.0" "kelvin" "UO" "http://purl.obolibrary.org/obo/UO_0000012" "" "" "" "" "NMR spectroscopy" "Bruker" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400256" "Bruker NMR instrument" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400198" "5 mm PATXI 1H-13C/15N XYZ-GRD Z561501/0002" "" "" "Bruker UXNMR/XWIN-NMR format" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400320" "Version 3.5" "hydrogen atom" "CHEBI" "http://purl.obolibrary.org/obo/CHEBI_49637" "128" "8" "noesypr1d" "" "" "8.16" "microsecond" "UO" "http://purl.obolibrary.org/obo/UO_0000029" "14005.602241" "hertz" "UO" "http://purl.obolibrary.org/obo/UO_0000106" "3.0" "second" "UO" "http://purl.obolibrary.org/obo/UO_0000010" "16.438" "tesla" "UO" "http://purl.obolibrary.org/obo/UO_0000228" "Bruker UXNMR/XWIN-NMR format" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400320" "NMR assay" "ADG10003u_009" "ADG10003u_009/10/fid" "Data transformation" "" "" "Metabolite identification" "Bruker UXNMR/XWIN-NMR format" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400320" "Version 3.5" "phase correction" "NMRCV" "http://nmrML.org/nmrCV#NMR:1000071" "fourier transformation" "NMRCV" "http://nmrML.org/nmrCV#NMR:1400044" ""
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/galaxy/nmrml2isa/test-data/metabolomics_study/test/i_Investigation.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nmrml2isa-galaxy/galaxy/nmrml2isa/test-data/metabolomics_study/test/i_Investigation.txt Fri Feb 03 11:25:37 2017 -0500
@@ -0,0 +1,94 @@
+ONTOLOGY SOURCE REFERENCE
+Term Source Name "EFO" "CHMO" "OBI" "NCIT" "NMRCV" "UO" "CHEBI"
+Term Source File "http://data.bioontology.org/ontologies/EFO" "http://data.bioontology.org/ontologies/CHMO" "http://data.bioontology.org/ontologies/OBI" "http://data.bioontology.org/ontologies/NCIT" "http://nmrml.org/cv/v1.0.rc1/nmrCV.owl" "http://purl.obolibrary.org/obo/uo.owl" "http://purl.bioontology.org/ontology/CHEBI"
+Term Source Version "119" "12" "23" "34" "1.0.rc1" "1.2" "141"
+Term Source Description "Experimental Factor Ontology" "Chemical Methods Ontology" "Ontology for Biomedical Investigations" "National Cancer Institute Thesaurus" "NMR Controled Vocabulary" "Units of measurement Ontology" "Chemical Entities of Biological Interest"
+INVESTIGATION
+Investigation Identifier "test"
+Investigation Title "Investigation"
+Investigation Description ""
+Investigation Submission Date ""
+Investigation Public Release Date ""
+Comment[Created With Configuration] ""
+Comment[Last Opened With Configuration] ""
+Comment[Created with Tool] "nmrml2isa 0.3.0"
+INVESTIGATION PUBLICATIONS
+Investigation PubMed ID "" "" "" "" ""
+Investigation Publication DOI "" "" "" "" ""
+Investigation Publication Author List "" "" "" "" ""
+Investigation Publication Title "" "" "" "" ""
+Investigation Publication Status "" "" "" "" ""
+Investigation Publication Status Term Accession Number "" "" "" "" ""
+Investigation Publication Status Term Source REF "" "" "" "" ""
+INVESTIGATION CONTACTS
+Investigation Person Last Name ""
+Investigation Person First Name ""
+Investigation Person Mid Initials ""
+Investigation Person Email ""
+Investigation Person Phone ""
+Investigation Person Fax ""
+Investigation Person Address ""
+Investigation Person Affiliation ""
+Investigation Person Roles ""
+Investigation Person Roles Term Accession Number ""
+Investigation Person Roles Term Source REF ""
+STUDY
+Study Identifier "test"
+Study Title "test"
+Study Description ""
+Study Submission Date ""
+Study Public Release Date ""
+Study File Name "s_test.txt"
+STUDY DESIGN DESCRIPTORS
+Study Design Type ""
+Study Design Type Term Accession Number ""
+Study Design Type Term Source REF ""
+STUDY PUBLICATIONS
+Study PubMed ID ""
+Study Publication DOI ""
+Study Publication Author List ""
+Study Publication Title ""
+Study Publication Status ""
+Study Publication Status Term Accession Number ""
+Study Publication Status Term Source REF "PSO"
+STUDY FACTORS
+Study Factor Name ""
+Study Factor Type ""
+Study Factor Type Term Accession Number ""
+Study Factor Type Term Source REF ""
+STUDY ASSAYS
+Study Assay File Name "a_test_metabolite_profiling_NMR_spectroscopy.txt"
+Study Assay Measurement Type "metabolite profiling"
+Study Assay Measurement Type Term Accession Number "http://purl.obolibrary.org/obo/OBI_0000366"
+Study Assay Measurement Type Term Source REF "OBI"
+Study Assay Technology Type "NMR spectroscopy"
+Study Assay Technology Type Term Accession Number "http://purl.obolibrary.org/obo/OBI_0000623"
+Study Assay Technology Type Term Source REF "OBI"
+Study Assay Technology Platform "{'ref': 'NMRCV', 'name': 'Bruker NMR instrument', 'accession': 'http://nmrML.org/nmrCV#NMR:1400198'}"
+STUDY PROTOCOLS
+Study Protocol Name "Extraction" "NMR sample" "NMR spectroscopy" "NMR assay" "Data transformation" "Metabolite identification" "Sample collection"
+Study Protocol Type "Extraction" "NMR sample" "NMR spectroscopy" "NMR assay" "Data transformation" "Metabolite identification" "Sample collection"
+Study Protocol Type Term Accession Number "" "" "" "" "" "" ""
+Study Protocol Type Term Source REF "" "" "" "" "" "" ""
+Study Protocol Description "" "" "" "" "" "" ""
+Study Protocol URI "" "" "" "" "" "" ""
+Study Protocol Version "" "" "" "" "" "" ""
+Study Protocol Parameters Name "Extraction Method" "NMR tube type;Temperature;Sample pH;Solvent" "Magnetic field strength;Pulse sequence name;Instrument;NMR Probe;Number of transients" "" "" "" ""
+Study Protocol Parameters Name Term Accession Number "" ";;;" ";;;;" "" "" "" ""
+Study Protocol Parameters Name Term Source REF "" ";;;" ";;;;" "" "" "" ""
+Study Protocol Components Name "" "" "" "" "" "" ""
+Study Protocol Components Type "" "" "" "" "" "" ""
+Study Protocol Components Type Term Accession Number "" "" "" "" "" "" ""
+Study Protocol Components Type Term Source REF "" "" "" "" "" "" ""
+STUDY CONTACTS
+Study Person Last Name "mse"
+Study Person First Name ""
+Study Person Mid Initials ""
+Study Person Email ""
+Study Person Phone ""
+Study Person Fax ""
+Study Person Address ""
+Study Person Affiliation ""
+Study Person Roles ""
+Study Person Roles Term Accession Number ""
+Study Person Roles Term Source REF ""
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/galaxy/nmrml2isa/test-data/metabolomics_study/test/index.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nmrml2isa-galaxy/galaxy/nmrml2isa/test-data/metabolomics_study/test/index.html Fri Feb 03 11:25:37 2017 -0500
@@ -0,0 +1,1 @@
+a_test_metabolite_profiling_NMR_spectroscopy.txt
i_Investigation.txt
s_test.txt
\ No newline at end of file
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/galaxy/nmrml2isa/test-data/metabolomics_study/test/s_test.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nmrml2isa-galaxy/galaxy/nmrml2isa/test-data/metabolomics_study/test/s_test.txt Fri Feb 03 11:25:37 2017 -0500
@@ -0,0 +1,4 @@
+"Source Name" "Characteristics[Organism]" "Term Source REF" "Term Accession Number" "Characteristics[Organism variant]" "Term Source REF" "Term Accession Number" "Characteristics[Organism part]" "Term Source REF" "Term Accession Number" "Protocol REF" "Sample Name"
+"" "" "" "" "" "" "" "" "" "" "Sample collection" "ADG10003u_007"
+"" "" "" "" "" "" "" "" "" "" "Sample collection" "ADG10003u_008"
+"" "" "" "" "" "" "" "" "" "" "Sample collection" "ADG10003u_009"
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/galaxy/nmrml2isa/tool-data/get_status_ont.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nmrml2isa-galaxy/galaxy/nmrml2isa/tool-data/get_status_ont.py Fri Feb 03 11:25:37 2017 -0500
@@ -0,0 +1,51 @@
+import sys
+import os
+import json
+import urllib.error
+import urllib.request as rq
+from urllib.parse import quote
+import csv
+
+###############################################################################
+# Python3 script to get tab seperated maf_index.loc files for drop down menus
+###############################################################################
+# Code modified from mzm2isa-qt python package developed by Martin Larralde
+# https://github.com/althonos/mzml2isa-qt/scrapers.py
+
+
+def get_ont_loc(jsonSourceUrl, sparName, ontoClass, filepth):
+ onto = json.loads(rq.urlopen(jsonSourceUrl).read().decode('utf-8'))
+ info = []
+ for x in onto:
+ if '@type' in x:
+ if ontoClass in x['@type']:
+ info.append(x)
+ info = [ (x['http://www.w3.org/2000/01/rdf-schema#label'],x['@id']) for x in info ]
+
+ ontd = {x[0]['@value'].capitalize():y for (x,y) in info}
+
+ with open(filepth, 'w') as f:
+ writer = csv.writer(f, delimiter='\t', quoting=csv.QUOTE_ALL)
+ writer.writerow(["name", "link"])
+ for key, value in ontd.items():
+ writer.writerow([key, value])
+
+ return ontd
+
+#-------------------------------
+# publication status ontology
+#-------------------------------
+jsonSourceUrl = "http://www.sparontologies.net/ontologies/pso/source.json"
+sparName = "pso"
+ontoClass = "http://purl.org/spar/pso/PublicationStatus"
+get_ont_loc(jsonSourceUrl, sparName, ontoClass, './pub_status.loc')
+
+#-------------------------------
+# Job role ontology
+#-------------------------------
+jsonSourceUrl = "http://www.sparontologies.net/ontologies/pro/source.json"
+sparName = "pro"
+ontoClass = "http://purl.org/spar/pro/PublishingRole"
+get_ont_loc(jsonSourceUrl, sparName, ontoClass, './pub_role.loc')
+
+
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/galaxy/nmrml2isa/wrapper.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nmrml2isa-galaxy/galaxy/nmrml2isa/wrapper.py Fri Feb 03 11:25:37 2017 -0500
@@ -0,0 +1,229 @@
+#!/usr/bin/env python
+
+import sys
+import json
+import os
+import argparse
+import textwrap
+import csv
+import inspect
+
+
+def ontology_lookup(name, table):
+ # takes in ontology name and source (e.g. loc file) and outputs the associated accesion number
+ filename = inspect.getframeinfo(inspect.currentframe()).filename
+ path = os.path.dirname(os.path.abspath(filename))
+
+ # check if correct table
+ if table=="role":
+ tablepth = os.path.join(path, 'pub_role.loc')
+ elif table=="status":
+ tablepth = os.path.join(path, 'pub_status.loc')
+ else:
+ print "Table not recognised"
+ return ""
+
+ with open(tablepth, "rb") as csvfile:
+ reader = csv.reader(csvfile, delimiter='\t')
+ ont_dict = dict((k, v) for k, v in reader)
+ try:
+ print ont_dict[name]
+ return ont_dict[name]
+ except KeyError:
+ return ""
+
+
+
+def main():
+
+ p = argparse.ArgumentParser(prog='PROG',
+ formatter_class=argparse.RawDescriptionHelpFormatter,
+ description='''nmrml2isa''',
+ epilog=textwrap.dedent('''\
+ -------------------------------------------------------------------------
+ '''))
+
+
+ p.add_argument('-inputzip', dest='inputzip', required=True)
+ p.add_argument('-out_dir', dest='out_dir', required=True)
+ p.add_argument('-html_file', dest='html_file', required=True)
+ p.add_argument('-study_title', dest='study_title', required=True)
+
+ p.add_argument('-jsontxt', dest='jsontxt', required=False, nargs='?')
+
+ p.add_argument('--s_submission_date', dest='s_submission_date', required=False, default="", nargs='?')
+ p.add_argument('--s_release_date', dest='s_release_date', required=False, default="", nargs='?')
+ p.add_argument('--s_description', dest='s_description', required=False, default="", nargs='?')
+ p.add_argument('--s_pubmed', dest='s_pubmed', required=False, default="", nargs='?')
+ p.add_argument('--s_pub_doi', dest='s_pub_doi', required=False, default="", nargs='?')
+ p.add_argument('--s_pub_status', dest='s_pub_status', required=False, default="", nargs='?')
+ p.add_argument('--s_pub_author', dest='s_pub_author', required=False, default="", nargs='?')
+ p.add_argument('--s_pub_title', dest='s_pub_title', required=False, default="", nargs='?')
+ p.add_argument('--s_first_name', dest='s_first_name', required=False, default="", nargs='?')
+ p.add_argument('--s_mid_initials', dest='s_mid_initials', required=False, default="", nargs='?')
+ p.add_argument('--s_last_name', dest='s_last_name', required=False, default="", nargs='?')
+ p.add_argument('--s_telephone', dest='s_telephone', required=False, default="", nargs='?')
+ p.add_argument('--s_fax', dest='s_fax', required=False, default="", nargs='?')
+ p.add_argument('--s_affiliation', dest='s_affiliation', required=False, default="", nargs='?')
+ p.add_argument('--s_role', dest='s_role', required=False, default="", nargs='?')
+ p.add_argument('--s_mail', dest='s_mail', required=False, default="", nargs='?')
+ p.add_argument('--s_address', dest='s_address', required=False, default="", nargs='?')
+ p.add_argument('--i_submission_date', dest='i_submission_date', required=False, default="", nargs='?')
+ p.add_argument('--i_release_date', dest='i_release_date', required=False, default="", nargs='?')
+ p.add_argument('--i_description', dest='i_description', required=False, default="", nargs='?')
+ p.add_argument('--i_pubmed', dest='i_pubmed', required=False, default="", nargs='?')
+ p.add_argument('--i_pub_doi', dest='i_pub_doi', required=False, default="", nargs='?')
+ p.add_argument('--i_pub_title', dest='i_pub_title', required=False, default="", nargs='?')
+ p.add_argument('--i_pub_status', dest='i_pub_status', required=False, default="", nargs='?')
+ p.add_argument('--i_pub_author', dest='i_pub_author', required=False, default="", nargs='?')
+ p.add_argument('--i_first_name', dest='i_first_name', required=False, default="", nargs='?')
+ p.add_argument('--i_mid_initials', dest='i_mid_initials', required=False, default="", nargs='?')
+ p.add_argument('--i_last_name', dest='i_last_name', required=False, default="", nargs='?')
+ p.add_argument('--i_telephone', dest='i_telephone', required=False, default="", nargs='?')
+ p.add_argument('--i_fax', dest='i_fax', required=False, default="", nargs='?')
+ p.add_argument('--i_affiliation', dest='i_affiliation', required=False, default="", nargs='?')
+ p.add_argument('--i_role', dest='i_role', required=False, default="", nargs='?')
+ p.add_argument('--i_mail', dest='i_mail', required=False, default="", nargs='?')
+ p.add_argument('--i_address', dest='i_address', required=False, default="", nargs='?')
+ p.add_argument('--organism_text', dest='organism_text', required=False, default="", nargs='?')
+ p.add_argument('--organism_ref', dest='organism_ref', required=False, default="", nargs='?')
+ p.add_argument('--organism_iri', dest='organism_iri', required=False, default="", nargs='?')
+ p.add_argument('--organism_part_text', dest='organism_part_text', required=False, default="", nargs='?')
+ p.add_argument('--organism_part_ref', dest='organism_part_ref', required=False, default="", nargs='?')
+ p.add_argument('--organism_part_iri', dest='organism_part_iri', required=False, default="", nargs='?')
+ p.add_argument('--organism_variant_text', dest='organism_variant_text', required=False, default="", nargs='?')
+ p.add_argument('--organism_variant_ref', dest='organism_variant_ref', required=False, default="", nargs='?')
+ p.add_argument('--organism_variant_iri', dest='organism_variant_iri', required=False, default="", nargs='?')
+
+ args = p.parse_args()
+
+ USERMETA = {'characteristics': {'organism': {'name': '', 'accession': '', 'ref': ''},
+ 'organism_variant': {'name': '', 'accession': '', 'ref': ''},
+ 'organism_part': {'name': '', 'accession': '', 'ref': ''},
+ },
+ 'investigation': {'identifier': '', 'title': 'Investigation', 'description': '',
+ 'submission_date': '', 'release_date': ''
+ },
+ 'investigation_publication': {'pubmed': '', 'doi': '', 'author_list': '', 'title': '',
+ 'status': {'name': '', 'accession': '', 'ref': 'PSO'},
+ },
+
+ 'study': {
+ 'title': '', 'description': '', 'submission_date': '', 'release_date': '',
+ },
+ 'study_publication': {'pubmed': '', 'doi': '', 'author_list': '', 'title': '',
+ 'status': {'name': '', 'accession': '', 'ref': 'PSO'},
+ },
+
+ 'description': {'sample_collect': '', 'extraction': '', 'chroma': '', 'mass_spec': '',
+ 'data_trans': '', 'metabo_id': ''
+ },
+
+ # Multiple Values Parameters
+ 'study_contacts': [
+ {'first_name': '', 'last_name': '', 'mid': '', 'email': '',
+ 'fax': '', 'phone': '', 'adress': '', 'affiliation': '',
+ 'roles': {'name': '', 'accession': '', 'ref': ''},
+ },
+ ],
+
+ 'investigation_contacts': [
+ {'first_name': '', 'last_name': '', 'mid': '', 'email': '',
+ 'fax': '', 'phone': '', 'adress': '', 'affiliation': '',
+ 'roles': {'name': '', 'accession': '', 'ref': ''},
+ },
+ ],
+
+ }
+
+ # check if using json file
+ if args.jsontxt and os.path.isfile(args.jsontxt):
+ with open(args.jsontxt, 'r') as f:
+ USERMETA = json.load(f)
+ else:
+
+ # Fill in USERMETA dictionary
+ USERMETA['characteristics']['organism']['value'] = args.organism_text
+ USERMETA['characteristics']['organism']['accession'] = args.organism_iri
+ USERMETA['characteristics']['organism']['ref'] = args.organism_ref
+
+ USERMETA['characteristics']['organism_variant']['value'] = args.organism_variant_text
+ USERMETA['characteristics']['organism_variant']['accession'] = args.organism_variant_iri
+ USERMETA['characteristics']['organism_variant']['ref'] = args.organism_variant_ref
+
+ USERMETA['characteristics']['organism_part']['value'] = args.organism_part_text
+ USERMETA['characteristics']['organism_part']['accession'] = args.organism_part_iri
+ USERMETA['characteristics']['organism_part']['ref'] = args.organism_part_ref
+
+ # USERMETA['investigation']['identifier'] = # uses study identifier
+ USERMETA['investigation']['description'] = args.i_description
+ USERMETA['investigation']['submission_date'] = args.i_submission_date
+ USERMETA['investigation']['release_date'] = args.i_release_date
+
+ USERMETA['investigation_publication']['pubmed'] = args.i_pubmed
+ USERMETA['investigation_publication']['author_list'] = args.i_pub_author
+ USERMETA['investigation_publication']['title'] = args.i_pub_title
+ USERMETA['investigation_publication']['doi'] = args.i_pub_doi
+ USERMETA['investigation_publication']['status']['name'] = args.i_pub_status
+ USERMETA['investigation_publication']['status']['accession'] = ontology_lookup(args.i_pub_status, 'status')
+
+ USERMETA['investigation_contacts'][0]['first_name'] = args.i_first_name
+ USERMETA['investigation_contacts'][0]['last_name'] = args.i_last_name
+ USERMETA['investigation_contacts'][0]['mid'] = args.i_mid_initials
+ USERMETA['investigation_contacts'][0]['email'] = args.i_mail
+ USERMETA['investigation_contacts'][0]['fax'] = args.i_fax
+ USERMETA['investigation_contacts'][0]['phone'] = args.i_telephone
+ USERMETA['investigation_contacts'][0]['adress'] = args.i_address
+ USERMETA['investigation_contacts'][0]['affiliation'] = args.i_affiliation
+ USERMETA['investigation_contacts'][0]['roles']['name'] = args.i_role
+ USERMETA['investigation_contacts'][0]['roles']['accession'] = ontology_lookup(args.i_role, 'role')
+
+ USERMETA['study']['title'] = args.study_title
+ USERMETA['study']['description'] = args.s_description
+ USERMETA['study']['submission_date'] = args.s_submission_date
+ USERMETA['study']['release_date'] = args.s_release_date
+
+ USERMETA['study_publication']['pubmed'] = args.s_pubmed
+ USERMETA['study_publication']['author_list'] = args.s_pub_author
+ USERMETA['study_publication']['title'] = args.s_pub_title
+ USERMETA['study_publication']['doi'] = args.s_pub_doi
+ USERMETA['study_publication']['status']['name'] = args.s_pub_status
+ USERMETA['study_publication']['status']['accession'] = ontology_lookup(args.s_pub_status, 'status')
+
+ USERMETA['study_contacts'][0]['first_name'] = args.s_first_name
+ USERMETA['study_contacts'][0]['last_name'] = args.s_last_name
+ USERMETA['study_contacts'][0]['mid'] = args.s_mid_initials
+ USERMETA['study_contacts'][0]['email'] = args.s_mail
+ USERMETA['study_contacts'][0]['fax'] = args.s_fax
+ USERMETA['study_contacts'][0]['phone'] = args.s_telephone
+ USERMETA['study_contacts'][0]['adress'] = args.s_address
+ USERMETA['study_contacts'][0]['affiliation'] = args.s_affiliation
+ USERMETA['study_contacts'][0]['roles']['name'] = args.s_role
+ USERMETA['study_contacts'][0]['roles']['accession'] = ontology_lookup(args.s_role, 'role')
+
+
+ try:
+ from nmrml2isa.parsing import full_parse
+ # import progressbar as pb
+ # parse the files
+ full_parse(args.inputzip, args.out_dir, args.study_title, usermeta=USERMETA, verbose=True)
+
+ except ImportError:
+ import tempfile
+ temp = tempfile.NamedTemporaryFile()
+ temp.write(json.dumps(USERMETA))
+ temp.seek(0)
+ os.system("nmrml2isa -i %s -o %s -s %s -m %s" % (args.inputzip, args.out_dir, args.study_title, temp.name))
+ temp.close()
+
+ html_code = 'a_%s_metabolite_profiling_NMR_spectroscopy.txt' \
+ '
i_Investigation.txt
' \
+ 's_test.txt
' % tuple([args.study_title] * 6)
+
+ with open(args.html_file, 'wb') as f:
+ f.write(html_code)
+
+
+
+if __name__ == "__main__":
+ main()
diff -r 000000000000 -r 5990ad113145 nmrml2isa-galaxy/test.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/nmrml2isa-galaxy/test.sh Fri Feb 03 11:25:37 2017 -0500
@@ -0,0 +1,22 @@
+sudo apt-get install python-dev libxml2-dev libxslt1-dev zlib1g-dev
+sudo apt-get install -y python-virtualenv
+virtualenv planemo-venv
+. planemo-venv/bin/activate
+pip install --upgrade pip setuptools
+pip install planemo
+#planemo travis_before_install
+#. .travis/env.sh # source environment created by planemo
+export DOWNLOAD_CACHE=$HOME/download_cache
+mkdir $DOWNLOAD_CACHE
+#git clone https://github.com/ISA-tools/nmrml2isa-galaxy.git
+planemo dependency_script -r packages/package_nmrml2isa_0_4_22/
+. env.sh
+bash dep_install.sh
+planemo test --galaxy_root=../galaxy galaxy/nmrml2isa/
+rm env.sh
+rm dep_install.sh
+deactivate #exit virtualenv
+rm -r planemo-venv
+rm -r lib
+
+