Commit 6125e623 authored by Raphael Müller's avatar Raphael Müller
Browse files

rules dependent on conda envs + install perl deps

parent 07b37b3b
# (new) Nextflow pipeline
## Install
```
conda env create -f environment.yml
conda activate backmap
```
## Usage
```
......@@ -66,6 +74,26 @@ Optional Options: [default]
```
## Test
### Install dev/test environments
#### Development
```
conda env create -f environment-dev.yml
conda activate backmap-dev
```
#### Snakemake
```
conda env create -f environment-test.yml
conda activate backmap-test
snakemake --profile sm_profile/ --conda-create-envs-only -F
snakemake --profile sm_profile/ -f install_perl_packages
```
## What's new? What did change?
### new options
......
......@@ -90,21 +90,19 @@ rule data_prep:
sed -n '{wildcards.offset}~{wildcards.divider}{{N;N;N;p}}' {input} > {output}
"""
#rule nanosim_training:
# input:
# genome = ASSEMBLY,
# pacbio = DATA + config["pacbio"],
# output:
# directory("no_backup/nanosim/")
# conda: "envs/nanosim.yaml"
# threads: 8
# shell:
# """
# read_analysis.py genome -i {input.reads} --ref_g {input.genome} -o {output}/training -t {threads}
# """
rule install_perl_packages:
output: "logs/install_perl_packages.log"
conda: "envs/perl.yml"
params:
packages=" ".join(config["perl_packages"])
shell:
"""
env PERL5LIB="" PERL_LOCAL_LIB_ROOT="" PERL_MM_OPT="" PERL_MB_OPT="" cpanm {params.packages} 2>&1 > {output}
for i in {params.packages};
do
perl -M"$i" -e 'print "Modul exists\\n";'
done
"""
rule nanosim:
input:
......@@ -127,7 +125,7 @@ rule nanosim:
)
output:
"data_prep/nanopore.sim.{number}.fastq"
conda: "envs/nanosim.yaml"
conda: "envs/nanosim.yml"
shadow: "full"
threads: 8
shell:
......
name: backmap
name: backmap-development
channels:
- conda-forge
- bioconda
......@@ -18,5 +18,3 @@ dependencies:
- r-base
- r-ggplot2
- r-dplyr
- r-extrafont
name: backmap-test
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- snakemake
- mamba
......@@ -4,11 +4,7 @@ channels:
- bioconda
- defaults
dependencies:
- snakemake
- mamba
- nextflow
- perl
- perl-app-cpanminus
- samtools
- bedtools
- bwa
......@@ -18,5 +14,3 @@ dependencies:
- r-base
- r-ggplot2
- r-dplyr
- r-extrafont
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- nextflow
- samtools
- bedtools
- bwa
- minimap2
- qualimap
- multiqc
- r-base
- r-ggplot2
- r-dplyr
name: backmap
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- snakemake
- mamba
- nextflow
- perl
- perl-app-cpanminus
- samtools
- bedtools
- bwa
- minimap2
- qualimap
- multiqc
- r-base
- r-ggplot2
- r-dplyr
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- perl
- perl-app-cpanminus
- samtools
- bedtools
- bwa
- minimap2
- qualimap
- multiqc
- r-base
......@@ -11,7 +11,6 @@ export NXF_WORK="/var/scratch/rmueller/work"
export NXF_ANSI_LOG=false
unset DISPLAY
#conda env update --file environment.yml
conda activate backmap
conda activate backmap-test
snakemake --profile sm_profile/ --cores 64 -F $1
......@@ -5,6 +5,7 @@ rule illumina_bams:
output:
"data_prep_bams/illumina.{divider,[0-9]+}.{offset,[0-9]+}.bam"
shadow: "shallow"
conda: "../envs/nextflow.yml"
threads: 16
shell:
"""
......@@ -19,6 +20,7 @@ rule pacbio_bams:
output:
"data_prep_bams/pacbio.{divider,[0-9]+}.{offset,[0-9]+}.pb.bam"
shadow: "shallow"
conda: "../envs/nextflow.yml"
threads: 16
shell:
"""
......@@ -32,6 +34,7 @@ rule nanopore_bams:
output:
"data_prep_bams/nanopore.{num,[0-9]+}.ont.bam"
shadow: "shallow"
conda: "../envs/nextflow.yml"
threads: 16
shell:
"""
......
......@@ -44,6 +44,7 @@ rule bams_illumina_paired_pacbio_nanopore_perl:
directory(OF+"pacbio.1000.1.pb.sort_stats/"),
benchmark: repeat("benchmarks/perl/{}.tsv".format(NAME), config["benchmark_repeats"])
threads: 16
conda: "../envs/perl.yml"
params:
prefix=NAME,
outdir=OF,
......@@ -98,6 +99,7 @@ rule bams_illumina_paired_pacbio_nanopore_nextflow:
directory(perl2nf(OF+"multiqc_data/")),
benchmark: repeat("benchmarks/nextflow/{}.tsv".format(NAME), config["benchmark_repeats"])
threads: 16
conda: "../envs/nextflow.yml"
params:
prefix=NAME,
outdir=perl2nf(OF),
......
......@@ -15,6 +15,7 @@ rule assembly_nanopore_perl:
outdir=OF,
prgm=config["original_perl_script"]
threads: 16
conda: "../envs/perl.yml"
benchmark: repeat("benchmarks/perl/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = "{folder}{name}.stdout.log".format(folder=OF, name=NAME),
......@@ -38,6 +39,7 @@ rule assembly_nanopore_nextflow:
outdir=perl2nf(rules.assembly_nanopore_perl.params.outdir),
prgm=config["nextflow_script"]
threads: 16
conda: "../envs/nextflow.yml"
benchmark: repeat("benchmarks/nextflow/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = perl2nf(rules.assembly_nanopore_perl.log.stdout),
......
......@@ -21,6 +21,7 @@ rule assembly_nanopore_multi_perl:
prgm=config["original_perl_script"],
nanopore = lambda wildcards, input: ["-ont "+ont for ont in input.nanopore]
threads: 16
conda: "../envs/perl.yml"
benchmark: repeat("benchmarks/perl/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = "{folder}{name}.stdout.log".format(folder=OF, name=NAME),
......@@ -45,6 +46,7 @@ rule assembly_nanopore_multi_nextflow:
nanopore=lambda wildcards, input: ",".join(input.nanopore),
prgm=config["nextflow_script"]
threads: 16
conda: "../envs/nextflow.yml"
benchmark: repeat("benchmarks/nextflow/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = perl2nf(rules.assembly_nanopore_multi_perl.log.stdout),
......@@ -70,6 +72,7 @@ rule assembly_nanopore_multi_nextflow_params:
nanopore=lambda wildcards, input: "\\n".join([ " - " + x for x in input.nanopore]),
prgm=config["nextflow_script"]
threads: 16
conda: "../envs/nextflow.yml"
benchmark: repeat("benchmarks/nextflow_params/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = perl2nf_params(rules.assembly_nanopore_multi_perl.log.stdout),
......
......@@ -20,6 +20,7 @@ rule assembly_pacbio_multi_perl:
pacbio = lambda wildcards, input: ["-pb "+pb for pb in input.pacbio],
prgm=config["original_perl_script"]
threads: 16
conda: "../envs/perl.yml"
benchmark: repeat("benchmarks/nextflow/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = "{folder}{name}.stdout.log".format(folder=OF, name=NAME),
......@@ -43,6 +44,7 @@ rule assembly_pacbio_multi_nextflow:
pacbio=lambda wildcards, input: ",".join(input.pacbio),
prgm=config["nextflow_script"]
threads: 16
conda: "../envs/nextflow.yml"
benchmark: repeat("benchmarks/nextflow/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = perl2nf(rules.assembly_pacbio_multi_perl.log.stdout),
......@@ -67,6 +69,7 @@ rule assembly_pacbio_multi_nextflow_params:
pacbio=lambda wildcards, input: "\\n".join([ " - " + x for x in input.pacbio]),
prgm=config["nextflow_script"]
threads: 16
conda: "../envs/nextflow.yml"
benchmark: repeat("benchmarks/nextflow_params/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = perl2nf_params(rules.assembly_pacbio_multi_perl.log.stdout),
......
......@@ -19,6 +19,7 @@ rule assembly_pacbio_nanopore_perl:
outdir=OF,
prgm=config["original_perl_script"]
threads: 16
conda: "../envs/perl.yml"
benchmark: repeat("benchmarks/perl/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = "{folder}{name}.stdout.log".format(folder=OF, name=NAME),
......@@ -43,6 +44,7 @@ rule assembly_pacbio_nanopore_nextflow:
outdir=perl2nf(rules.assembly_pacbio_nanopore_perl.params.outdir),
prgm=config["nextflow_script"]
threads: 16
conda: "../envs/nextflow.yml"
benchmark: repeat("benchmarks/nextflow/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = perl2nf(rules.assembly_pacbio_nanopore_perl.log.stdout),
......
......@@ -14,6 +14,7 @@ rule assembly_pacbio_perl:
outdir=OF,
prgm=config["original_perl_script"]
threads: 16
conda: "../envs/perl.yml"
benchmark: repeat("benchmarks/nextflow/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = "{folder}{name}.stdout.log".format(folder=OF, name=NAME),
......@@ -36,6 +37,7 @@ rule assembly_pacbio_nextflow:
outdir=perl2nf(rules.assembly_pacbio_perl.params.outdir),
prgm=config["nextflow_script"]
threads: 16
conda: "../envs/nextflow.yml"
benchmark: repeat("benchmarks/nextflow/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = perl2nf(rules.assembly_pacbio_perl.log.stdout),
......
......@@ -22,6 +22,7 @@ rule assembly_paired_multi_perl:
files=lambda wildcards, input: ["-p "+",".join(x) for x in zip(input.paired1,input.paired2)],
prgm=config["original_perl_script"]
threads: 16
conda: "../envs/perl.yml"
benchmark: repeat("benchmarks/perl/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = "{folder}{name}.stdout.log".format(folder=OF, name=NAME),
......@@ -46,6 +47,7 @@ rule assembly_paired_multi_nextflow:
files=lambda wildcards, input: ",".join([",".join(x) for x in zip(input.paired1,input.paired2)]),
prgm = config["nextflow_script"]
threads: 16
conda: "../envs/nextflow.yml"
benchmark: repeat("benchmarks/nextflow/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = perl2nf(rules.assembly_paired_multi_perl.log.stdout),
......@@ -71,6 +73,7 @@ rule assembly_paired_multi_nextflow_params:
files=lambda wildcards, input: "\\n".join(" - " + y for y in [",".join(x) for x in zip(input.paired1,input.paired2)]),
prgm = config["nextflow_script"]
threads: 16
conda: "../envs/nextflow.yml"
benchmark: repeat("benchmarks/nextflow_params/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = perl2nf_params(rules.assembly_paired_multi_perl.log.stdout),
......
......@@ -22,6 +22,7 @@ rule assembly_paired_nanopore_perl:
outdir=OF,
prgm=config["original_perl_script"]
threads: 16
conda: "../envs/perl.yml"
benchmark: repeat("benchmarks/perl/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = "{folder}{name}.stdout.log".format(folder=OF, name=NAME),
......@@ -47,6 +48,7 @@ rule assembly_paired_nanopore_nextflow:
outdir=perl2nf(rules.assembly_paired_nanopore_perl.params.outdir),
prgm=config["nextflow_script"]
threads: 16
conda: "../envs/nextflow.yml"
benchmark: repeat("benchmarks/nextflow/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = perl2nf(rules.assembly_paired_nanopore_perl.log.stdout),
......
......@@ -16,6 +16,7 @@ rule assembly_paired_perl:
outdir=OF,
prgm=config["original_perl_script"]
threads: 16
conda: "../envs/perl.yml"
benchmark: repeat("benchmarks/perl/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = "{folder}{name}.stdout.log".format(folder=OF, name=NAME),
......@@ -39,6 +40,7 @@ rule assembly_paired_nextflow:
outdir=perl2nf(rules.assembly_paired_perl.params.outdir),
prgm=config["nextflow_script"]
threads: 16
conda: "../envs/nextflow.yml"
benchmark: repeat("benchmarks/nextflow/{}.tsv".format(NAME), config["benchmark_repeats"])
log:
stdout = perl2nf(rules.assembly_paired_perl.log.stdout),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment