Skip to content

Commit

Permalink
Improved tests and removed snakemake pipelines (#30)
Browse files Browse the repository at this point in the history
* start making the new wipertools repo

* moving devcontainer files together in the sample directory

* settling devcontainer ffiles

* improve functionalities and fix versions

* handling compressed fastq in scatter

* improved implementation of gather and scatter

* improved summary gather implementation

* expanded pytests

* fixing github actions

* fixed pytest action

* fixing pytests

* fixing pytest

* improved code coverage
  • Loading branch information
mazzalab authored Nov 17, 2024
1 parent 8123253 commit c3e1633
Show file tree
Hide file tree
Showing 36 changed files with 1,720 additions and 941 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ omit = __init__.py

[report]
exclude_also =
def wipe_fastq
if __name__ == .__main__.:
10 changes: 10 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM condaforge/mambaforge
LABEL maintainer="[email protected]"

COPY data data
COPY ./.devcontainer/environment.yml environment.yml

RUN mamba env update --file environment.yml --name base
RUN git config --global core.autocrlf true

WORKDIR /fastqwiper
File renamed without changes.
40 changes: 21 additions & 19 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Existing Dockerfile",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile"
},
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/git:1": {}
},
"customizations" : {
"jetbrains" : {
"backend" : "PyCharm"
}
},
workspaceFolder: "/fastqwiper",
workspaceMount: "source=${localWorkspaceFolder},target=/fastqwiper,type=bind"
}
"name": "Dockerfile FastqWiper@BFX",
"build": {
"context": "..",
"dockerfile": "Dockerfile"
},
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/git:1": {}
},
"workspaceFolder": "/fastqwiper",
"workspaceMount": "source=${localWorkspaceFolder},target=/fastqwiper,type=bind",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.debugpy",
"ms-azuretools.vscode-docker"
]
}
}
}
11 changes: 11 additions & 0 deletions .devcontainer/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- python
- pytest
- pytest-cov
- conda-build
- bioconda-utils
- pyyaml
3 changes: 0 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.snakemake
.vscode
.gitignore
.devcontainer
.github
.pytest_cache
.coveragerc
Expand All @@ -10,6 +9,4 @@ __pycache__

environment.yml
requirements.txt
setup.py
conda-recipe/
logs/
53 changes: 26 additions & 27 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,39 @@ jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] # , macos-latest, windows-latest
matrix:
os: [ubuntu-latest] # , macos-latest, windows-latest

env:
OS: ${{ matrix.os }}
PYTHON: '3.11'
OS: ${{ matrix.os }}
PYTHON: "3.10"

name: Test FastqWiper
steps:
- uses: actions/checkout@v4
name: Clone repository
- name: Install Miniconda (Mambaforge)
uses: conda-incubator/setup-miniconda@v3
with:
- uses: actions/checkout@v4
name: Clone repository

- name: Install Miniconda (Mambaforge)
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
auto-activate-base: true
show-channel-urls: true
channels: conda-forge,defaults
channels: conda-forge,bioconda,defaults
python-version: ${{ env.PYTHON }}
environment-file: environment.yml
miniforge-variant: Mambaforge

- name: Run tests and collect coverage
shell: bash -el {0}
run: pytest --pyargs ./tests --cov-config=.coveragerc --cov=./fastqwiper --cov-report=xml
environment-file: .devcontainer/environment.yml

- name: Run tests and collect coverage
shell: bash -el {0}
run: pytest --pyargs ./tests --cov-config=.coveragerc --cov=./fastqwiper --cov-report=xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
files: ./coverage.xml # optional
flags: pytest # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
files: ./coverage.xml # optional
flags: pytest # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
19 changes: 3 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#my custom
bbmap/
logs/
bbmap
data/*
!data/sample_R1.fastq.gz
!data/sample_R2.fastq.gz

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down Expand Up @@ -63,19 +63,6 @@ coverage.xml
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

Expand Down
85 changes: 85 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debugger: summarygather",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolderBasename}/wipertools.py",
"console": "integratedTerminal",
"args": [
"summarygather",
"--summaries",
"data/abba_full_wiped.fastq.log",
"data/abba_full_wiped.fastq2.log",
"--final_summary",
"data/abba_full_wiped.fastq.summary",
]
},
{
"name": "Debugger: fastqwiper",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolderBasename}/wipertools.py",
"console": "integratedTerminal",
"args": [
"fastqwiper",
"--fastq_in",
"data/abba_full.fastq",
"--fastq_out",
"data/abba_full_wiped.fastq",
"-f",
"10",
"-l",
"data/abba_full_wiped.fastq.log",
"-a",
"TCGAN"
]
},
{
"name": "Debugger: fastqscatter",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolderBasename}/wipertools.py",
"console": "integratedTerminal",
"args": [
"fastqscatter",
"--fastq",
"data/sample_R1.fastq.gz",
"--num_splits",
"3",
"--out_folder",
"./data/splits_unix",
"--prefix",
"ff",
"--suffix",
"rr",
"--ext",
"fastq",
"--os",
"unix"
]
},
{
"name": "Debugger: fastqgather",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolderBasename}/wipertools.py",
"console": "integratedTerminal",
"args": [
"fastqgather",
"--in_folder",
"data/splits_unix",
"--out_fastq",
"data/gathered_unix.fastq",
"--prefix",
"ff",
"--os",
"unix"
]
}
]
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"python.analysis.autoImportCompletions": true,
"python.analysis.typeCheckingMode": "basic"
}
40 changes: 0 additions & 40 deletions Dockerfile

This file was deleted.

Loading

0 comments on commit c3e1633

Please sign in to comment.