How to use the snakemake.shell.shell.executable function in snakemake

To help you get started, we’ve selected a few snakemake examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hyeshik / tailseeker / tailseeker / powersnake.py View on Github external
def init_powersnake():
    # pipefail is supported by bash only.
    shell.executable(os.popen('which bash').read().strip())
    shell.prefix('set -e; set -o pipefail; ')
github lcdb / lcdb-wf / ci / get-data.py View on Github external
import os
from snakemake.shell import shell
from snakemake.utils import makedirs

shell.executable('/bin/bash')

URL = 'https://github.com/lcdb/lcdb-test-data/blob/add-chipseq/data/{}?raw=true'

def _download_file(fn, dest=None):
    url = URL.format(fn)
    if dest is None:
        dest = fn
    makedirs(os.path.dirname(dest))
    basename = os.path.basename(fn)
    shell('wget -q -O- {url} > {dest}')
    return dest

_download_file('rnaseq_samples/sample1/sample1.tiny_R1.fastq.gz')
_download_file('rnaseq_samples/sample2/sample2.tiny_R1.fastq.gz')
_download_file('rnaseq_samples/sample3/sample3.tiny_R1.fastq.gz')
_download_file('rnaseq_samples/sample4/sample4.tiny_R1.fastq.gz')
github lcdb / lcdb-wf / ci / get-data.py View on Github external
#!/usr/bin/env python
import os
from snakemake.shell import shell
from snakemake.utils import makedirs

shell.executable('/bin/bash')
BRANCH = 'master'
URL = 'https://github.com/lcdb/lcdb-test-data/blob/{0}/data/{{}}?raw=true'.format(BRANCH)


def _download_file(fn, dest=None):
    url = URL.format(fn)
    if dest is None:
        dest = fn
    makedirs(os.path.dirname(dest))
    basename = os.path.basename(fn)
    shell('wget -q -O- {url} > {dest}')
    return dest


_download_file('rnaseq_samples/sample1/sample1.small_R1.fastq.gz', 'workflows/rnaseq/data/example_data/rnaseq_sample1.fq.gz')
_download_file('rnaseq_samples/sample2/sample2.small_R1.fastq.gz', 'workflows/rnaseq/data/example_data/rnaseq_sample2.fq.gz')