diff --git a/Manifest.toml b/Manifest.toml new file mode 100644 index 0000000..a1621ae --- /dev/null +++ b/Manifest.toml @@ -0,0 +1,366 @@ +[[ArgParse]] +deps = ["Logging", "TextWrap"] +git-tree-sha1 = "a8fc2e149cd6db276c76faebe197ccd3a92fb9ff" +uuid = "c7e460c6-2fb9-53a9-8c5b-16f535851c63" +version = "1.1.0" + +[[Automa]] +deps = ["DataStructures", "Printf", "Random", "Test", "TranscodingStreams"] +git-tree-sha1 = "c81526bf5f6fb4616b4e22a3cd62ac20e255fd3c" +uuid = "67c07d97-cdcb-5c2c-af73-a7f9c32a568b" +version = "0.8.0" + +[[Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[BenchmarkTools]] +deps = ["JSON", "Logging", "Printf", "Statistics", "UUIDs"] +git-tree-sha1 = "9e62e66db34540a0c919d72172cc2f642ac71260" +uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +version = "0.5.0" + +[[BinDeps]] +deps = ["Libdl", "Pkg", "SHA", "URIParser", "Unicode"] +git-tree-sha1 = "46cf2c1668ad07aba5a9d331bdeea994a1f13856" +uuid = "9e28174c-4ba2-5203-b857-d8d62c4213ee" +version = "1.0.1" + +[[BinaryProvider]] +deps = ["Libdl", "Logging", "SHA"] +git-tree-sha1 = "ecdec412a9abc8db54c0efc5548c64dfce072058" +uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232" +version = "0.5.10" + +[[BioGenerics]] +deps = ["TranscodingStreams"] +git-tree-sha1 = "57deb413ca9f4c8bc7d4c6e98ebe217ff728c737" +uuid = "47718e42-2ac5-11e9-14af-e5595289c2ea" +version = "0.1.0" + +[[BioSequences]] +deps = ["BioGenerics", "BioSymbols", "Combinatorics", "IndexableBitVectors", "Printf", "Random", "StableRNGs", "Twiddle"] +git-tree-sha1 = "3b04c643d3308b5c4f7f33bb02a578ab1ff13278" +uuid = "7e6ae17a-c86d-528c-b3b9-7f778a29fe59" +version = "2.0.4" + +[[BioSymbols]] +deps = ["Automa"] +git-tree-sha1 = "ec77888ac3e78f9d372c2b533bdb52668f9e2b09" +uuid = "3c28c6f8-a34d-59c4-9654-267d177fcfa9" +version = "4.0.4" + +[[Blosc]] +deps = ["BinaryProvider", "CMakeWrapper", "Libdl"] +git-tree-sha1 = "9981f1795919b8f770dc064fe733ba09c2e7c7a9" +uuid = "a74b3585-a348-5f62-a45c-50e91977d574" +version = "0.6.0" + +[[CMake]] +deps = ["BinDeps"] +git-tree-sha1 = "50a8b41d2c562fccd9ab841085fc7d1e2706da82" +uuid = "631607c0-34d2-5d66-819e-eb0f9aa2061a" +version = "1.2.0" + +[[CMakeWrapper]] +deps = ["BinDeps", "CMake", "Libdl", "Parameters", "Test"] +git-tree-sha1 = "cd82e6082a144e2425bcba6e5fdf5b404401c8e4" +uuid = "d5fb7624-851a-54ee-a528-d3f3bac0b4a0" +version = "0.2.4" + +[[Calculus]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad" +uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9" +version = "0.5.1" + +[[CodecBzip2]] +deps = ["BinaryProvider", "Libdl", "TranscodingStreams"] +git-tree-sha1 = "5db086e510c11b4c87d05067627eadb2dc079995" +uuid = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd" +version = "0.6.0" + +[[CodecZlib]] +deps = ["BinaryProvider", "Libdl", "TranscodingStreams"] +git-tree-sha1 = "05916673a2627dd91b4969ff8ba6941bc85a960e" +uuid = "944b1d66-785c-5afd-91f1-9de20f533193" +version = "0.6.0" + +[[Combinatorics]] +git-tree-sha1 = "08c8b6831dc00bfea825826be0bc8336fc369860" +uuid = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" +version = "1.0.2" + +[[CommonSubexpressions]] +deps = ["Test"] +git-tree-sha1 = "efdaf19ab11c7889334ca247ff4c9f7c322817b0" +uuid = "bbf7d656-a473-5ed7-a52c-81e309532950" +version = "0.2.0" + +[[DataStructures]] +deps = ["InteractiveUtils", "OrderedCollections"] +git-tree-sha1 = "be680f1ad03c0a03796aa3fda5a2180df7f83b46" +uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" +version = "0.17.18" + +[[Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[DiffResults]] +deps = ["StaticArrays"] +git-tree-sha1 = "da24935df8e0c6cf28de340b958f6aac88eaa0cc" +uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" +version = "1.0.2" + +[[DiffRules]] +deps = ["NaNMath", "Random", "SpecialFunctions"] +git-tree-sha1 = "eb0c34204c8410888844ada5359ac8b96292cfd1" +uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" +version = "1.0.1" + +[[Distributed]] +deps = ["LinearAlgebra", "Random", "Serialization", "Sockets"] +uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" + +[[FileIO]] +deps = ["Pkg"] +git-tree-sha1 = "202335fd24c2776493e198d6c66a6d910400a895" +uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" +version = "1.3.0" + +[[ForwardDiff]] +deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "NaNMath", "Random", "SpecialFunctions", "StaticArrays"] +git-tree-sha1 = "869540e4367122fbffaace383a5bdc34d6e5e5ac" +uuid = "f6369f11-7733-5829-9624-2563aa707210" +version = "0.10.10" + +[[GZip]] +deps = ["Libdl"] +git-tree-sha1 = "039be665faf0b8ae36e089cd694233f5dee3f7d6" +uuid = "92fee26a-97fe-5a0c-ad85-20a5f3185b63" +version = "0.5.1" + +[[Gurobi]] +deps = ["Libdl", "LinearAlgebra", "MathOptInterface", "MathProgBase", "SparseArrays"] +git-tree-sha1 = "f36a2fa62909675681aec582ccfc4a4a629406e4" +uuid = "2e9cd046-0924-5485-92f1-d5272153d98b" +version = "0.8.1" + +[[HDF5]] +deps = ["BinaryProvider", "Blosc", "CMakeWrapper", "Libdl", "Mmap"] +git-tree-sha1 = "d3ea5532668bf9bdd5e8d5f16571e0b520cbbb9f" +uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" +version = "0.12.5" + +[[HTTP]] +deps = ["Base64", "Dates", "IniFile", "MbedTLS", "Sockets"] +git-tree-sha1 = "ec87d5e2acbe1693789efbbe14f5ea7525758f71" +uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" +version = "0.8.15" + +[[IndexableBitVectors]] +deps = ["Random", "Test"] +git-tree-sha1 = "b7f5e42dc867b8a8654a5f899064632dac05bc82" +uuid = "1cb3b9ac-1ffd-5777-9e6b-a3d42300664d" +version = "1.0.0" + +[[IniFile]] +deps = ["Test"] +git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8" +uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f" +version = "0.5.0" + +[[InteractiveUtils]] +deps = ["LinearAlgebra", "Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[JLD]] +deps = ["FileIO", "HDF5", "Printf"] +git-tree-sha1 = "f6cf928214ae7c0e7550b2424a57f11875d7e49a" +uuid = "4138dd39-2aa7-5051-a626-17a0bb65d9c8" +version = "0.10.0" + +[[JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "b34d7cef7b337321e97d22242c3c2b91f476748e" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.0" + +[[JSONSchema]] +deps = ["HTTP", "JSON", "ZipFile"] +git-tree-sha1 = "832a4d327d9dafdae55a6ecae04f9997c83615cc" +uuid = "7d188eb4-7ad8-530c-ae41-71a32a6d4692" +version = "0.3.0" + +[[JuMP]] +deps = ["Calculus", "DataStructures", "ForwardDiff", "LinearAlgebra", "MathOptInterface", "MutableArithmetics", "NaNMath", "Random", "SparseArrays", "Statistics"] +git-tree-sha1 = "cbab42e2e912109d27046aa88f02a283a9abac7c" +uuid = "4076af6c-e467-56ae-b986-b466b2749572" +version = "0.21.3" + +[[LibGit2]] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[LightXML]] +deps = ["BinaryProvider", "Libdl"] +git-tree-sha1 = "be855e3c975b89746b09952407c156b5e4a33a1d" +uuid = "9c8b4983-aa76-5018-a973-4c85ecc9e179" +version = "0.8.1" + +[[LinearAlgebra]] +deps = ["Libdl"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + +[[Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[MathOptInterface]] +deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "JSON", "JSONSchema", "LinearAlgebra", "MutableArithmetics", "OrderedCollections", "SparseArrays", "Test", "Unicode"] +git-tree-sha1 = "cd2049c055c7d192a235670d50faa375361624ba" +uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" +version = "0.9.14" + +[[MathProgBase]] +deps = ["LinearAlgebra", "SparseArrays"] +git-tree-sha1 = "9abbe463a1e9fc507f12a69e7f29346c2cdc472c" +uuid = "fdba3010-5040-5b88-9595-932c9decdf73" +version = "0.7.8" + +[[MbedTLS]] +deps = ["BinaryProvider", "Dates", "Distributed", "Libdl", "Random", "Sockets", "Test"] +git-tree-sha1 = "2d94286a9c2f52c63a16146bb86fd6cdfbf677c6" +uuid = "739be429-bea8-5141-9913-cc70e7f3736d" +version = "0.6.8" + +[[Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + +[[MutableArithmetics]] +deps = ["LinearAlgebra", "SparseArrays", "Test"] +git-tree-sha1 = "6cf09794783b9de2e662c4e8b60d743021e338d0" +uuid = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" +version = "0.2.10" + +[[NaNMath]] +git-tree-sha1 = "928b8ca9b2791081dc71a51c55347c27c618760f" +uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" +version = "0.3.3" + +[[OrderedCollections]] +git-tree-sha1 = "12ce190210d278e12644bcadf5b21cbdcf225cd3" +uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +version = "1.2.0" + +[[Parameters]] +deps = ["OrderedCollections", "UnPack"] +git-tree-sha1 = "38b2e970043613c187bd56a995fe2e551821eb4a" +uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a" +version = "0.12.1" + +[[Parsers]] +deps = ["Dates", "Test"] +git-tree-sha1 = "eb3e09940c0d7ae01b01d9291ebad7b081c844d3" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "1.0.5" + +[[Pkg]] +deps = ["Dates", "LibGit2", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] +uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" + +[[Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[Random]] +deps = ["Serialization"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" + +[[Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[SparseArrays]] +deps = ["LinearAlgebra", "Random"] +uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" + +[[SpecialFunctions]] +deps = ["BinDeps", "BinaryProvider", "Libdl"] +git-tree-sha1 = "3bdd374b6fd78faf0119b8c5d538788dbf910c6e" +uuid = "276daf66-3868-5448-9aa4-cd146d93841b" +version = "0.8.0" + +[[StableRNGs]] +deps = ["Random", "Test"] +git-tree-sha1 = "705f8782b1d532c6db75e0a986fb848a629f971a" +uuid = "860ef19b-820b-49d6-a774-d7a799459cd3" +version = "0.1.1" + +[[StaticArrays]] +deps = ["LinearAlgebra", "Random", "Statistics"] +git-tree-sha1 = "5c06c0aeb81bef54aed4b3f446847905eb6cbda0" +uuid = "90137ffa-7385-5640-81b9-e52037218182" +version = "0.12.3" + +[[Statistics]] +deps = ["LinearAlgebra", "SparseArrays"] +uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" + +[[Test]] +deps = ["Distributed", "InteractiveUtils", "Logging", "Random"] +uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[TextWrap]] +git-tree-sha1 = "9250ef9b01b66667380cf3275b3f7488d0e25faf" +uuid = "b718987f-49a8-5099-9789-dcd902bef87d" +version = "1.0.1" + +[[TranscodingStreams]] +deps = ["Random", "Test"] +git-tree-sha1 = "7c53c35547de1c5b9d46a4797cf6d8253807108c" +uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" +version = "0.9.5" + +[[Twiddle]] +git-tree-sha1 = "29509c4862bfb5da9e76eb6937125ab93986270a" +uuid = "7200193e-83a8-5a55-b20d-5d36d44a0795" +version = "1.1.2" + +[[URIParser]] +deps = ["Unicode"] +git-tree-sha1 = "53a9f49546b8d2dd2e688d216421d050c9a31d0d" +uuid = "30578b45-9adc-5946-b283-645ec420af67" +version = "0.4.1" + +[[UUIDs]] +deps = ["Random"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" + +[[UnPack]] +git-tree-sha1 = "d4bfa022cd30df012700cf380af2141961bb3bfb" +uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" +version = "1.0.1" + +[[Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[ZipFile]] +deps = ["BinaryProvider", "Libdl", "Printf"] +git-tree-sha1 = "7fbfbc51c186f0ccdbe091f32d3dff8608973f8e" +uuid = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea" +version = "0.8.4" diff --git a/README.md b/README.md index 828ad8d..0bddf7a 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ The other way is by manually downloading and installing Julia, and the required ### Conda installation +The MentaLiST conda package is maintained [as a bioconda recipe](https://github.com/bioconda/bioconda-recipes/tree/master/recipes/mentalist) + **Note: We've received reports that the current conda builds of MentaLiST are broken. MentaLiST was recently updated to run on Julia 1.1, so these builds are quite out-of-date in respect with the current GitHub version. Until this is resolved, we recommend installing MentaLiST with the manual installation, as described below. ** The easiest way of installing MentaLiST is by creating a new environment with [Conda](https://conda.io/docs/). diff --git a/conda/build.sh b/conda/build.sh deleted file mode 100644 index 3d86bca..0000000 --- a/conda/build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -cp -r $SRC_DIR/src/*.jl $PREFIX/bin -cp -r $SRC_DIR/scripts $PREFIX -ln -s $PREFIX/bin/MentaLiST.jl $PREFIX/bin/mentalist -chmod +x $PREFIX/bin/mentalist - -julia -e 'using Pkg; Pkg.add([ "Distributed", "ArgParse", "BioSequences", "JSON", "DataStructures", "JLD", "GZip", "Blosc", "FileIO", "TextWrap", "LightXML", "JuMP", "Gurobi"])' - -rm -f "$PREFIX"/share/julia/site/lib/v*/*.ji -rm -rf "$PREFIX"/share/julia/site/v*/METADATA -rm -f "$PREFIX"/share/julia/site/v*/META_BRANCH diff --git a/conda/meta.yaml b/conda/meta.yaml deleted file mode 100644 index 5ccb017..0000000 --- a/conda/meta.yaml +++ /dev/null @@ -1,36 +0,0 @@ -{% set name = "MentaLiST" %} -{% set version = "1.0.0" %} - -package: - name: {{ name|lower }} - version: {{ version }} - -source: - git_url: https://github.com/WGS-TB/MentaLiST.git - git_rev: master - -build: - skip: True # [osx] - -requirements: - build: - - julia >=1.0.* - - hdf5 - - mpfr - - libxml2 - run: - - julia >=1.0.* - - hdf5 - - mpfr - - libxml2 - - unzip - -test: - commands: - - mentalist -h - -about: - home: https://github.com/WGS-TB/MentaLiST - summary: The MLST pipeline developed by the PathOGiST research group. - license: MIT - license_file: LICENSE diff --git a/galaxy/data_manager_conf.xml b/galaxy/data_manager_conf.xml new file mode 100644 index 0000000..f9f9b6a --- /dev/null +++ b/galaxy/data_manager_conf.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + mentalist_databases/${value} + + ${GALAXY_DATA_MANAGER_DATA_PATH}/mentalist_databases/${value}/${path} + abspath + + + + + + + + + + + + + + + diff --git a/galaxy/data_managers/data_manager_conf.xml b/galaxy/data_managers/data_manager_conf.xml deleted file mode 100644 index 37ae06f..0000000 --- a/galaxy/data_managers/data_manager_conf.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - mentalist_databases/${value} - - ${GALAXY_DATA_MANAGER_DATA_PATH}/mentalist_databases/${value}/${path} - abspath - - - - - - - - - - - - mentalist_databases/${value} - - ${GALAXY_DATA_MANAGER_DATA_PATH}/mentalist_databases/${value}/${path} - abspath - - - - - - - - - - - - mentalist_databases/${value} - - ${GALAXY_DATA_MANAGER_DATA_PATH}/mentalist_databases/${value}/${path} - abspath - - - - - - - - - - - - mentalist_databases/${value} - - ${GALAXY_DATA_MANAGER_DATA_PATH}/mentalist_databases/${value}/${path} - abspath - - - - - diff --git a/galaxy/data_managers/data_manager_mentalist_build_db/.shed.yml b/galaxy/data_managers/data_manager_mentalist_build_db/.shed.yml deleted file mode 100644 index ddd9aa7..0000000 --- a/galaxy/data_managers/data_manager_mentalist_build_db/.shed.yml +++ /dev/null @@ -1,10 +0,0 @@ -categories: -- Data Managers -description: Contains a data manager that defines and populates the mentalist_databases tool data table. -homepage_url: https://github.com/WGS-TB/MentaLiST/ -long_description: | - MentaLiST is based on a k-mer counting algorithm, specifically designed and implemented to handle large typing schemes. -name: data_manager_mentalist_build_db -owner: dfornika -remote_repository_url: https://github.com/WGS-TB/MentaLiST/tree/master/galaxy/data_managers/data_manager_mentalist_build_db -type: unrestricted diff --git a/galaxy/data_managers/data_manager_mentalist_build_db/data_manager/mentalist_build_db.py b/galaxy/data_managers/data_manager_mentalist_build_db/data_manager/mentalist_build_db.py deleted file mode 100644 index 8448ac7..0000000 --- a/galaxy/data_managers/data_manager_mentalist_build_db/data_manager/mentalist_build_db.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python -from __future__ import print_function - -import argparse -import os -import subprocess -import sys -import errno -from json import dumps, loads - -DEFAULT_DATA_TABLE_NAMES = ["mentalist_databases"] - - -def mentalist_build_db( data_manager_dict, database_name, kmer_size, profile, fasta_files, params, target_directory, data_table_names=DEFAULT_DATA_TABLE_NAMES ): - args = [ 'mentalist', 'build_db', '--db', database_name, '-k', str(kmer_size)] - if profile: - args += ['--profile', profile] - print(args) - args += ['--fasta_files'] + fasta_files - proc = subprocess.Popen( args=args, shell=False, cwd=target_directory ) - return_code = proc.wait() - if return_code: - print("Error building database.", file=sys.stderr) - sys.exit( return_code ) - data_table_entry = dict( value=database_name, dbkey=database_name, name=database_name, path=database_name ) - for data_table_name in data_table_names: - _add_data_table_entry( data_manager_dict, data_table_name, data_table_entry ) - - -def _add_data_table_entry( data_manager_dict, data_table_name, data_table_entry ): - data_manager_dict['data_tables'] = data_manager_dict.get( 'data_tables', {} ) - data_manager_dict['data_tables'][ data_table_name ] = data_manager_dict['data_tables'].get( data_table_name, [] ) - data_manager_dict['data_tables'][ data_table_name ].append( data_table_entry ) - return data_manager_dict - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument('params') - parser.add_argument( '-d', '--db', dest='database_name', default=None, help='Database Name' ) - parser.add_argument( '-f', '--fasta_files', dest='fasta_files', nargs='+', default=None, help='FASTA Filenames' ) - parser.add_argument( '-k', '--kmer_size', dest='kmer_size', type=int, default=None, help='kmer Size' ) - parser.add_argument( '-p', '--profile', dest='profile', type=int, default=None, help='Profile' ) - args = parser.parse_args() - - params = loads( open( args.params ).read() ) - target_directory = params[ 'output_data' ][0]['extra_files_path'] - - try: - os.mkdir( target_directory ) - except OSError as exc: - if exc.errno == errno.EEXIST and os.path.isdir( target_directory ): - pass - else: - raise - - data_manager_dict = {} - - # build the index - mentalist_build_db( data_manager_dict, args.database_name, args.kmer_size, args.profile, args.fasta_files, params, target_directory, DEFAULT_DATA_TABLE_NAMES ) - - # save info to json file - open( args.params, 'wb' ).write( dumps( data_manager_dict ) ) - - -if __name__ == "__main__": - main() diff --git a/galaxy/data_managers/data_manager_mentalist_build_db/data_manager/mentalist_build_db.xml b/galaxy/data_managers/data_manager_mentalist_build_db/data_manager/mentalist_build_db.xml deleted file mode 100644 index 772e30c..0000000 --- a/galaxy/data_managers/data_manager_mentalist_build_db/data_manager/mentalist_build_db.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - mentalist - - - - - - - - - - - - - - - 10.1101/172858 - 10.1099/mgen.0.000146 - - diff --git a/galaxy/data_managers/data_manager_mentalist_build_db/tool_data_table_conf.xml.sample b/galaxy/data_managers/data_manager_mentalist_build_db/tool_data_table_conf.xml.sample deleted file mode 100644 index f9a9693..0000000 --- a/galaxy/data_managers/data_manager_mentalist_build_db/tool_data_table_conf.xml.sample +++ /dev/null @@ -1,8 +0,0 @@ - - - - - value, name, path - -
-
\ No newline at end of file diff --git a/galaxy/data_managers/data_manager_mentalist_download_cgmlst/.shed.yml b/galaxy/data_managers/data_manager_mentalist_download_cgmlst/.shed.yml deleted file mode 100644 index de34b7c..0000000 --- a/galaxy/data_managers/data_manager_mentalist_download_cgmlst/.shed.yml +++ /dev/null @@ -1,10 +0,0 @@ -categories: -- Data Managers -description: Contains a data manager that defines and populates the mentalist_databases tool data table. -homepage_url: https://github.com/WGS-TB/MentaLiST/ -long_description: | - MentaLiST is based on a k-mer counting algorithm, specifically designed and implemented to handle large typing schemes. -name: data_manager_mentalist_download_cgmlst -owner: dfornika -remote_repository_url: https://github.com/WGS-TB/MentaLiST/tree/master/galaxy/data_managers/data_manager_download_cgmlst -type: unrestricted diff --git a/galaxy/data_managers/data_manager_mentalist_download_cgmlst/data_manager/mentalist_download_cgmlst.py b/galaxy/data_managers/data_manager_mentalist_download_cgmlst/data_manager/mentalist_download_cgmlst.py deleted file mode 100644 index e96cbeb..0000000 --- a/galaxy/data_managers/data_manager_mentalist_download_cgmlst/data_manager/mentalist_download_cgmlst.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python - -from __future__ import print_function - -import argparse -import datetime -import errno -import os -import string -import subprocess -import sys - -from json import dumps, loads - - -DEFAULT_DATA_TABLE_NAMES = ["mentalist_databases"] - - -def mentalist_download_cgmlst( data_manager_dict, kmer_size, scheme, params, target_directory, data_table_names=DEFAULT_DATA_TABLE_NAMES ): - translation_table = string.maketrans(string.punctuation, ("_" * 32)) - base_path = scheme.lower().replace(" ", "_").translate(translation_table) + "_cgmlst" - today = datetime.date.today().isoformat() - scheme_files_path = base_path + "_scheme_" + today - database_path = base_path + "_k" + str(kmer_size) + "_" + today - database_name = base_path + "_k" + str(kmer_size) + "_" + today + ".jld" - display_name = scheme + " k=" + str(kmer_size) + " (cgMLST) " + today - args = [ 'mentalist', 'download_cgmlst', '-s', scheme, '-k', str(kmer_size), '--db', database_name, '-o', scheme_files_path] - proc = subprocess.Popen( args=args, shell=False, cwd=target_directory ) - return_code = proc.wait() - if return_code: - print("Error building database.", file=sys.stderr) - sys.exit( return_code ) - data_table_entry = dict( value=database_path, dbkey='cgMLST', name=display_name, path=database_name ) - for data_table_name in data_table_names: - _add_data_table_entry( data_manager_dict, data_table_name, data_table_entry ) - - -def _add_data_table_entry( data_manager_dict, data_table_name, data_table_entry ): - data_manager_dict['data_tables'] = data_manager_dict.get( 'data_tables', {} ) - data_manager_dict['data_tables'][ data_table_name ] = data_manager_dict['data_tables'].get( data_table_name, [] ) - data_manager_dict['data_tables'][ data_table_name ].append( data_table_entry ) - return data_manager_dict - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument('params') - parser.add_argument( '-k', '--kmer_size', dest='kmer_size', type=int, default=None, help='kmer Size' ) - parser.add_argument( '-s', '--scheme', dest='scheme', default=None, help='Scheme' ) - args = parser.parse_args() - - params = loads( open( args.params ).read() ) - target_directory = params[ 'output_data' ][0]['extra_files_path'] - - try: - os.mkdir( target_directory ) - except OSError as exc: - if exc.errno == errno.EEXIST and os.path.isdir( target_directory ): - pass - else: - raise - - data_manager_dict = {} - - # build the index - mentalist_download_cgmlst( data_manager_dict, args.kmer_size, args.scheme, params, target_directory, DEFAULT_DATA_TABLE_NAMES ) - - # save info to json file - open( args.params, 'wb' ).write( dumps( data_manager_dict ) ) - - -if __name__ == "__main__": - main() diff --git a/galaxy/data_managers/data_manager_mentalist_download_cgmlst/data_manager/mentalist_download_cgmlst.xml b/galaxy/data_managers/data_manager_mentalist_download_cgmlst/data_manager/mentalist_download_cgmlst.xml deleted file mode 100644 index 71fa0ed..0000000 --- a/galaxy/data_managers/data_manager_mentalist_download_cgmlst/data_manager/mentalist_download_cgmlst.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - mentalist - - - - - - - - - - - - - - - - - - - - - - - 10.1101/172858 - 10.1099/mgen.0.000146 - - diff --git a/galaxy/data_managers/data_manager_mentalist_download_cgmlst/tool-data/mentalist_databases.loc.sample b/galaxy/data_managers/data_manager_mentalist_download_cgmlst/tool-data/mentalist_databases.loc.sample deleted file mode 100644 index e69de29..0000000 diff --git a/galaxy/data_managers/data_manager_mentalist_download_cgmlst/tool_data_table_conf.xml.sample b/galaxy/data_managers/data_manager_mentalist_download_cgmlst/tool_data_table_conf.xml.sample deleted file mode 100644 index f9a9693..0000000 --- a/galaxy/data_managers/data_manager_mentalist_download_cgmlst/tool_data_table_conf.xml.sample +++ /dev/null @@ -1,8 +0,0 @@ - - - - - value, name, path - -
-
\ No newline at end of file diff --git a/galaxy/data_managers/data_manager_mentalist_download_enterobase/.shed.yml b/galaxy/data_managers/data_manager_mentalist_download_enterobase/.shed.yml deleted file mode 100644 index 93a0d6a..0000000 --- a/galaxy/data_managers/data_manager_mentalist_download_enterobase/.shed.yml +++ /dev/null @@ -1,11 +0,0 @@ -categories: -- Data Managers -- Metagenomics -description: Contains a data manager that defines and populates the mentalist_databases tool data table. -homepage_url: https://github.com/WGS-TB/MentaLiST/ -long_description: | - MentaLiST is based on a k-mer counting algorithm, specifically designed and implemented to handle large typing schemes. -name: data_manager_mentalist_download_enterobase -owner: dfornika -remote_repository_url: https://github.com/WGS-TB/MentaLiST/tree/master/galaxy/data_managers/data_manager_mentalist_download_enterobase -type: unrestricted diff --git a/galaxy/data_managers/data_manager_mentalist_download_enterobase/data_manager/mentalist_download_enterobase.py b/galaxy/data_managers/data_manager_mentalist_download_enterobase/data_manager/mentalist_download_enterobase.py deleted file mode 100644 index 59986ec..0000000 --- a/galaxy/data_managers/data_manager_mentalist_download_enterobase/data_manager/mentalist_download_enterobase.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env python - -from __future__ import print_function - -import argparse -import datetime -import errno -import os -import string -import subprocess -import sys - -from json import dumps, loads - - -DEFAULT_DATA_TABLE_NAMES = ["mentalist_databases"] - - -def mentalist_download_enterobase( data_manager_dict, kmer_size, scheme, type, params, target_directory, data_table_names=DEFAULT_DATA_TABLE_NAMES ): - char_to_full_organism_name = { - 'E': 'Escherichia/Shigella', - 'S': 'Salmonella', - 'Y': 'Yersinia' - } - translation_table = string.maketrans(string.punctuation, ("_" * 32)) - base_path = char_to_full_organism_name[scheme].lower().replace(" ", "_").translate(translation_table) + "_enterobase" - today = datetime.date.today().isoformat() - scheme_files_path = base_path + "_scheme_" + today - database_path = base_path + "_k" + str(kmer_size) + "_" + today - database_name = base_path + "_k" + str(kmer_size) + "_" + today + ".jld" - display_name = char_to_full_organism_name[scheme] + " k=" + str(kmer_size) + " (Enterobase) " + today - args = [ 'mentalist', 'download_enterobase', '-s', scheme, '-t', type, '-k', str(kmer_size), '--db', database_name, '-o', scheme_files_path] - proc = subprocess.Popen( args=args, shell=False, cwd=target_directory ) - return_code = proc.wait() - if return_code: - print("Error building database.", file=sys.stderr) - sys.exit( return_code ) - data_table_entry = dict( value=database_path, dbkey='Enterobase', name=display_name, path=database_name ) - for data_table_name in data_table_names: - _add_data_table_entry( data_manager_dict, data_table_name, data_table_entry ) - - -def _add_data_table_entry( data_manager_dict, data_table_name, data_table_entry ): - data_manager_dict['data_tables'] = data_manager_dict.get( 'data_tables', {} ) - data_manager_dict['data_tables'][ data_table_name ] = data_manager_dict['data_tables'].get( data_table_name, [] ) - data_manager_dict['data_tables'][ data_table_name ].append( data_table_entry ) - return data_manager_dict - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument('params') - parser.add_argument( '-s', '--scheme', dest='scheme', default=None, help="Scheme: ('E'=Escherichia/Shigella, 'S'=Salmonella, 'Y'=Yersinia)") - parser.add_argument( '-k', '--kmer_size', dest='kmer_size', type=int, default=None, help='kmer Size' ) - parser.add_argument( '-t', '--type', dest='type', default=None, help="Type: ('cg'=cgMLST, 'wg'=wgMLST')") - args = parser.parse_args() - - params = loads( open( args.params ).read() ) - target_directory = params[ 'output_data' ][0]['extra_files_path'] - - try: - os.mkdir( target_directory ) - except OSError as exc: - if exc.errno == errno.EEXIST and os.path.isdir( target_directory ): - pass - else: - raise - - data_manager_dict = {} - - # build the index - mentalist_download_enterobase( data_manager_dict, args.kmer_size, args.scheme, args.type, params, target_directory, DEFAULT_DATA_TABLE_NAMES ) - - # save info to json file - open( args.params, 'wb' ).write( dumps( data_manager_dict ) ) - - -if __name__ == "__main__": - main() diff --git a/galaxy/data_managers/data_manager_mentalist_download_enterobase/data_manager/mentalist_download_enterobase.xml b/galaxy/data_managers/data_manager_mentalist_download_enterobase/data_manager/mentalist_download_enterobase.xml deleted file mode 100644 index a27cdc5..0000000 --- a/galaxy/data_managers/data_manager_mentalist_download_enterobase/data_manager/mentalist_download_enterobase.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - mentalist - - - - - - - - - - - - - - - - - - - - - 10.1101/172858 - - diff --git a/galaxy/data_managers/data_manager_mentalist_download_enterobase/tool_data_table_conf.xml.sample b/galaxy/data_managers/data_manager_mentalist_download_enterobase/tool_data_table_conf.xml.sample deleted file mode 100644 index f9a9693..0000000 --- a/galaxy/data_managers/data_manager_mentalist_download_enterobase/tool_data_table_conf.xml.sample +++ /dev/null @@ -1,8 +0,0 @@ - - - - - value, name, path - -
-
\ No newline at end of file diff --git a/galaxy/data_managers/data_manager_mentalist_download_pubmlst/.shed.yml b/galaxy/data_managers/data_manager_mentalist_download_pubmlst/.shed.yml deleted file mode 100644 index 25cf705..0000000 --- a/galaxy/data_managers/data_manager_mentalist_download_pubmlst/.shed.yml +++ /dev/null @@ -1,11 +0,0 @@ -categories: -- Data Managers -- Metagenomics -description: Contains a data manager that defines and populates the mentalist_databases tool data table. -homepage_url: https://github.com/WGS-TB/MentaLiST/ -long_description: | - MentaLiST is based on a k-mer counting algorithm, specifically designed and implemented to handle large typing schemes. -name: data_manager_mentalist_download_pubmlst -owner: dfornika -remote_repository_url: https://github.com/WGS-TB/MentaLiST/tree/master/galaxy/data_managers/data_manager_mentalist_download_pubmlst -type: unrestricted diff --git a/galaxy/data_managers/data_manager_mentalist_download_pubmlst/data_manager/mentalist_download_pubmlst.py b/galaxy/data_managers/data_manager_mentalist_download_pubmlst/data_manager/mentalist_download_pubmlst.py deleted file mode 100644 index d51dc47..0000000 --- a/galaxy/data_managers/data_manager_mentalist_download_pubmlst/data_manager/mentalist_download_pubmlst.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python - -from __future__ import print_function - -import argparse -import datetime -import errno -import os -import string -import subprocess -import sys - -from json import dumps, loads - - -DEFAULT_DATA_TABLE_NAMES = ["mentalist_databases"] - - -def mentalist_download_pubmlst( data_manager_dict, kmer_size, scheme, params, target_directory, data_table_names=DEFAULT_DATA_TABLE_NAMES ): - scheme = scheme.replace('__pd__','#') - translation_table = string.maketrans(string.punctuation, ("_" * 32)) - base_path = scheme.lower().replace(" ", "_").translate(translation_table) + "_pubmlst" - today = datetime.date.today().isoformat() - scheme_files_path = base_path + "_scheme_" + today - database_path = base_path + "_k" + str(kmer_size) + "_" + today - database_name = base_path + "_k" + str(kmer_size) + "_" + today + ".jld" - display_name = scheme + " k=" + str(kmer_size) + " (PubMLST) " + today - args = [ 'mentalist', 'download_pubmlst', '-s', scheme, '-k', str(kmer_size), '--db', database_name, '-o', scheme_files_path] - proc = subprocess.Popen( args=args, shell=False, cwd=target_directory ) - return_code = proc.wait() - if return_code: - print("Error building database.", file=sys.stderr) - sys.exit( return_code ) - data_table_entry = dict( value=database_path, dbkey='PubMLST', name=display_name, path=database_name ) - for data_table_name in data_table_names: - _add_data_table_entry( data_manager_dict, data_table_name, data_table_entry ) - - -def _add_data_table_entry( data_manager_dict, data_table_name, data_table_entry ): - data_manager_dict['data_tables'] = data_manager_dict.get( 'data_tables', {} ) - data_manager_dict['data_tables'][ data_table_name ] = data_manager_dict['data_tables'].get( data_table_name, [] ) - data_manager_dict['data_tables'][ data_table_name ].append( data_table_entry ) - return data_manager_dict - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument('params') - parser.add_argument( '-s', '--scheme', dest='scheme', default=None, help='Scheme' ) - parser.add_argument( '-k', '--kmer_size', dest='kmer_size', type=int, default=None, help='kmer Size' ) - args = parser.parse_args() - - params = loads( open( args.params ).read() ) - target_directory = params[ 'output_data' ][0]['extra_files_path'] - - try: - os.mkdir( target_directory ) - except OSError as exc: - if exc.errno == errno.EEXIST and os.path.isdir( target_directory ): - pass - else: - raise - - data_manager_dict = {} - - # build the index - mentalist_download_pubmlst( data_manager_dict, args.kmer_size, args.scheme, params, target_directory, DEFAULT_DATA_TABLE_NAMES ) - - # save info to json file - open( args.params, 'wb' ).write( dumps( data_manager_dict ) ) - - -if __name__ == "__main__": - main() diff --git a/galaxy/data_managers/data_manager_mentalist_download_pubmlst/data_manager/mentalist_download_pubmlst.xml b/galaxy/data_managers/data_manager_mentalist_download_pubmlst/data_manager/mentalist_download_pubmlst.xml deleted file mode 100644 index ccc8107..0000000 --- a/galaxy/data_managers/data_manager_mentalist_download_pubmlst/data_manager/mentalist_download_pubmlst.xml +++ /dev/null @@ -1,161 +0,0 @@ - - - - mentalist - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 10.1101/172858 - 10.1099/mgen.0.000146 - - diff --git a/galaxy/data_managers/data_manager_mentalist_download_pubmlst/tool-data/mentalist_databases.loc.sample b/galaxy/data_managers/data_manager_mentalist_download_pubmlst/tool-data/mentalist_databases.loc.sample deleted file mode 100644 index e69de29..0000000 diff --git a/galaxy/data_managers/data_manager_mentalist_download_pubmlst/tool_data_table_conf.xml.sample b/galaxy/data_managers/data_manager_mentalist_download_pubmlst/tool_data_table_conf.xml.sample deleted file mode 100644 index f9a9693..0000000 --- a/galaxy/data_managers/data_manager_mentalist_download_pubmlst/tool_data_table_conf.xml.sample +++ /dev/null @@ -1,8 +0,0 @@ - - - - - value, name, path - -
-
\ No newline at end of file diff --git a/galaxy/enterobase.tsv b/galaxy/enterobase.tsv new file mode 100644 index 0000000..3a90f00 --- /dev/null +++ b/galaxy/enterobase.tsv @@ -0,0 +1,4 @@ +S Salmonella +Y Yersinia +E Escherichia/Shigella +C clostridium \ No newline at end of file diff --git a/galaxy/tools/mentalist_call/mentalist_call.xml b/galaxy/mentalist_call.xml similarity index 93% rename from galaxy/tools/mentalist_call/mentalist_call.xml rename to galaxy/mentalist_call.xml index e3941f1..f48834c 100644 --- a/galaxy/tools/mentalist_call/mentalist_call.xml +++ b/galaxy/mentalist_call.xml @@ -1,6 +1,6 @@ - + - mentalist + mentalist operation_3840 @@ -36,7 +36,7 @@ - + - diff --git a/galaxy/data_managers/data_manager_mentalist_build_db/tool-data/mentalist_databases.loc.sample b/galaxy/mentalist_databases.loc.sample similarity index 100% rename from galaxy/data_managers/data_manager_mentalist_build_db/tool-data/mentalist_databases.loc.sample rename to galaxy/mentalist_databases.loc.sample diff --git a/galaxy/mentalist_download.xml b/galaxy/mentalist_download.xml new file mode 100644 index 0000000..5b406dc --- /dev/null +++ b/galaxy/mentalist_download.xml @@ -0,0 +1,100 @@ + + + + mentalist + jq + + '$output' + #else + mentalist '$mode_selection.mode' -k '$mode_selection.kmer_size' + #if $mode_selection.mode == 'build_db' + #set unique_id = "${mode_select.scheme}_${ re.sub('\W', '_', str(mode_select.database_name)) }_${mode_selection.kmer_size}" + #set name = "${mode_selection.database_name} k=${mode_selection.kmer_size} (${mode_selection.scheme})" + --db '${unique_id}.jld' + #if $mode_selection.profile + --profile '$mode_selection.profile' + #end if + --fasta_files + #for fasta in $mode_selection.input_fastas + '$fasta' + #end for + #else + #set scheme_name = next(record for record in $__app__.tool_data_tables['mlst_db_sources'].get_fields() if str( record[1] ) == str( $mode_selection.database_name ) and str( record[2] ) == str( $mode_selection.scheme ))[-1] + #set unique_id = "${mode_select.database_name}_${mode_select.scheme}_${mode_selection.kmer_size}" + #set name = "${scheme_name} k=${mode_selection.kmer_size} (${mode_selection.database_name}" + (" $mode_selection.type" if $mode_selection.type else "") + ")" + #if $mode_selection.type + #set unique_id = $unique_id + "_${mode_selection.type}" + -t '$mode_selection.type' + #end if + --db '${unique_id}.jld' + -o '${unique_id}' + #end if + && echo '{"data_tables":{"mentalist_databases":[{"value":"${unique_id}","name":"$name","path":"${unique_id}.jld"}]}}' > '$output' + #end if + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10.1101/172858 + 10.1099/mgen.0.000146 + + diff --git a/galaxy/tool_data_table_conf.xml.sample b/galaxy/tool_data_table_conf.xml.sample new file mode 100644 index 0000000..0a5a5a7 --- /dev/null +++ b/galaxy/tool_data_table_conf.xml.sample @@ -0,0 +1,12 @@ + + + + + value, name, path + +
+ + source_id, source, id, name + +
+
\ No newline at end of file diff --git a/galaxy/tsvs_to_galaxy b/galaxy/tsvs_to_galaxy new file mode 100644 index 0000000..7c7f187 --- /dev/null +++ b/galaxy/tsvs_to_galaxy @@ -0,0 +1,10 @@ +def parseTSV: . | split("\n") | map(select(startswith("#") | not)) | map(split("\t")) | .[]; +{ + "data_tables": { + "mlst_db_sources": [ + ($pb | parseTSV | {"source_id": "pubMLST_" + .[0], source": "pubMLST", "id": .[0], "name": .[1]}) + + ($cg | parseTSV | {"source_id": "cgMLST_" + .[0], "source": "cgMLST", "id": .[0], "name": .[1]}) + + ($eb | parseTSV | {"source_id": "Enterobase_" + .[0], "source": "Enterobase", "id": .[0], "name": .[1]}) + ] + } +}