Skip to content

Commit

Permalink
Merge pull request #14 from cokelaer/main
Browse files Browse the repository at this point in the history
switch to pyproject
  • Loading branch information
cokelaer committed Nov 30, 2023
2 parents 863bc61 + 03486be commit 666f61e
Show file tree
Hide file tree
Showing 15 changed files with 404 additions and 291 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@main
- name: Set up Python 3.7
uses: actions/setup-python@v1
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.8

- name: Install package
- name: Install package
run: |
pip install build
pip install build poetry
- name: Build source tarball
run: |
rm -rf dist;
python setup.py sdist
poetry build
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ Changelog
========= =======================================================================
Version Description
========= =======================================================================
1.5.0 * Uses click and new sequana_pipetools, add multiqc
1.4.0 * Implement demultiplexing of single cell ATAC seq data with
cellranger.
1.3.1 * use sequana_wrappers version in the config file
Expand Down
52 changes: 52 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "sequana-demultiplex"
version = "1.5.0"
description = "Pipeline that runs bcl2fastq and ease demultiplexing of Sequencing data"
authors = ["Sequana Team"]
license = "BSD-3"
repository = "https://github.com/sequana/demultiplex"
readme = "README.rst"
keywords = ["bcl2fastq", "Illumina", "sequana", "base caller", "demultiplexing"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Education",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Information Analysis",
]

packages = [
{include = "sequana_pipelines"}
]


[tool.poetry.dependencies]
python = ">=3.8,<4.0"
sequana = ">=0.15.0"
sequana_pipetools = ">=0.16.1"
click-completion = "^0.5.2"


[tool.poetry.scripts]
sequana_demultiplex = "sequana_pipelines.demultiplex.main:main"


[tool.poetry.group.dev.dependencies]
black = "^23.7.0"
pytest = "^7.4.0"
mock = "^5.1.0"
pytest-mock = "^3.11.1"
pytest-cov = "^4.1.0"

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sequana
sequana_pipetools>=0.12.5
sequana_pipetools>=0.16
21 changes: 20 additions & 1 deletion sequana_pipelines/demultiplex/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#
##############################################################################

sequana_wrappers: "v0.15.1"
sequana_wrappers: "v23.11.18"

#################################################################
# general
Expand All @@ -34,6 +34,7 @@ general:
apptainers:
graphviz: "https://zenodo.org/record/7928262/files/graphviz_7.0.5.img"
cellranger_atac: "https://zenodo.org/record/8423332/files/cellranger_atac_2.1.0.img"
multiqc: https://zenodo.org/record/10205070/files/multiqc_1.16.0.img

###################################################################################
# bcl2fastq
Expand Down Expand Up @@ -62,3 +63,21 @@ cellranger_atac:
options: ''
resources:
mem: 64G

#############################################################################
## MultiQC aggregates results from bioinformatics analyses across many
## samples into a single report.
##
## :Parameters:
##
## - options: any options recognised by multiqc
## - config_file: by default, we use sequana RNA-seq multiqc_config file.
## If you want your own multiqc, fill this entry
multiqc:
options: -p -f
modules: bcl2fastq
input_directory: .
config_file: multiqc_config.yaml
resources:
mem: 8G

57 changes: 42 additions & 15 deletions sequana_pipelines/demultiplex/demultiplex.rules
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ rule pipeline:
"barcodes.png",
"samples.png",
"summary.png",
"multiqc/multiqc_report.html",
".sequana/rulegraph.svg",


Expand Down Expand Up @@ -155,6 +156,34 @@ rule plot_summary:
s.to_summary_reads(output.summary)



# ========================================================== multiqc
multiqc_params_options = config['multiqc']['options']
if manager.config.multiqc.config_file:
multiqc_params_options += f" -c {manager.config.multiqc.config_file}"

rule multiqc:
input:
"Stats/Stats.json",
"Stats/summary.txt",
output:
"multiqc/multiqc_report.html"
params:
options=multiqc_params_options,
input_directory=config['multiqc']['input_directory'],
config_file=config['multiqc']['config_file'],
modules=config['multiqc']['modules']
log:
"multiqc/multiqc.log"
resources:
**config["multiqc"]["resources"]
container:
config["apptainers"]["multiqc"]
wrapper:
f"{manager.wrappers}/wrappers/multiqc"



rule rulegraph:
input:
workflow.snakefile
Expand Down Expand Up @@ -183,18 +212,22 @@ localrules: rulegraph

onsuccess:
shell("chmod -R g+w .")

from sequana_pipelines import demultiplex
from sequana.modules_report.summary import SequanaReport

manager.teardown(extra_dirs_to_remove=["_Temp"])
manager.clean_multiqc(rules.multiqc.output[0])

from sequana.modules_report.summary import SummaryModule2

image1 = SummaryModule2.png_to_embedded_png("dummy", "barcodes.png",
image1 = SequanaReport.png_to_embedded_png("dummy", "barcodes.png",
style="text-align:center; width:60%; height:40%",
alt="barcodes")

image2 = SummaryModule2.png_to_embedded_png("dummy", "summary.png",
image2 = SequanaReport.png_to_embedded_png("dummy", "summary.png",
style="width:60%; height:40%", alt="summary")

image3 = SummaryModule2.png_to_embedded_png("dummy", "samples.png",
image3 = SequanaReport.png_to_embedded_png("dummy", "samples.png",
style="width:60%; height:40%", alt="sample")


Expand All @@ -218,17 +251,11 @@ The following image is similar. Instead of showing the index, we show here the n

</div>""".format(image1, image2, image3)

from sequana_pipelines import demultiplex
data = {
"name": manager.name,
"stats": "stats.txt",
"rulegraph": ".sequana/rulegraph.svg",
"pipeline_version": demultiplex.version
}
s = SummaryModule2(data, intro=intro)

data = manager.getmetadata()
s = SequanaReport(data, intro=intro)


onerror:
from sequana_pipetools.errors import PipeError
p = PipeError("demultiplex")
p.status()
manager.onerror()

Loading

0 comments on commit 666f61e

Please sign in to comment.