Package: pytest-ngsfixtures
pytest-ngsfixturesAboutThis is apytest pluginthat provides
functionality for next generation sequencingpytest fixtures. There are some
predefined fixtures, but the main functionality depends on configuring
fixtures via thepytest.markhelper function.See thepytest-ngsfixtures documentationfor more information and
usage.Free software: GNU General Public License v3Featuresa small test ngs data setpredefined sample layoutswrappers for quickly setting up workflow testsInstallation$condainstall-cpercyfalpytest-ngsfixtures$pipinstallpytest-ngsfixturesUsageYou can easily setup a test requiring the predefinedsamplesandreffixtures:deftest_data(samples,ref):shell("bwa index{}".format(ref.join("scaffolds.fa")))shell("bwa mem{}{}{}| samtools view -b >{}".format(ref.join("scaffolds.fa"),samples.join("s1_1.fastq.gz"),samples.join("s1_2.fastq.gz"),samples.join("s1.bam")))assertsamples.join("s1.bam").exists()The samples and ref fixtures can also be configured to use local
files:importpytest@pytest.mark.samples(layout={'s1_1.fastq.gz':"/path/to/read1.fastq.gz",'s1_2.fastq.gz':"/path/to/read2.fastq.gz"})@pytest.mark.ref(data={'ref.fa':"/path/to/reference.fa"})deftest_data(samples,ref):# Do something with dataIn addition, there are wrapper functions and fixtures for workflow
managers, including Snakemake.importpytestfrompytest_ngsfixtures.wm.snakemakeimportsnakefile,runassnakemake_run# By default, the snakefile fixture assumes there is a Snakefile in# the test file directorydeftest_workflow(samples,snakefile):snakemake_run(snakefile,options=["-d",str(samples)])assertsamples.join("results.txt").exists()See thepytest-ngsfixtures documentationfor more examples.CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.8.1 (2019-09-06)Hotfix: fix failing conda builds0.8.0 (2019-09-05)FeaturesAdd support for python 3.7Pin pytest >= 5.0PEP-8 formattingCheck for correct snakemake repo tag0.7.6 (2018-05-25)FeaturesAdd path option to override tmpdir_factory invocationPass ignore_errors to copy/link function0.7.5 (2018-05-25)FeaturesAdd Fixture class to setup fixtures (#63)0.7.4 (2018-05-24)BugfixesMake pytest.mark.fixture have precedence over pytest.mark.parametrize when updating functions0.7.3 (2018-05-24)FeaturesAdd testdir parameter and allow configuration of all fixture options via parametrization (#62)0.7.2 (2018-05-24)BugfixesFix layout for multi-run samples (#61)0.7.1 (2018-05-23)BugfixesUpdate busybox images for tests (#59)Fix failing test (#58)0.7.0 (2018-05-23)Breaking changesThis is a major update in which the API has changed considerably.
Notably, most of the code for generating fixtures has been removed and
refactored completely. Most importantly, the factory functions have
been replaced by a small number of fixtures that can be configured via
thepytest.markhelper.In addition, most data files have been removed
in an attempt to make the package as small as possible. As the
location of test data has been decoupled from package functionality,
it makes more sense to distribute package data separately.See the API documentation for more information.FeaturesRemove application data (#30)Simplify config.runfmt_alias function (#56)Only package tiny sequence data (#55)Simplify sample layout configuration (#57)0.6.4 (2018-01-31)Add docker-py as a dependency (#52)0.6.3 (2018-01-02)Remove obsolete working directory argument - requires snakemake >=
4.4.0Install correct docker API (#50)Allow modifying path in shell wrapper (#51)0.6.2 (2017-12-19)Add shell wrappers and wrappers for easily setting up workflow tests.Add tutorial.Bugfixes.Update pypi badgeRemove tox.iniDefer setting alias to FixtureFile (#42)ReadFixtureFile.SM now returns id (#39)Options ngs_layout and ngs_runfmt are now lists (#41)Update project layout configuration (#40)Add function to return runfmt and alias as tuple (#43)Read 1 and 2 have same id when alias required (#45)Census is not increased for read 2 (#44)Add option to only setup sampleinfo (#47)Add tutorial (#46)Add working snakemake tests (#8)0.6.1 (2017-11-22)Added some fixes that turned out to be necessary for optional performance.Add fixture that parametrizes over input parameters (#37)Fix bug that returned wrong number of snakemake targets in application output generation (#36)Add travis builds (#35)Fix reference layout error for python 3.5 (#34)Update option defaults (#32)Expose fewer predefined fixtures via plugin (#31)Unify parameter names (#33)0.6.0 (2017-11-21)This is a major revision of the code. Several new abstraction classes
have been introduced to ease interaction with local test files, along
with new factory functions. For backwards compatibility, most factory
functions should work as previously. Documentation has been much
improved.Clarify fixture function naming convention (#29)Expose bulk of factory inner functions (#24)Create separate module for os-related functions (#27)Use separate conda build statements to build for different python versions (#23)0.5.2 (2017-11-16)Add pool fixtures (#22)Add safe_copy function (#21)0.5.1 (2017-10-25)Change name to pytest-ngsfixtures (#20)Add bcftools versions 1.4, 1.4.1, 1.5, 1.6Add bowtie 1.2.1.10.5.0 (2017-09-25)Add star applicationAdd vsearch applicationAdd rseqc applicationAdd snakemake dependencyUpdate docsSeparate qualimap pe and se output (#12)Add mapdamage2 (#11)Fix mapdamage2 missing output (#18)Use realpath to determine download url (#17)Rename download_ngsfixtures_data.py to pytest_ngsfixtures_download_data.pyUpdate versions for samtools0.4.0 (2017-03-28)Add picard output dataAdd functions for dealing with application fixturesMove docs to gh-pagesAdd pytest_ngsfixtures_add_application.py for templating new
applicationsApplication outputs now implemented as dictionaries for
multiple-output applications0.3.1 (2017-03-03)Defer download to script, minor bug fixesAdd application_fixtures to config moduleFix sample_alias bug (#4)Add script download_ngsfixtures_data.py for manual download of data (#5)0.3.0 (2017-03-02)Add application data, pool data, and functions for downloading dataAdd application data for cutadapt, fastqc, qualimap and samtoolsAdd pooled sequencing dataAdd functionality for downloading large data setsImprove make targets for easier releasesMinor bug fixes0.2.0 (2017-02-24)Add new reference files, test files, and factory functions.Use snakemake instead of make to generate data filesAdd separate test file for factory functionsAdd scaffold file with randomly inserted N’sImprove safe_symlinkAdd threads options for running testsAdd Snakefile and rules for generating application filesAdd fileset, filetype factory functions0.1.0 (2017-01-24)First release on PyPI.