# HG changeset patch # User rhpvorderman # Date 1639485947 0 # Node ID 7ae6b6b5d890f3797d35951ab06e7af2c154239b # Parent 2a7dc86d8f85bbc620327553e934f749a33eb0f8 "planemo upload commit 2d4cb6757e8eff095295550bbde6fd9e2ee0b73d" diff -r 2a7dc86d8f85 -r 7ae6b6b5d890 complete_immunerepertoire.xml --- a/complete_immunerepertoire.xml Fri Nov 19 10:09:54 2021 +0000 +++ b/complete_immunerepertoire.xml Tue Dec 14 12:45:47 2021 +0000 @@ -1,4 +1,4 @@ - + r-gridextra r-ggplot2 @@ -10,7 +10,13 @@ r-stringr circos circos-tools - + tar + unzip + unrar + p7zip + findutils + quay.io/rhpvorderman/mulled-v2-62aaeb9dad7d9973e676594c3aa69e605c73cd0c:80328e762d48b0d7b11c4fa41a5c09ca43d49db9-0 + complete.sh " @@ -32,7 +38,12 @@ - + + + + + + diff -r 2a7dc86d8f85 -r 7ae6b6b5d890 conda_environment.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conda_environment.yml Tue Dec 14 12:45:47 2021 +0000 @@ -0,0 +1,25 @@ +name: argalaxy-immunerepertoire +channels: + - conda-forge + - bioconda + - defaults + - imperial-college-research-computing +dependencies: + - r-gridextra=2.3 + - r-ggplot2=3.0.0 + - r-plyr=1.8.4 + - r-reshape2=1.4.3 + - r-data.table=1.11.4 + - r-lymphclon=1.3.0 + - r-stringi=1.2.4 + - r-stringr=1.3.1 + - circos=0.69.6 + - circos-tools=0.23 + - bash=4.4.18 + - file=5.39 + - font-ttf-ubuntu=0.83 + - tar=1.34 + - unzip=6.0 + - unrar=0.4 + - p7zip=16.02 + - findutils=4.6.0 \ No newline at end of file diff -r 2a7dc86d8f85 -r 7ae6b6b5d890 mulled_container_build.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mulled_container_build.tsv Tue Dec 14 12:45:47 2021 +0000 @@ -0,0 +1,2 @@ +#targets base_image image_build +r-gridextra=2.3,r-ggplot2=3.0.0,r-plyr=1.8.4,r-reshape2=1.4.3,r-data.table=1.11.4,r-lymphclon=1.3.0,r-stringi=1.2.4,r-stringr=1.3.1,circos=0.69.6,circos-tools=0.23,bash=4.4.18,file=5.39,font-ttf-ubuntu=0.83,tar=1.34,unzip=6.0,unrar=0.4,p7zip=16.02,findutils=4.6.0 bgruening/busybox-bash:0.1 0 diff -r 2a7dc86d8f85 -r 7ae6b6b5d890 tests/__pycache__/test_imgt.cpython-39-pytest-6.2.5.pyc Binary file tests/__pycache__/test_imgt.cpython-39-pytest-6.2.5.pyc has changed diff -r 2a7dc86d8f85 -r 7ae6b6b5d890 tests/data/CONTROL_NWK377_PB_IGHC_MID1_40nt_2.txz Binary file tests/data/CONTROL_NWK377_PB_IGHC_MID1_40nt_2.txz has changed diff -r 2a7dc86d8f85 -r 7ae6b6b5d890 tests/test_imgt.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test_imgt.py Tue Dec 14 12:45:47 2021 +0000 @@ -0,0 +1,89 @@ +# Copyright (c) 2021 Leiden University Medical Center +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +import os +import shutil +import subprocess +import tempfile +from pathlib import Path +from xml.etree import ElementTree +from xml.etree.ElementTree import Element + +import pytest + +GIT_ROOT = Path(__file__).parent.parent.absolute() +TEST_DIR = Path(__file__).parent +TEST_DATA_DIR = TEST_DIR / "data" +VALIDATION_DATA_DIR = TEST_DIR / "validation_data" +CONTROL_NWK377_PB_IGHC_MID1_40nt_2 = TEST_DATA_DIR / "CONTROL_NWK377_PB_IGHC_MID1_40nt_2.txz" + + +def get_container(): + tool = ElementTree.parse(GIT_ROOT / "complete_immunerepertoire.xml").getroot() + requirements: Element = tool.find("requirements") + container = requirements.find("container") + return container.text + + +@pytest.fixture(scope="module") +def imgt_result(): + temp_dir = Path(tempfile.mkdtemp()) + tool_dir = temp_dir / "imgt" + shutil.copytree(GIT_ROOT, tool_dir) + working_dir = temp_dir / "working" + working_dir.mkdir(parents=True) + output_dir = temp_dir / "outputs" + output_dir.mkdir(parents=True) + wrapper = str(tool_dir / "complete.sh") + sample = CONTROL_NWK377_PB_IGHC_MID1_40nt_2 + input = f"\"ID1\" {sample} {sample} \"ID2\" {sample}" + out_files_path = output_dir / "results" + out_files_path.mkdir(parents=True) + out_file = out_files_path / "result.html" + clonaltype = "none" + gene_selection = dict(species="Homo sapiens functional", + locus="TRA") + filterproductive = "yes" + clonality_method = "none" + cmd = [ + "bash", + wrapper, + input, + str(out_file), + str(out_files_path), + clonaltype, + gene_selection["species"], + gene_selection["locus"], + filterproductive, + clonality_method + ] + docker_cmd = ["docker", "run", "-v", f"{temp_dir}:{temp_dir}", + "-v", f"{sample}:{sample}", + "-w", str(working_dir), + get_container()] + cmd + with open(temp_dir / "stderr", "wt") as stderr_file: + with open(temp_dir / "stdout", "wt") as stdout_file: + subprocess.run(docker_cmd, cwd=working_dir, stdout=stdout_file, + stderr=stderr_file, check=True) + yield Path(out_files_path) + + +def test_check_output(imgt_result): + assert imgt_result.exists()