From 178a1efb3048cb24f3af263fea136b96f58d3104 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Fri, 4 Oct 2024 11:40:34 +0100 Subject: [PATCH] Remove outdated fimo wrapper and galaxy-sequence-utils dependency The fimo tool was removed from `tool_conf.xml.sample` in 2014 (commit fa11d10c8b490aa2628299930ff470ad3fafb0d9) and migrated to the tools-iuc repository since 2015 ( https://github.com/galaxyproject/tools-iuc/pull/499 ). This bundled version doesn't probably work any more and is not available on the UseGalaxy.* servers. This allows us to remove `galaxy-sequence-utils` from the project dependencies, since the other 2 tools (`lib/galaxy/datatypes/converters/vcf_to_interval_index_converter.xml` and `tools/maf/vcf_to_maf_customtrack.xml`) correctly specify it as a requirement. --- .../dependencies/pinned-requirements.txt | 1 - mypy.ini | 2 - pyproject.toml | 1 - run_tests.sh | 17 +- tools/meme/__init__.py | 0 tools/meme/fimo.xml | 238 ------------------ tools/meme/fimo_wrapper.py | 88 ------- 7 files changed, 9 insertions(+), 338 deletions(-) delete mode 100644 tools/meme/__init__.py delete mode 100644 tools/meme/fimo.xml delete mode 100644 tools/meme/fimo_wrapper.py diff --git a/lib/galaxy/dependencies/pinned-requirements.txt b/lib/galaxy/dependencies/pinned-requirements.txt index eb2c4d9c091d..35fae8ef16d7 100644 --- a/lib/galaxy/dependencies/pinned-requirements.txt +++ b/lib/galaxy/dependencies/pinned-requirements.txt @@ -72,7 +72,6 @@ frozenlist==1.4.1 ; python_version >= "3.8" and python_version < "3.13" fs==2.4.16 ; python_version >= "3.8" and python_version < "3.13" fsspec==2024.9.0 ; python_version >= "3.8" and python_version < "3.13" future==1.0.0 ; python_version >= "3.8" and python_version < "3.13" -galaxy-sequence-utils==1.1.5 ; python_version >= "3.8" and python_version < "3.13" galaxy2cwl==0.1.4 ; python_version >= "3.8" and python_version < "3.13" graphene-sqlalchemy==3.0.0rc1 ; python_version >= "3.8" and python_version < "3.13" graphene==3.3 ; python_version >= "3.8" and python_version < "3.13" diff --git a/mypy.ini b/mypy.ini index 70250f4d521f..9048c43b80ee 100644 --- a/mypy.ini +++ b/mypy.ini @@ -115,8 +115,6 @@ check_untyped_defs = False check_untyped_defs = False [mypy-galaxy.tools.bundled.phenotype_association.pagetag] check_untyped_defs = False -[mypy-galaxy.tools.bundled.meme.fimo_wrapper] -check_untyped_defs = False [mypy-galaxy.tools.bundled.maf.maf_to_bed] check_untyped_defs = False [mypy-galaxy.tools.bundled.filters.trimmer] diff --git a/pyproject.toml b/pyproject.toml index d2305df13556..42cb29994ffe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,6 @@ edam-ontology = "*" fastapi-slim = ">=0.111.0" fs = "*" future = ">=1.0.0" # Python 3.12 support -galaxy_sequence_utils = "*" graphene = "*" graphene-sqlalchemy = ">=3.0.0rc1" # need a beta release to be compat. with starlette plugin graphql-core = "*" diff --git a/run_tests.sh b/run_tests.sh index e10e4798c488..11c146353909 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -492,14 +492,15 @@ do -u|-unit|--unit) report_file="run_unit_tests.html" unit_extra='--doctest-modules - --ignore lib/galaxy/jobs/runners/chronos.py - --ignore lib/galaxy/model/migrations/alembic - --ignore lib/galaxy/tools/bundled - --ignore lib/galaxy/web/proxy/js/node_modules/ - --ignore lib/galaxy_test - --ignore lib/tool_shed/test - --ignore lib/tool_shed/webapp/controllers - --ignore=lib/tool_shed/webapp/model/migrations/alembic/' + --ignore lib/galaxy/datatypes/converters/ + --ignore lib/galaxy/jobs/runners/chronos.py + --ignore lib/galaxy/model/migrations/alembic + --ignore lib/galaxy/tools/bundled + --ignore lib/galaxy/web/proxy/js/node_modules/ + --ignore lib/galaxy_test + --ignore lib/tool_shed/test + --ignore lib/tool_shed/webapp/controllers + --ignore=lib/tool_shed/webapp/model/migrations/alembic/' generate_cwl_conformance_tests=1 if [ $# -gt 1 ]; then unit_extra="$unit_extra $2" diff --git a/tools/meme/__init__.py b/tools/meme/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/tools/meme/fimo.xml b/tools/meme/fimo.xml deleted file mode 100644 index 199c3bb7f2a0..000000000000 --- a/tools/meme/fimo.xml +++ /dev/null @@ -1,238 +0,0 @@ - - meme - - Find Individual Motif Occurrences - fimo_wrapper.py 'fimo --o "${$html_outfile.files_path}" --verbosity "1" - - #if str( $options_type.options_type_selector ) == 'advanced': - --max-seq-length "${options_type.max_seq_length}" - --max-stored-scores "${options_type.max_stored_scores }" - --motif-pseudo "${options_type.motif_pseudo}" - ${options_type.norc} - --output-pthresh "${options_type.output_pthresh}" - - - #for $motif in $options_type.motifs: - --motif "${motif.motif}" - #end for - - #if str( $options_type.bgfile_type.bgfile_type_selector ) == 'motif-file': - --bgfile "motif-file" - #elif str( $options_type.bgfile_type.bgfile_type_selector ) == 'motif-file': - --bgfile "${options_type.bgfile_type.bgfile}" - #end if - - #if str( $options_type.qvalue_type.qvalue_type_selector ) == 'no-qvalue': - --no-qvalue - #else: - --output-qthresh "${options_type.qvalue_type.output_qthresh}" - #end if - #end if - - "${input_motifs}" - - #if str( $fasta_type.fasta_type_selector ) == 'history': - "${fasta_type.input_database}" - #else: - "${fasta_type.input_database.fields.path}" - #end if - - ' - - '${html_outfile.files_path}' - - '${html_outfile}' - - '${interval_outfile}' - - '${txt_outfile}' - - '${xml_outfile}' - - '${gff_outfile}' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - value == True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -.. class:: warningmark - -**WARNING: This tool is only available for non-commercial use. Use for educational, research and non-profit purposes is permitted. Before using, be sure to review, agree, and comply with the license.** - -.. class:: infomark - -**To cite FIMO:** -`Grant CE, Bailey TL, Noble WS. FIMO: scanning for occurrences of a given motif. Bioinformatics. 2011 Apr 1;27(7):1017-8. <http://www.ncbi.nlm.nih.gov/pubmed/21330290>`_ - - -For detailed information on FIMO, click here_. To view the license_. - ------- - -**Citation** - -If you use this tool in Galaxy, please cite Blankenberg D, et al. *In preparation.* - - -.. _here: http://meme.nbcr.net/meme/fimo-intro.html -.. _license: http://meme.nbcr.net/meme/COPYRIGHT.html - - - diff --git a/tools/meme/fimo_wrapper.py b/tools/meme/fimo_wrapper.py deleted file mode 100644 index 1d32ae4b3498..000000000000 --- a/tools/meme/fimo_wrapper.py +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python -# Dan Blankenberg -""" -Read text output from FIMO and create an interval file. -""" -import os -import shutil -import subprocess -import sys -import tempfile - -from galaxy_utils.sequence.transform import DNA_reverse_complement - -buffsize = 1048576 - - -def stop_err(msg): - sys.stderr.write(msg) - sys.exit() - - -def main(): - assert len(sys.argv) == 8, "Wrong number of arguments" - sys.argv.pop(0) - fimo_cmd = sys.argv.pop(0) - html_path = sys.argv.pop(0) - html_out = sys.argv.pop(0) - interval_out = sys.argv.pop(0) - txt_out = sys.argv.pop(0) - xml_out = sys.argv.pop(0) - gff_out = sys.argv.pop(0) - - # run fimo - try: - tmp_stderr = tempfile.NamedTemporaryFile() - proc = subprocess.Popen(args=fimo_cmd, shell=True, stderr=tmp_stderr) - returncode = proc.wait() - tmp_stderr.seek(0) - stderr = "" - try: - while True: - stderr += tmp_stderr.read(buffsize) - if not stderr or len(stderr) % buffsize != 0: - break - except OverflowError: - pass - - if returncode != 0: - raise Exception(stderr) - except Exception as e: - raise Exception("Error running FIMO:\n" + str(e)) - - shutil.move(os.path.join(html_path, "fimo.txt"), txt_out) - shutil.move(os.path.join(html_path, "fimo.gff"), gff_out) - shutil.move(os.path.join(html_path, "fimo.xml"), xml_out) - shutil.move(os.path.join(html_path, "fimo.html"), html_out) - - out_file = open(interval_out, "wb") - out_file.write( - "#%s\n" - % "\t".join( - ("chr", "start", "end", "pattern name", "score", "strand", "matched sequence", "p-value", "q-value") - ) - ) - for line in open(txt_out): - if line.startswith("#"): - continue - fields = line.rstrip("\n\r").split("\t") - start, end = int(fields[2]), int(fields[3]) - sequence = fields[7] - if start > end: - start, end = end, start # flip start and end, and set strand - strand = "-" - sequence = DNA_reverse_complement( - sequence - ) # we want sequences relative to strand; FIMO always provides + stranded sequence - else: - strand = "+" - start -= 1 # make 0-based start position - out_file.write( - "%s\n" - % "\t".join((fields[1], str(start), str(end), fields[0], fields[4], strand, sequence, fields[5], fields[6])) - ) - out_file.close() - - -if __name__ == "__main__": - main()