DSaaP-examples-FS26-workflow

GC Content of Sequences

This example contains a small Python package and CLI to calculate GC content from sequences in a FASTA file.

The more important part of this repository are the GitHub Actions.

The CI (continuous integration) workflows showcase automated formatting, linting, testing, doctests, and coverage reporting.

The CD (continuous delivery/deployment) workflows showcase package upload to TestPyPI, which works analogously to PyPI, and generating platform-dependent binaries, which are uploaded to GitHub as release artifacts.

Licence CI codecov Release

GitHub Actions

The workflows in .github/workflows/ show how the project is validated automatically on pushes and pull requests to main and how releases are published on tag creation.

Together, these workflows enforce code style, static analysis, test execution, doctest validation, coverage reporting, and allow package publishing and binary distribution.

To verify a downloaded binary:

sha256sum -c gc-content-linux.sha256

Setup

To run these examples locally, you need Python 3 installed and a clone of the DSaaP examples (workflow) repository.

This project is configured with pyproject.toml, which is the source of truth for package metadata and dependencies.

You can use a virtual environment to install the package and its development dependencies:

# Clone the repository if you haven't already
git clone git@github.com:acg-team/DSaaP-examples-FS26-workflow.git
cd DSaaP-examples-FS26-workflow

# Create and activate virtual environment
python3 -m venv gcc_venv
source gcc_venv/bin/activate

# Install the package
pip install .

# Install test tooling as defined in pyproject.toml
pip install .[test]

# Install development tooling (black, pylint)
pip install .[dev]

If you only want to use the CLI without the test tools, installing . is enough.

Alternatively, you can install the package system-wide:

pip install .

Or install the latest published version from TestPyPI:

pip install -i https://test.pypi.org/simple/ gc-content-DSaaP-FS26

Running the Script

After installation, you can run the command-line entry point on a FASTA file of your choosing:

gc-content /path/to/fasta/file

You can also run the module file directly:

python gc_content/gc_content.py /path/to/fasta/file

To run the example FASTA file:

gc-content data/DNA_example.fasta

The output of the script is the GC content for each sequence in the input file.

Testing

The project uses pytest, with test dependencies defined in pyproject.toml under the optional test extra.

To run unit tests:

pytest test

To run unit tests together with doctests:

pytest --doctest-modules

Test Coverage

To run unit tests with coverage and generate an HTML report:

pytest --cov gc_content --cov-report=xml --cov-report=html

To view the coverage report in your browser:

open htmlcov/index.html

Data

The data/ folder contains an example fasta file with DNA sequences.

Authors

Jūlija Pečerska, Applied Computational Genomics Team.

Developing Software as a Product (DSaaP) course, Spring semester 2026 (FS26).

Licence

This project is licensed under the MIT Licence – see the LICENSE file for details.