# HG changeset patch # User rhpvorderman # Date 1643799001 0 # Node ID 33412e85e6698560636f39ed5f6fd1bc665167d4 # Parent 7ae6b6b5d890f3797d35951ab06e7af2c154239b "planemo upload commit 2a9ed3adf321f18047c3746735a5e79a4586798d" diff -r 7ae6b6b5d890 -r 33412e85e669 CHANGES.md --- a/CHANGES.md Tue Dec 14 12:45:47 2021 +0000 +++ b/CHANGES.md Wed Feb 02 10:50:01 2022 +0000 @@ -1,3 +1,8 @@ +version 1.1.0 +------------- ++ Add a container requirement to allow using docker or singularity. ++ Add an option to download all files at once contained in a zip file. + version 1.0.2 ------------- + Remove some wrongly placed quotes diff -r 7ae6b6b5d890 -r 33412e85e669 build_container.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build_container.sh Wed Feb 02 10:50:01 2022 +0000 @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e +DEFAULT_BASE_IMAGE="$1" + +python3 create_container_hash.py $DEFAULT_BASE_IMAGE +mulled-build-files --namespace rhpvorderman build-and-test ./container_hash.tsv --verbose + diff -r 7ae6b6b5d890 -r 33412e85e669 complete_immunerepertoire.xml --- a/complete_immunerepertoire.xml Tue Dec 14 12:45:47 2021 +0000 +++ b/complete_immunerepertoire.xml Wed Feb 02 10:50:01 2022 +0000 @@ -1,4 +1,4 @@ - + r-gridextra r-ggplot2 @@ -15,7 +15,7 @@ unrar p7zip findutils - quay.io/rhpvorderman/mulled-v2-62aaeb9dad7d9973e676594c3aa69e605c73cd0c:80328e762d48b0d7b11c4fa41a5c09ca43d49db9-0 + quay.io/argalaxy/mulled-v2-62aaeb9dad7d9973e676594c3aa69e605c73cd0c:80328e762d48b0d7b11c4fa41a5c09ca43d49db9-0 diff -r 7ae6b6b5d890 -r 33412e85e669 container_hash.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/container_hash.tsv Wed Feb 02 10:50:01 2022 +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-data.table=1.11.4,r-reshape2=1.4.3,r-lymphclon=1.3.0,r-stringi=1.2.4,r-stringr=1.3.1,circos=0.69.6,circos-tools=0.23,tar=1.34,unzip=6.0,unrar=0.4,p7zip=16.02,findutils=4.6.0,font-ttf-ubuntu=0.83 bgruening/busybox-bash:latest 0 diff -r 7ae6b6b5d890 -r 33412e85e669 create_container_hash.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/create_container_hash.py Wed Feb 02 10:50:01 2022 +0000 @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 + +import sys + +from xml.etree import ElementTree +from xml.etree.ElementTree import Element + +DEFAULT_BASE_IMAGE = "bgruening/busybox-bash:latest" +def main(): + try: + base_image = sys.argv[1] + except IndexError: + base_image = DEFAULT_BASE_IMAGE + tool = ElementTree.parse("complete_immunerepertoire.xml").getroot() + requirements: Element = tool.find("requirements") + packages = [] + for req in requirements.findall("requirement"): + if req.get("type") == "package": + name = req.text + version = req.get("version") + package_string = f"{name}={version}" + packages.append(package_string) + with open("container_hash.tsv", mode="wt") as container_hash_file: + container_hash_file.write("#targets\tbase_image\timage_build\n") + container_hash_file.write(",".join(packages) + f"\t{base_image}\t0\n") + + +if __name__ == "__main__": + main() diff -r 7ae6b6b5d890 -r 33412e85e669 involucro Binary file involucro has changed diff -r 7ae6b6b5d890 -r 33412e85e669 report_clonality/r_wrapper.sh --- a/report_clonality/r_wrapper.sh Tue Dec 14 12:45:47 2021 +0000 +++ b/report_clonality/r_wrapper.sh Wed Feb 02 10:50:01 2022 +0000 @@ -9,6 +9,8 @@ filterproductive=$7 clonality_method=$8 +ALL_OUTPUTS_ZIP="$outputDir/all_outputs.zip" + dir="$(cd "$(dirname "$0")" && pwd)" useD="false" if grep -q "$species.*${locus}D" "$dir/genes.txt" ; then @@ -334,9 +336,36 @@ echo "" >> $outputFile fi + +# Create zip file with all download files +# Use 7za as it is packaged in the container already. +cd "$outputDir" || exit 1 + +7za a -tzip "$ALL_OUTPUTS_ZIP" -- \ + allUnique.txt VFFrequency.txt VFrequency.txt \ + JFrequency.txt DReadingFrame.txt CDR3LengthPlot.txt \ + AAComposition.txt clonalityComplete.txt + +if [[ "$useD" == "true" ]] ; then + 7za a -tzip "$ALL_OUTPUTS_ZIP" -- \ + DFFrequency.txt DFrequency.txt +fi +for sample in $samples; do + if [[ "$useD" == "true" ]] ; then + 7za a -tzip "$ALL_OUTPUTS_ZIP" -- \ + "HeatmapVD_$sample.txt" "HeatmapDJ_$sample.txt" \ + "${sample}_VD_circos.txt" "${sample}_DJ_circos.txt" + fi + 7za a -tzip "$ALL_OUTPUTS_ZIP" -- \ + "HeatmapVJ_$sample.txt" "${sample}_VJ_circos.txt" +done + +cd $dir || exit 1 + echo "
" >> $outputFile echo "" >> $outputFile echo "" >> $outputFile +echo "" >> $outputFile echo "" >> $outputFile echo "" >> $outputFile diff -r 7ae6b6b5d890 -r 33412e85e669 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 7ae6b6b5d890 -r 33412e85e669 tests/test_imgt.py --- a/tests/test_imgt.py Tue Dec 14 12:45:47 2021 +0000 +++ b/tests/test_imgt.py Wed Feb 02 10:50:01 2022 +0000 @@ -77,6 +77,12 @@ docker_cmd = ["docker", "run", "-v", f"{temp_dir}:{temp_dir}", "-v", f"{sample}:{sample}", "-w", str(working_dir), + # Run as current user which allows deletion of files. + # It also mitigates some security considerations + "-u", f"{os.getuid()}:{os.getgid()}", + # Run with default seccomp profile to mitigate mitigation slowdown + # http://mamememo.blogspot.com/2020/05/cpu-intensive-rubypython-code-runs.html + "--security-opt", "seccomp=unconfined", get_container()] + cmd with open(temp_dir / "stderr", "wt") as stderr_file: with open(temp_dir / "stdout", "wt") as stdout_file:
DescriptionLink
All outputs below in a zip fileDownload
The filtered datasetDownload
Gene frequencies