Hi!
I met a question about snakemake when I try to specify a conda env within a specific rule, but not influence other rules which should be run in default conda env.
configfile:
"config.json"
SAMPLES, = glob_wildcards(config['data']+"/{id}_L001_R1_001.fastq.gz")
rule align_sort:
input:
config['data']+"/{sample}_L001_R1_001.fastq.gz",
config['data']+"/{sample}_L001_R2_001.fastq.gz"
output:
temp("{sample}.mapped.bam")
params:
rg = "@RG\tID:{sample}\tPL:ILLUMINA\tSM:{sample}",
ref = config['genome']
shell:
"bwa mem -R '{params.rg}' -M {params.ref} {input} | samtools sort -o {output} -"
rule removeClipping:
input:
"{sample}.mapped.bam"
output:
temp("{sample}.clipped.bam")
conda:
"bio2"
shell:
"bamutils removeclipping {input} {output}"
......
In my snakemake file, I have only one rule named removeClipping
which has to be run in another conda environment named bio2
.
But the remaining rule should be run in the default conda environment.
So I do not sure about the conda:
setting in snakemake. Is this means that only this specific rule will be run in bio
env, and the remaining rule will still be run in the default env?
Is anyone clear on this issue and would like help me figure this out? Many thanks!
Thank you for responding so quickly!!
This helps me a lot.