# HG changeset patch # User rhpvorderman # Date 1704889967 0 # Node ID d714f5ea83d79f7cab969350e3494b92a85314de # Parent fbc6307dd83bd0dccf91e8bc8e105b7d5fd71ddf planemo upload commit 1a01065a084a817382872154f779b94090a35ebf diff -r fbc6307dd83b -r d714f5ea83d7 CHANGELOG.md --- a/CHANGELOG.md Mon Jan 08 08:50:07 2024 +0000 +++ b/CHANGELOG.md Wed Jan 10 12:32:47 2024 +0000 @@ -1,3 +1,8 @@ +version 1.10.0 +------------------ ++ Fix crashing baseline when only unproductive sequences are present. ++ Replace "fast" option with options to toggle baseline and Change-O indidually. + version 1.9.1 ----------------- + Fix error in launch command. diff -r fbc6307dd83b -r d714f5ea83d7 CONTROL_NWK377_PB_IGHC_MID1_40nt_2.txz Binary file CONTROL_NWK377_PB_IGHC_MID1_40nt_2.txz has changed diff -r fbc6307dd83b -r d714f5ea83d7 a.out Binary file a.out has changed diff -r fbc6307dd83b -r d714f5ea83d7 baseline/wrapper.sh --- a/baseline/wrapper.sh Mon Jan 08 08:50:07 2024 +0000 +++ b/baseline/wrapper.sh Wed Jan 10 12:32:47 2024 +0000 @@ -1,4 +1,5 @@ #!/bin/bash + dir="$(cd "$(dirname "$0")" && pwd)" testID=$1 @@ -79,14 +80,16 @@ echo "$workdir/${outID}.txt" -rows=`tail -n +2 $workdir/${outID}.txt | grep -v "All sequences combined" | grep -n 'Group' | grep -Eoh '^[0-9]+' | tr '\n' ' '` -rows=($rows) -#unset rows[${#rows[@]}-1] +if [[ -f "$workdir/${outID}.txt" ]] +then + rows=`tail -n +2 $workdir/${outID}.txt | grep -v "All sequences combined" | grep -n 'Group' | grep -Eoh '^[0-9]+' | tr '\n' ' '` + rows=($rows) + #unset rows[${#rows[@]}-1] -cd $dir -Rscript --verbose $dir/comparePDFs.r $workdir/${outID}.RData $output ${rows[@]} 2>&1 -cp $workdir/result.txt ${output_table} + cd $dir + Rscript --verbose $dir/comparePDFs.r $workdir/${outID}.RData $output ${rows[@]} 2>&1 + cp $workdir/result.txt ${output_table} +fi - diff -r fbc6307dd83b -r d714f5ea83d7 shm_csr.xml --- a/shm_csr.xml Mon Jan 08 08:50:07 2024 +0000 +++ b/shm_csr.xml Wed Jan 10 12:32:47 2024 +0000 @@ -1,4 +1,4 @@ - + python @@ -35,7 +35,7 @@ $filter_unique.filter_unique_clone_count $class_filter_cond.class_filter $empty_region_filter - $fast + $changeo $baseline #else: $__tool_directory__/wrapper.sh "$in_file" custom @@ -48,7 +48,7 @@ 2 $class_filter_cond.class_filter $empty_region_filter - $fast + $changeo $baseline #end if ]]> @@ -108,59 +108,57 @@ - - - - - - - - - - - + + + + - naive_output_cond['naive_output'] == "yes" + naive_output_cond['naive_output'] is True class_filter_cond['class_filter'] != "101_101" class_filter_cond['class_filter'] != "101_101_IGG" class_filter_cond['class_filter'] != "101_101_IGM" - naive_output_cond['naive_output'] == "yes" + naive_output_cond['naive_output'] is True class_filter_cond['class_filter'] != "101_101" class_filter_cond['class_filter'] != "101_101_IGA" class_filter_cond['class_filter'] != "101_101_IGM" - naive_output_cond['naive_output'] == "yes" + naive_output_cond['naive_output'] is True class_filter_cond['class_filter'] != "101_101" class_filter_cond['class_filter'] != "101_101_IGA" class_filter_cond['class_filter'] != "101_101_IGG" - naive_output_cond['naive_output'] == "yes" + naive_output_cond['naive_output'] is True class_filter_cond['class_filter'] != "101_101" class_filter_cond['class_filter'] != "101_101_IGA" class_filter_cond['class_filter'] != "101_101_IGG" class_filter_cond['class_filter'] != "101_101_IGM" - naive_output_cond['naive_output'] == "yes" + naive_output_cond['naive_output'] is True class_filter_cond['class_filter'] != "101_101" class_filter_cond['class_filter'] != "101_101_IGA" class_filter_cond['class_filter'] != "101_101_IGG" - naive_output_cond['naive_output'] == "yes" + naive_output_cond['naive_output'] is True class_filter_cond['class_filter'] != "101_101" class_filter_cond['class_filter'] != "101_101_IGA" class_filter_cond['class_filter'] != "101_101_IGG" - naive_output_cond['naive_output'] == "yes" + naive_output_cond['naive_output'] is True class_filter_cond['class_filter'] == "101_101" diff -r fbc6307dd83b -r d714f5ea83d7 show_time_as_float Binary file show_time_as_float has changed diff -r fbc6307dd83b -r d714f5ea83d7 tests/.pytest_cache/.gitignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/.pytest_cache/.gitignore Wed Jan 10 12:32:47 2024 +0000 @@ -0,0 +1,2 @@ +# Created by pytest automatically. +* diff -r fbc6307dd83b -r d714f5ea83d7 tests/.pytest_cache/CACHEDIR.TAG --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/.pytest_cache/CACHEDIR.TAG Wed Jan 10 12:32:47 2024 +0000 @@ -0,0 +1,4 @@ +Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag created by pytest. +# For information about cache directory tags, see: +# https://bford.info/cachedir/spec.html diff -r fbc6307dd83b -r d714f5ea83d7 tests/.pytest_cache/README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/.pytest_cache/README.md Wed Jan 10 12:32:47 2024 +0000 @@ -0,0 +1,8 @@ +# pytest cache directory # + +This directory contains data from the pytest's cache plugin, +which provides the `--lf` and `--ff` options, as well as the `cache` fixture. + +**Do not** commit this to version control. + +See [the docs](https://docs.pytest.org/en/stable/how-to/cache.html) for more information. diff -r fbc6307dd83b -r d714f5ea83d7 tests/.pytest_cache/v/cache/lastfailed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/.pytest_cache/v/cache/lastfailed Wed Jan 10 12:32:47 2024 +0000 @@ -0,0 +1,3 @@ +{ + "test_shm_csr.py::test_baseline_succeeds": true +} \ No newline at end of file diff -r fbc6307dd83b -r d714f5ea83d7 tests/.pytest_cache/v/cache/nodeids --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/.pytest_cache/v/cache/nodeids Wed Jan 10 12:32:47 2024 +0000 @@ -0,0 +1,3 @@ +[ + "test_shm_csr.py::test_baseline_succeeds" +] \ No newline at end of file diff -r fbc6307dd83b -r d714f5ea83d7 tests/.pytest_cache/v/cache/stepwise --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/.pytest_cache/v/cache/stepwise Wed Jan 10 12:32:47 2024 +0000 @@ -0,0 +1,1 @@ +[] \ No newline at end of file diff -r fbc6307dd83b -r d714f5ea83d7 tests/__pycache__/test_shm_csr.cpython-37-pytest-6.2.5.pyc Binary file tests/__pycache__/test_shm_csr.cpython-37-pytest-6.2.5.pyc has changed diff -r fbc6307dd83b -r d714f5ea83d7 tests/__pycache__/test_shm_csr.cpython-39-pytest-7.2.1.pyc Binary file tests/__pycache__/test_shm_csr.cpython-39-pytest-7.2.1.pyc has changed diff -r fbc6307dd83b -r d714f5ea83d7 tests/__pycache__/test_shm_csr.cpython-39-pytest-7.4.4.pyc Binary file tests/__pycache__/test_shm_csr.cpython-39-pytest-7.4.4.pyc has changed diff -r fbc6307dd83b -r d714f5ea83d7 tests/data/.~lock.handleiding activeren pas.docx# --- a/tests/data/.~lock.handleiding activeren pas.docx# Mon Jan 08 08:50:07 2024 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -Vorderman\, R.H.P. (MOLEPI) ,rhpvorderman,sasc-pc-6,21.02.2023 15:01,file:///home/rhpvorderman/.config/libreoffice/4; \ No newline at end of file diff -r fbc6307dd83b -r d714f5ea83d7 tests/data/handleiding activeren pas.docx Binary file tests/data/handleiding activeren pas.docx has changed diff -r fbc6307dd83b -r d714f5ea83d7 tests/test_shm_csr.py --- a/tests/test_shm_csr.py Mon Jan 08 08:50:07 2024 +0000 +++ b/tests/test_shm_csr.py Wed Jan 10 12:32:47 2024 +0000 @@ -49,8 +49,31 @@ return files return () -@pytest.fixture(scope="module") -def shm_csr_result(): + +def run_shm_csr( + input=str(CONTROL_NWK377_PB_IGHC_MID1_40nt_2), + infile_name = "input_data", + functionality = "productive", + unique = "Sequence.ID", + naive_output = "no", + naive_output_ca = "None", + naive_output_cg = "None", + naive_output_cm = "None", + naive_output_ce = "None", + naive_output_all = "None", + naive_output_igm_naive = "None", + naive_output_igm_naive_memory = "None", + filter_unique = "remove", + filter_unique_count = '2', + class_filter = '70_70', + empty_region_filter = 'FR1', + # Skip baseline and changeo by default. These tools cannot be modified + # anyway and take most of the test time to execute. The environment + # variable can be set to "no" on the CI so the code path is tested + # at the time a PR is ready. + run_changeo = "yes" if os.environ.get("SHM_CSR_FAST") == "no" else "no", + run_baseline = "yes" if os.environ.get("SHM_CSR_FAST") == "no" else "no", +): temp_dir = Path(tempfile.mkdtemp()) tool_dir = temp_dir / "shm_csr" shutil.copytree( @@ -62,29 +85,8 @@ output_dir = temp_dir / "outputs" output_dir.mkdir(parents=True) wrapper = str(tool_dir / "wrapper.sh") - input = str(CONTROL_NWK377_PB_IGHC_MID1_40nt_2) out_files_path = output_dir / "results" out_file = out_files_path / "result.html" - infile_name = "input_data" - functionality = "productive" - unique = "Sequence.ID" - naive_output = "no" - naive_output_ca = "None" - naive_output_cg = "None" - naive_output_cm = "None" - naive_output_ce = "None" - naive_output_all = "None" - naive_output_igm_naive = "None" - naive_output_igm_naive_memory = "None" - filter_unique = "remove" - filter_unique_count = '2' - class_filter = '70_70' - empty_region_filter = 'FR1' - # Skip baseline and changeo by default. These tools cannot be modified - # anyway and take most of the test time to execute. The environment - # variable can be set to "no" on the CI so the code path is tested - # at the time a PR is ready. - fast = os.environ.get("SHM_CSR_FAST", "yes") cmd = [ "bash", wrapper, @@ -108,7 +110,8 @@ filter_unique_count, class_filter, empty_region_filter, - fast + run_changeo, + run_baseline ] docker_cmd = ["docker", "run", "-v", f"{temp_dir}:{temp_dir}", "--rm", # Remove container after running @@ -128,7 +131,12 @@ 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) + return Path(out_files_path) + + +@pytest.fixture(scope="module") +def shm_csr_result(): + yield run_shm_csr() def test_check_output(shm_csr_result): @@ -157,3 +165,16 @@ ) as validate_h: for line in result_h: assert line == validate_h.readline() + + +def test_baseline_succeeds(): + run_shm_csr( + functionality="unproductive", + empty_region_filter="None", + filter_unique="no", + unique="VGene,DGene,JGene,CDR3.IMGT.seq", + class_filter="101_101_IGA", + naive_output="yes", + run_baseline="yes", + run_changeo="yes", + ) diff -r fbc6307dd83b -r d714f5ea83d7 time_ns Binary file time_ns has changed diff -r fbc6307dd83b -r d714f5ea83d7 wrapper.sh --- a/wrapper.sh Mon Jan 08 08:50:07 2024 +0000 +++ b/wrapper.sh Wed Jan 10 12:32:47 2024 +0000 @@ -22,7 +22,8 @@ filter_unique_count=${18} class_filter=${19} empty_region_filter=${20} -fast=${21} +run_changeo=${21} +run_baseline=${22} BASENAME=$(basename "$title") # Cut off .txz or .tgz suffix and also replace spaces with underscores. NEW_IMGT_PREFIX="new_IMGT_${BASENAME%.*}" @@ -410,7 +411,7 @@ rm 1_Summary.txt } -if [[ "$fast" == "no" ]] ; then +if [[ "$run_baseline" == "yes" ]] ; then @@ -524,7 +525,7 @@ echo "" >> $output #CSR tab end -if [[ "$fast" == "no" ]] ; then +if [[ "$run_changeo" == "yes" ]] ; then echo "---------------- change-o MakeDB ----------------"