Skip to content

Commit

Permalink
Merge pull request #5 from cokelaer/main
Browse files Browse the repository at this point in the history
Uses click and pyproject
  • Loading branch information
cokelaer authored Dec 20, 2023
2 parents e3ba837 + d88e5e3 commit f5da6cb
Show file tree
Hide file tree
Showing 14 changed files with 213 additions and 224 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ on:
branches:
- main
- dev
workflow_dispatch:
pull_request:
branches-ignore: []
schedule:
- cron: '0 0 * * SUN'
- cron: '0 0 30 * *'

jobs:
build-linux:
Expand All @@ -29,33 +30,33 @@ jobs:
- name: checkout git repo
uses: actions/checkout@v2

- name: Set up Python 3.X
uses: actions/setup-python@v2
- name: conda/mamba
uses: mamba-org/setup-micromamba@v1
with:
python-version: ${{ matrix.python }}
micromamba-version: '1.3.1-0'
environment-file: environment.yml
create-args: |
python=${{ matrix.python }}
cache-environment: true
cache-downloads: true

- name: Add conda to system path
- name: install package itself
shell: bash -el {0}
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
pip install .
- name: conda
run: |
conda install -c conda-forge -c bioconda --quiet -y python=${{ matrix.python }}
conda install -c conda-forge -y ncurses
- name: Install dependencies
shell: bash -el {0}
run: |
pip install coveralls pytest-cov pytest pytest-xdist
- name: install package itself
run: |
pip install .
- name: testing
shell: bash -el {0}
run: |
pytest -v --cov-report term-missing --cov=sequana_pipelines.downsampling
- name: coveralls
shell: bash -l {0}
run: |
echo $COVERALLS_REPO_TOKEN
coveralls --service=github
Expand Down
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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

7 changes: 0 additions & 7 deletions MANIFEST.in

This file was deleted.

13 changes: 13 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: sequana_downsampling

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

dependencies:
- pigz
- pip:
- sequana

55 changes: 55 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "sequana-downsampling"
version = "0.10.0"
description = "tandem repeat finder pipeline"
authors = ["Sequana Team"]
license = "BSD-3"
repository = "https://github.com/sequana/downsampling"
readme = "README.rst"
keywords = ["snakemake", "NGS", "sequana", "fastq", "downsampling"]
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.16.4"
sequana_pipetools = ">=0.16.6"
click-completion = "^0.5.2"
click = "^8.1.7"
rich-click = "^1.7.2"



[tool.poetry.scripts]
sequana_downsampling = "sequana_pipelines.downsampling.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: 0 additions & 2 deletions requirements.txt

This file was deleted.

7 changes: 1 addition & 6 deletions sequana_pipelines/downsampling/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
# use it, otherwise use input_samples.
# ============================================================================


input_directory: '.'
input_pattern: '*.fastq.gz'
input_readtag: "_R[12]_"
#input_readtag: "_R[12]_"


##############################################################################
Expand All @@ -32,7 +31,3 @@ downsampling:
input_format: fastq


##############################################################################
#
#onsuccess:
# toclean: " slurm*out downsampling.rules config.yaml stats.txt "
6 changes: 1 addition & 5 deletions sequana_pipelines/downsampling/downsampling.rules
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ snakemake -s downsampling.rules --forceall --stats stats.txt --cores 4
"""
from sequana_pipetools import PipelineManager

from sequana import sequana_data

# This must be defined before the include
configfile: "config.yaml"
Expand All @@ -24,13 +23,10 @@ else:





rule pipeline:
input: expand("output/{sample}.done", sample=manager.samples)



if config["downsampling"]['input_format'] == "fastq":
rule downsampling:
input: manager.getrawdata()
Expand Down Expand Up @@ -91,4 +87,4 @@ onsuccess:
shell("mv output/* . && rm -rf output")

onerror:
print("An error occurred. See message above.")
manager.onerror()
Loading

0 comments on commit f5da6cb

Please sign in to comment.