diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..6707eac --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,33 @@ + +files: '\.(py|rst|sh)$' +fail_fast: false + +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + #- id: check-executables-have-shebangs + - id: check-ast + +- repo: https://github.com/pycqa/flake8 + rev: 6.1.0 + hooks: + - id: flake8 + args: ["-j8", "--ignore=E203,E501,W503,E722", "--max-line-length=120", "--exit-zero"] + +- repo: https://github.com/psf/black + rev: 22.10.0 + hooks: + - id: black + args: ["--line-length=120"] + exclude: E501 + +- repo: https://github.com/pycqa/isort + rev: 5.12.0 + hooks: + - id: isort + args: ["--profile", "black"] # solves conflicts between black and isort + diff --git a/README.rst b/README.rst index 722298d..bb58736 100644 --- a/README.rst +++ b/README.rst @@ -99,14 +99,14 @@ Details .. image:: https://raw.githubusercontent.com/sequana/demultiplex/master/sequana_pipelines/demultiplex/dag.png This pipeline runs bcl2fastq 2.20 and creates a set of diagnostics plots to help -deciphering common issues such as missing index and sample sheet errors. +deciphering common issues such as missing index and sample sheet errors. Rules and configuration details ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the `latest documented configuration file `_ -to be used with the pipeline. Each rule used in the pipeline may have a section in the configuration file. +to be used with the pipeline. Each rule used in the pipeline may have a section in the configuration file. @@ -116,8 +116,9 @@ Changelog ========= ======================================================================= Version Description ========= ======================================================================= +1.5.1 * swictch working directory to fastq instead of demultiplex(regression) 1.5.0 * Uses click and new sequana_pipetools, add multiqc -1.4.0 * Implement demultiplexing of single cell ATAC seq data with +1.4.0 * Implement demultiplexing of single cell ATAC seq data with cellranger. 1.3.1 * use sequana_wrappers version in the config file 1.3.0 * use latest sequana-wrappers to benefit and graphivz apptainer @@ -129,8 +130,8 @@ Version Description 1.1.0 * Uses new sequana-wrappers repository 1.0.5 * Fix regression bug to cope with new snakemake API * Compatibility with sequanix GUI -1.0.4 * Better HTML report with updated images. - * validate the SampleSheet when using sequana_demultiplex and/or the +1.0.4 * Better HTML report with updated images. + * validate the SampleSheet when using sequana_demultiplex and/or the pipeline * Add error handler from sequana_pipetools * save all undetermined barcodes (not just first 20) @@ -139,7 +140,7 @@ Version Description it can be used in Sequanix 1.0.3 * remove check_samplesheet and fix_samplesheet modules now in sequana * check sample sheet but do not fail. Instead, informing users that - there is an error and suggest to use 'sequana samplesheet + there is an error and suggest to use 'sequana samplesheet --quick-fix' 1.0.2 Use 'sequana samplesheet --check ' command instead of deprecated sequana_check_sample_sheet command @@ -152,40 +153,40 @@ Version Description * The --ignore-missing-bcls option is changed into --no-ignore-missing-bcls so as to ignore missing bcls by default keep this option as a flag and keep same behaviour - * Fix HTML syntax + * Fix HTML syntax 1.0.0 * stable version pinned on sequana libraries -0.9.11 * fix label in plot_summary, +0.9.11 * fix label in plot_summary, * add new plot to show reads per sample + undetermined - * add two tools one to check the samplesheet called - sequana_sample_sheet and one called sequana_fix_samplesheet. The + * add two tools one to check the samplesheet called + sequana_sample_sheet and one called sequana_fix_samplesheet. The former is now inside the pipeline as well and when creating the pipeline * set --write_reverse_complement to False by default * remove the --ignore-missing-control which is deprecated anyway 0.9.10 * implement the new option --from-project, add missing MANIFEST -0.9.9 * simplification of the pipeline to use sequana 0.8.4 to speed up +0.9.9 * simplification of the pipeline to use sequana 0.8.4 to speed up the --help calls. - * include a summary HTML report + * include a summary HTML report 0.9.8 * fix typos 0.9.7 * Use new release of sequana_pipetools * set matplotlib backend to agg * include a simple HTML report 0.9.6 * Handle different RunParameter.xml name (NextSeq vs HiSeq) -0.9.5 * Fix a regression bug due to new sequana release. We do not check +0.9.5 * Fix a regression bug due to new sequana release. We do not check the input file (fastq) since this is not a sequence analysis pipeline * Check whether it is a NextSeq run. If so, merging-strategy must be set to 'merge'. Can be bypassed using --force -0.9.4 * Check the presence of the bcl input directory and samplesheet. - * More help in the --help message. +0.9.4 * Check the presence of the bcl input directory and samplesheet. + * More help in the --help message. * add --sample-sheet option to replace --samplesheet option * Fix the schema file * Check for presence of RunParameters.xml and provide information if merging-stratgy is set to None whereas it is a NextSeq run 0.9.3 Fix regression bug -0.9.2 remove warning due to relative paths. -0.9.1 Make the merging options compulsory. Users must tell whether they - want to merge the lanes or not. This avoid to do the merging or not +0.9.2 remove warning due to relative paths. +0.9.1 Make the merging options compulsory. Users must tell whether they + want to merge the lanes or not. This avoid to do the merging or not whereas the inverse was expected. 0.8.6 Uses 64G/biomics queue and 16 cores on a SLURM scheduler ========= ======================================================================= @@ -195,7 +196,6 @@ Version Description Contribute & Code of Conduct ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -To contribute to this project, please take a look at the -`Contributing Guidelines `_ first. Please note that this project is released with a +To contribute to this project, please take a look at the +`Contributing Guidelines `_ first. Please note that this project is released with a `Code of Conduct `_. By contributing to this project, you agree to abide by its terms. - diff --git a/pyproject.toml b/pyproject.toml index 17763e0..ef5be85 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "sequana-demultiplex" -version = "1.5.0" +version = "1.5.1" description = "Pipeline that runs bcl2fastq and ease demultiplexing of Sequencing data" authors = ["Sequana Team"] license = "BSD-3" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index c040454..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -sequana -sequana_pipetools>=0.16 diff --git a/sequana_pipelines/demultiplex/main.py b/sequana_pipelines/demultiplex/main.py index d1a609c..0e6a588 100755 --- a/sequana_pipelines/demultiplex/main.py +++ b/sequana_pipelines/demultiplex/main.py @@ -10,18 +10,18 @@ # documentation: http://sequana.readthedocs.io # ############################################################################## -import sys import os +import sys -import rich_click as click import click_completion +import rich_click as click click_completion.init() NAME = "demultiplex" -from sequana_pipetools.options import * from sequana_pipetools import SequanaManager +from sequana_pipetools.options import * help = init_click( NAME, @@ -32,7 +32,7 @@ @click.command(context_settings=help) -@include_options_from(ClickSnakemakeOptions, working_directory=NAME) +@include_options_from(ClickSnakemakeOptions, working_directory="fastq") @include_options_from(ClickSlurmOptions) @include_options_from(ClickInputOptions, add_input_readtag=False) @include_options_from(ClickGeneralOptions) @@ -96,7 +96,7 @@ default=False, is_flag=True, show_default=True, - help="""Set options to--minimum-trimmed-read-length 15 --mask-short-adapter-reads 15 + help="""Set options to--minimum-trimmed-read-length 15 --mask-short-adapter-reads 15 and do not merge lanes""", ) @click.option( @@ -190,7 +190,7 @@ def main(**options): logger.critical(err) logger.critical( """Your sample sheet seems to be incorrect. Before running the pipeline you will have to fix it. You may use 'sequana samplesheet --quick-fix'""" - ) + ) # finalise the command and save it; copy the snakemake. update the config # file and save it.