pytest_ngsfixtures.wm package

Submodules

pytest_ngsfixtures.wm.snakemake module

pytest_ngsfixtures.wm.snakemake.run(snakefile, target='all', save=False, **kwargs)[source]

Run snakemake on snakefile.

Wraps snakefile in a command string and pass the string to shell wrapper.

Examples

from pytest_ngsfixtures.wm import snakemake

for r in snakemake.run("/path/to/Snakefile", target="test.bam",
                       options=["--ri -k"], iterable=True):
    print(r)
Parameters:
  • snakefile (str, py._path.local.LocalPath) – snakefile full path name
  • target (str) – snakemake target to run
  • options (list) – options to pass to snakemake
  • save (bool) – save shell script with command
Kwargs:
See pytest_ngsfixtures.shell.shell documentation.
Returns:Results from shell.
pytest_ngsfixtures.wm.snakemake.snakefile(request, tmpdir_factory)[source]

Return a temporary directory path object pointing to the location of a Snakefile.

If no snakefile is defined with pytest.mark.snakefile, the fixture will assume there is a Snakefile in the same directory as the calling test file.

Examples

@pytest.mark.snakefile(snakefile="/path/to/Snakefile", dirname="foo")
def test_snakefile(snakefile):
    print(snakefile.listdir())

Module contents