From 359d8eb60cdc5b0ee422a391f1c93f1aca63ce57 Mon Sep 17 00:00:00 2001 From: JD2112 Date: Wed, 8 Nov 2023 10:38:21 +0100 Subject: [PATCH] nanopore container splits [x] nanopore container splits into nanopolish and medaka [x] fixed issues with nanopolish, added numpy (1.21.0) and tensorflow (1.14.0) [x] medaka version updated to 1.7.2 [x] --medaka-model added to medaka workflow. [x] README updated [ ] needs container updated on gms-Dockerhub. --- .gitignore | 5 +++- README.md | 8 ++++++ conf/base.config | 4 +-- conf/nanopore.config | 4 +++ environments/medaka/Dockerfile | 18 +++++++++++++ environments/medaka/Singularity | 35 +++++++++++++++++++++++++ environments/medaka/environment.yml | 11 ++++++++ environments/medaka/extras.yml | 10 +++++++ environments/nanopolish/Dockerfile | 18 +++++++++++++ environments/nanopolish/Singularity | 35 +++++++++++++++++++++++++ environments/nanopolish/environment.yml | 24 +++++++++++++++++ environments/nanopolish/extras.yml | 10 +++++++ modules/artic.nf | 6 +++-- nextflow.config | 6 +++-- 14 files changed, 187 insertions(+), 7 deletions(-) create mode 100644 environments/medaka/Dockerfile create mode 100644 environments/medaka/Singularity create mode 100644 environments/medaka/environment.yml create mode 100644 environments/medaka/extras.yml create mode 100644 environments/nanopolish/Dockerfile create mode 100644 environments/nanopolish/Singularity create mode 100644 environments/nanopolish/environment.yml create mode 100644 environments/nanopolish/extras.yml diff --git a/.gitignore b/.gitignore index 20bf6360..a20bcfc8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ nextflow results *.sif -work +work/ .idea/ .DS_Store +nanopore_medaka/ +nanopore_nanopolish/ +illumina_test/ diff --git a/README.md b/README.md index dd7487f8..904cdcbd 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,9 @@ nextflow run main.nf -profile singularity \ --outdir illumina_test ``` ### Nanopore nanopolish pipeline + +PLEASE NOTE: check the 'nextflow.config' is updated with 'gms-artic-nanopolish:latest' + ``` nextflow run main.nf -profile singularity \ --nanopolish --prefix "test_nanopore_nanopolish" \ @@ -111,10 +114,14 @@ nextflow run main.nf -profile singularity \ --outdir nanopore_nanopolish ``` #### Nanopore medaka pipeline + +PLEASE NOTE: check the 'nextflow.config' is updated with 'gms-artic-medaka:latest'. To use the 'medka' workflow, please provide the '--medaka-model'. [Read more here](https://github.com/nanoporetech/medaka/tree/master#models) how to get the model information. + ``` nextflow run main.nf -profile singularity \ --medaka --prefix "test_nanopore_medaka" \ --basecalled_fastq .github/data/nanopore/20200311_1427_X1_FAK72834_a3787181/fastq_pass/ \ + --medaka-model dna_r10.4.1_e8.2_400bps_hac@v4.1.0:variant \ --outdir nanopore_medaka ``` @@ -142,6 +149,7 @@ nextflow run main.nf -profile singularity,sge \ nextflow run main.nf -profile singularity,sge \ --medaka --prefix "test_nanopore_medaka" \ --basecalled_fastq .github/data/nanopore/20200311_1427_X1_FAK72834_a3787181/fastq_pass/ \ + --medaka-model dna_r10.4.1_e8.2_400bps_hac@v4.1.0:variant \ --outdir nanopore_medaka ``` 2. *for Illumina analysis* diff --git a/conf/base.config b/conf/base.config index 262193f3..086ab3f6 100644 --- a/conf/base.config +++ b/conf/base.config @@ -17,8 +17,8 @@ params{ // Repo to download your primer scheme from - //schemeRepoURL = 'https://github.com/genomic-medicine-sweden/gms-artic.git' - schemeRepoURL = 'https://github.com/jd2112/gms-artic.git' + schemeRepoURL = 'https://github.com/genomic-medicine-sweden/gms-artic.git' + //schemeRepoURL = 'https://github.com/jd2112/gms-artic.git' // Directory within schemeRepoURL that contains primer schemes schemeDir = 'gms-artic' diff --git a/conf/nanopore.config b/conf/nanopore.config index 75102cea..e6b3996f 100644 --- a/conf/nanopore.config +++ b/conf/nanopore.config @@ -34,5 +34,9 @@ params { // Minimum coverage depth to call aa consequences of variant. csqDpThreshold = 20 + + // medaka model used by artic minion + // {pore}_{device}_{caller variant}_{caller version} + medakaModel = 'dna_r10.4.1_e8.2_400bps_hac@v4.1.0:variant' } diff --git a/environments/medaka/Dockerfile b/environments/medaka/Dockerfile new file mode 100644 index 00000000..b14bf5c9 --- /dev/null +++ b/environments/medaka/Dockerfile @@ -0,0 +1,18 @@ +FROM continuumio/miniconda3:latest AS condabuild +LABEL authors="Matt Bull" \ + description="Docker image containing all requirements for the ARTIC project's ncov2019 pipeline" + +COPY environments/extras.yml /extras.yml +COPY environments/medaka/environment.yml /environment.yml +RUN /opt/conda/bin/conda install mamba -c conda-forge && \ +/opt/conda/bin/conda update mamba -c conda-forge && \ +/opt/conda/bin/mamba env create -f /environment.yml + +FROM debian:buster-slim +RUN apt-get update && \ +apt-get install -y git procps && \ +apt-get clean -y +COPY --from=condabuild /opt/conda/envs/artic /opt/conda/envs/artic +ENV PATH=/opt/conda/envs/artic/bin:$PATH +ENV LC_ALL C.UTF-8 +ENV LANG C.UTF-8 diff --git a/environments/medaka/Singularity b/environments/medaka/Singularity new file mode 100644 index 00000000..80e58c7f --- /dev/null +++ b/environments/medaka/Singularity @@ -0,0 +1,35 @@ +Bootstrap: docker +From: condaforge/mambaforge:latest +Stage: condabuild + +%files +environments/nanopore/environment.yml /environment.yml +environments/extras.yml /extras.yml + +%labels +authors="Matt Bull" +description="Docker image containing all requirements for the ARTIC project's ncov2019 pipeline" + +%post +/opt/conda/bin/mamba env create -f /environment.yml #&& \ +/opt/conda/bin/mamba env update -f /extras.yml -n artic + +Bootstrap: docker +From: debian:buster-slim +Stage: final + +%post +apt-get update && \ +apt-get install -y git procps && \ +apt-get clean -y + +%files from condabuild +/opt/conda/envs/artic /opt/conda/envs/artic + +%environment +export PATH=/opt/conda/envs/artic/bin:$PATH +export LC_ALL=C.UTF-8 +export LANG=C.UTF-8 + +%runscript +exec "/opt/conda/envs/artic/bin/artic" "$@" diff --git a/environments/medaka/environment.yml b/environments/medaka/environment.yml new file mode 100644 index 00000000..f4c7ba75 --- /dev/null +++ b/environments/medaka/environment.yml @@ -0,0 +1,11 @@ +condaname: artic +channels: + - epi2melabs + - bioconda + - conda-forge + - defaults +dependencies: + - aplanat=0.5.4 + - fastcat=0.3.6 + - np-artic=1.3.0 + - pomoxis=0.3.6 \ No newline at end of file diff --git a/environments/medaka/extras.yml b/environments/medaka/extras.yml new file mode 100644 index 00000000..ced40cad --- /dev/null +++ b/environments/medaka/extras.yml @@ -0,0 +1,10 @@ +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - biopython + - matplotlib + - pandas + - samtools + - libxcb diff --git a/environments/nanopolish/Dockerfile b/environments/nanopolish/Dockerfile new file mode 100644 index 00000000..3fcf6f88 --- /dev/null +++ b/environments/nanopolish/Dockerfile @@ -0,0 +1,18 @@ +FROM continuumio/miniconda3:latest AS condabuild +LABEL authors="Matt Bull" \ + description="Docker image containing all requirements for the ARTIC project's ncov2019 pipeline" + +COPY environments/extras.yml /extras.yml +COPY environments/nanopolish/environment.yml /environment.yml +RUN /opt/conda/bin/conda install mamba -c conda-forge && \ +/opt/conda/bin/conda update mamba -c conda-forge && \ +/opt/conda/bin/mamba env create -f /environment.yml + +FROM debian:buster-slim +RUN apt-get update && \ +apt-get install -y git procps && \ +apt-get clean -y +COPY --from=condabuild /opt/conda/envs/artic /opt/conda/envs/artic +ENV PATH=/opt/conda/envs/artic/bin:$PATH +ENV LC_ALL C.UTF-8 +ENV LANG C.UTF-8 diff --git a/environments/nanopolish/Singularity b/environments/nanopolish/Singularity new file mode 100644 index 00000000..80e58c7f --- /dev/null +++ b/environments/nanopolish/Singularity @@ -0,0 +1,35 @@ +Bootstrap: docker +From: condaforge/mambaforge:latest +Stage: condabuild + +%files +environments/nanopore/environment.yml /environment.yml +environments/extras.yml /extras.yml + +%labels +authors="Matt Bull" +description="Docker image containing all requirements for the ARTIC project's ncov2019 pipeline" + +%post +/opt/conda/bin/mamba env create -f /environment.yml #&& \ +/opt/conda/bin/mamba env update -f /extras.yml -n artic + +Bootstrap: docker +From: debian:buster-slim +Stage: final + +%post +apt-get update && \ +apt-get install -y git procps && \ +apt-get clean -y + +%files from condabuild +/opt/conda/envs/artic /opt/conda/envs/artic + +%environment +export PATH=/opt/conda/envs/artic/bin:$PATH +export LC_ALL=C.UTF-8 +export LANG=C.UTF-8 + +%runscript +exec "/opt/conda/envs/artic/bin/artic" "$@" diff --git a/environments/nanopolish/environment.yml b/environments/nanopolish/environment.yml new file mode 100644 index 00000000..5efb8017 --- /dev/null +++ b/environments/nanopolish/environment.yml @@ -0,0 +1,24 @@ +name: artic +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - artic=1.1.3 + - pyyaml=5.3.1 + - python>=3.6 + - pip=19.3.1 + - gofasta=0.0.4 + - usher=0.2.0 + - snakemake-minimal=5.13 + - minimap2=2.17 + - nextclade=2.11 + - fastqc=0.11.9 + - rich=12.6.0 + - multiqc=1.11 + - numpy=<1.21.0 + - tensorflow=1.14.0 + - pip: + - pandas >= 1.1 + - scikit-learn >= 0.23.1 + - muscle=3.8 \ No newline at end of file diff --git a/environments/nanopolish/extras.yml b/environments/nanopolish/extras.yml new file mode 100644 index 00000000..ced40cad --- /dev/null +++ b/environments/nanopolish/extras.yml @@ -0,0 +1,10 @@ +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - biopython + - matplotlib + - pandas + - samtools + - libxcb diff --git a/modules/artic.nf b/modules/artic.nf index f91981fa..67fe7d6e 100644 --- a/modules/artic.nf +++ b/modules/artic.nf @@ -81,10 +81,12 @@ process articMinIONMedaka { """ artic minion --medaka \ ${minionFinalConfig} \ + --medaka-model ${params.medakaModel} \ --threads ${task.cpus} \ - --scheme-directory ${schemeRepo} \ + --scheme-directory ${params.schemeDir}/${params.scheme} \ --read-file ${fastq} \ - ${params.scheme}/${params.schemeVersion} \ + --scheme-version ${params.schemeVersion} \ + nCoV-2019-primer \ ${sampleName} """ } diff --git a/nextflow.config b/nextflow.config index 8c1b4d25..6a1bc05e 100644 --- a/nextflow.config +++ b/nextflow.config @@ -66,10 +66,12 @@ profiles { container="docker://genomicmedicinesweden/gms-artic-nanopore:latest" } withName:articMinIONMedaka { - container="docker://genomicmedicinesweden/gms-artic-nanopore:latest" + container="docker://genomicmedicinesweden/gms-artic-medka:latest" + //container="docker://jd21/gms-artic-medaka:latest" } withName:articMinIONNanopolish { - container="docker://genomicmedicinesweden/gms-artic-nanopore:latest" + container="docker://genomicmedicinesweden/gms-artic-nanopolish:latest" + //container="docker://jd21/gms-artic-nanopolish:latest" } withName:articRemoveUnmappedReads { container="docker://genomicmedicinesweden/gms-artic-nanopore:latest"