Snakemake fails to find conda in PBS
1
0
Entering edit mode
7 months ago
yixinzeng • 0

I tried to run snakemake on the PBS cluster, but snakemake reported an error as follows, the home directory is hidden with $HOME

$ snakemake --cluster "qsub -S /bin/sh -j y -cwd -pe thread 10-10 -q fat.q" -j 2 --core 10 --use-conda
Building DAG of jobs...
Traceback (most recent call last):
  File "$HOME/micromamba/envs/snakemake/lib/python3.8/site-packages/snakemake/__init__.py", line 792, in snakemake
    success = workflow.execute(
  File "$HOME/micromamba/envs/snakemake/lib/python3.8/site-packages/snakemake/workflow.py", line 1078, in execute
    dag.create_conda_envs(
  File "$HOME/micromamba/envs/snakemake/lib/python3.8/site-packages/snakemake/dag.py", line 359, in create_conda_envs
    env.create(dryrun)
  File "$HOME/micromamba/envs/snakemake/lib/python3.8/site-packages/snakemake/deployment/conda.py", line 393, in create
    pin_file = self.pin_file
  File "$HOME/micromamba/envs/snakemake/lib/python3.8/site-packages/snakemake/common/__init__.py", line 217, in __get__
    value = self.method(instance)
  File "$HOME/micromamba/envs/snakemake/lib/python3.8/site-packages/snakemake/deployment/conda.py", line 103, in pin_file
    f".{self.conda.platform}.pin.txt"
  File "$HOME/micromamba/envs/snakemake/lib/python3.8/site-packages/snakemake/common/__init__.py", line 217, in __get__
    value = self.method(instance)
  File "$HOME/micromamba/envs/snakemake/lib/python3.8/site-packages/snakemake/deployment/conda.py", line 96, in conda
    return Conda(
  File "$HOME/micromamba/envs/snakemake/lib/python3.8/site-packages/snakemake/deployment/conda.py", line 657, in __init__
    self.prefix_path = self.info["conda_prefix"]
KeyError: 'conda_prefix'
(snakemake)

The snakemake file is as follows

# config
configfile: "config.yaml"

# samples
SAMPLES = config["samples"]

# target rule
rule all:
    input:
        expand("mapped/{sample}.bam", sample=SAMPLES.keys())
# STAR mapping
rule star_map:
    input:
        reads = lambda wildcards: (SAMPLES[wildcards.sample]['r1'], SAMPLES[wildcards.sample]['r2'])
    output:
        "mapped/{sample}.bam"
    params:
        index = "$HOME/1-rna_editing/ref/STAR_genome_index",
        prefix = "mapped/{sample}"
    conda: "environment.yml"
    threads: 8
    shell:
        """
        STAR --runMode alignReads \
             --runThreadN {threads} \
             --genomeDir {params.index} \
             --readFilesCommand zcat \
             --outFileNamePrefix {params.prefix} \
             --outSAMtype BAM SortedByCoordinate \
             --readFilesIn {input.reads}
        """

This seems to be because snakemake did not find conda, but I did install micromamba.

$ which micromamba
$HOME/bin/micromamba

The version of snakemake is 7.32.4.

I found some similar reports: https://github.com/snakemake/snakemake/issues/1204

Any information would be very helpful, thank you so much.

snakemake • 533 views
ADD COMMENT
0
Entering edit mode
6 months ago
tim.booth ▴ 110

Snakemake does not have support for micromamba. There is an open issue: https://github.com/snakemake/snakemake/issues/2322

ADD COMMENT

Login before adding your answer.

Traffic: 2667 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6