Snakemake-Profiles / lsf

Snakemake profile for running jobs on an LSF cluster
MIT License
36 stars 22 forks source link

Complex shell quote escaping fails #39

Closed bricoletc closed 2 years ago

bricoletc commented 3 years ago

Hello,

I was trying to instruct snakemake to ignore a specific lsf host which is faulty, so wrote this in my lsf.yaml:

__default__:
  - "-R \"select[hname!='hl-codon-32-02']\""

(This gets parsed as {'__default__': ['-R "select[hname!=\'hl-codon-32-02\']"']} by pyyaml)

The reason I do this is that if the hostname to ignore has special characters, the shell command needs to look like -R "select[hname!='hname']" (see IBM docs : If you need to include a hyphen (-) or other non-alphabetic characters within the string, enclose the text in single quotation marks, for example, bsub -R "select[hname!='host06-x12']")

However this gets passed at submission time as -R select[hname!='hl-codon-32-02'] but lsf cannot submit that (try bsub -Is -R select[hname!='hl-codon-32-02'] bash for eg)

Pfew- long story short, I have found a simple solution to this, and putting in a PR with unit tests.