Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 46 additions & 11 deletions .github/workflows/apptainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- dev
workflow_dispatch:
pull_request:
branches-ignore: []
schedule:
Expand All @@ -21,35 +22,69 @@ jobs:

steps:

- name: precleanup
# Clean up unnecessary preinstalled packages to free disk space
- name: Pre-cleanup
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"

- name: install graphviz
# Cache APT .deb packages
- name: Cache APT archives
uses: actions/cache@v3
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-cache-v1

# Cache Apptainer installation
- name: Cache Apptainer install
id: cache-apptainer
uses: actions/cache@v3
with:
path: |
/usr/bin/apptainer
/usr/lib/apptainer
/etc/apptainer
key: ${{ runner.os }}-apptainer-v1

# Install Apptainer only if not cached
- name: Install Apptainer
if: steps.cache-apptainer.outputs.cache-hit != 'true'
run: |
sudo apt update
sudo apt-get install -y graphviz software-properties-common
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:apptainer/ppa
sudo apt update
sudo apt install -y apptainer
sudo apt-get update
sudo apt-get install -y apptainer

# Cache Apptainer image cache (~/.apptainer/cache)
- name: Cache Apptainer images
uses: actions/cache@v3
with:
path: ~/.apptainer/cache
key: ${{ runner.os }}-apptainer-images-v1

- name: checkout git repo
# Checkout repository
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up Python 3.X
# Set up Python
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

# Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "snakemake>=8" .[testing]

- name: install package itself
# Install package
- name: Install package itself
run: |
pip install .

- name: testing
# Run tests using Apptainer
- name: Run Apptainer tests
run: |
sequana_chipseq --design-file test/data/design.csv --input-directory test/data/ --apptainer-prefix ~/images --genome-directory test/data/ecoli_MG1655 && cd chipseq && bash chipseq.sh
sequana_chipseq --design-file test/data/design.csv --input-directory test/data/ --use-apptainer --apptainer-prefix ~/.apptainer/cache --genome-directory test/data/ecoli_MG1655 && cd chipseq && bash chipseq.sh
22 changes: 10 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,55 @@ on:
pull_request:
branches-ignore: []
schedule:
- cron: '0 0 21 * *'
- cron: '0 0 2 * *'

jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python: ['3.10', '3.11', '3.12']
python: ['3.11', '3.12']
fail-fast: false


steps:

- name: install graphviz
run: |
sudo apt-get update -qq
sudo apt-get install -y graphviz
sudo apt-get install libopenblas-dev # for scipy

- name: checkout git repo
uses: actions/checkout@v4

- name: conda/mamba
uses: mamba-org/setup-micromamba@v1
uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: '1.3.1-0'
environment-file: environment.yml
create-args: |
generate-run-shell: true
create-args: >-
python=${{ matrix.python }}
cache-environment: true
cache-downloads: true

- name: install package itself
shell: bash -el {0}
shell: micromamba-shell {0}
run: |
pip install .


- name: Install dependencies
shell: bash -el {0}
shell: micromamba-shell {0}
run: |
pip install coveralls pytest-cov pytest pytest-xdist

- name: testing
shell: bash -el {0}
shell: micromamba-shell {0}
run: |
pytest -v --cov-report term-missing --cov=sequana_pipelines.chipseq

- name: coveralls
continue-on-error: true
shell: bash -l {0}
shell: micromamba-shell {0}
run: |
echo $COVERALLS_REPO_TOKEN
coveralls --service=github
Expand Down
27 changes: 15 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

.. image:: https://badge.fury.io/py/sequana-chipseq.svg
:target: https://pypi.python.org/pypi/sequana_chipseq
:target: https://pypi.python.org/pypi/sequana-chipseq

.. image:: https://github.com/sequana/chipseq/actions/workflows/main.yml/badge.svg
:target: https://github.com/sequana/chipseq/actions/workflows/main.yml
:target: https://github.com/sequana/chipseq/actions/workflows

.. image:: https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue.svg
:target: https://pypi.python.org/pypi/sequana
:target: https://pypi.python.org/pypi/sequana-chipseq
:alt: Python 3.10 | 3.11 | 3.12

.. image:: http://joss.theoj.org/papers/10.21105/joss.00352/status.svg
:target: http://joss.theoj.org/papers/10.21105/joss.00352
.. image:: https://joss.theoj.org/papers/10.21105/joss.00352/status.svg
:target: https://joss.theoj.org/papers/10.21105/joss.00352
:alt: JOSS (journal of open source software) DOI

This is the **chipseq** pipeline from the `Sequana <https://sequana.readthedocs.org>`_ project.
Expand Down Expand Up @@ -75,7 +75,7 @@ Example::
**4. Run the pipeline**::

cd chipseq
sh chipseq.sh
bash chipseq.sh


Usage
Expand Down Expand Up @@ -126,16 +126,12 @@ Run every tool inside pre-built containers — no local tool installation needed
--input-directory DATAPATH \
--genome-directory /path/to/genome \
--design-file design.csv \
--use-apptainer

Store images in a shared location to avoid re-downloading::

sequana_chipseq ... --use-apptainer --apptainer-prefix ~/.sequana/apptainers
--apptainer-prefix ~/.sequana/apptainers

Then run as usual::

cd chipseq
sh chipseq.sh
bash chipseq.sh


Requirements
Expand Down Expand Up @@ -206,6 +202,13 @@ Changelog
========= ====================================================================
Version Description
========= ====================================================================
0.13.0 * Migrate to standard importlib.metadata version pattern
* Remove click_completion dependency
* Add snakemake, pulp dependencies to pyproject.toml
* Add dot2svg to localrules
* Fix CI: use generate-run-shell and micromamba-shell
* Update environment.yml: add graphviz, pulp, sequana_pipetools
* Fix README badges and apptainer usage
0.12.0 * Fix ``macs3``, ``self_pseudo_replicate_peaks``, and
``pseudo_replicate_peaks`` rules: macs3 exits non-zero on sparse
CI data; added ``|| true`` + conditional ``touch`` so the pipeline
Expand Down
11 changes: 5 additions & 6 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: sequana_chipseq

channels:
- conda-forge
- bioconda
- defaults
- r

dependencies:
- samtools>1.7
- bamtools
Expand All @@ -20,8 +17,10 @@ dependencies:
- homer
- macs3
- multiqc
- graphviz
- snakemake-minimal
- pulp>=2.8
- pip:
- sequana
- sequana-wrappers>=26.3.21

- sequana>=0.21.0
- sequana_pipetools>=1.5.3
- sequana-wrappers>=26.4.1
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "sequana-chipseq"
version = "0.12.0"
version = "0.13.0"
description = "A ChIP-seq pipeline from raw reads to peaks"
authors = ["Sequana Team"]
license = "BSD-3"
Expand Down Expand Up @@ -36,9 +36,10 @@ packages = [
python = ">=3.10,<4.0"
sequana = ">=0.21.0"
sequana_pipetools = ">=1.5.3"
sequana_wrappers = ">=26.3.21"
click-completion = "^0.5.2"
sequana-wrappers = ">=26.4.1"
idrix = ">=2.1.0"
snakemake = ">=7.32"
pulp = ">=2.8"


[tool.poetry.scripts]
Expand Down
7 changes: 2 additions & 5 deletions sequana_pipelines/chipseq/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from importlib.metadata import PackageNotFoundError, version
import importlib.metadata

try:
version = version("sequana-chipseq")
except PackageNotFoundError:
version = "unknown"
version = importlib.metadata.version("sequana-chipseq")
Loading
Loading