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
69 changes: 56 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
name: build_and_test

# Trigger only on pull_request and manual dispatch. The push trigger was
# removed so that opening a PR from a branch in this repo does not run the
# workflow twice (once for the push, once for the pull_request).
on:
pull_request:
workflow_dispatch:
push:
branches:
- build
- imallona

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

# - name: Install dependencies
# run: |
# sudo apt-get update
# sudo apt-get install -y g++ cppcheck python3-pip
# pip3 install "cmake>=4.0"
# cmake --version

- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
Expand All @@ -37,27 +36,27 @@ jobs:
conda install -y conda-build make gxx_linux-64 cmake>=4.0
cmake --version
conda-build --version

- name: Configure CMake
shell: bash -l {0}
run: |
mkdir -p build
cd build
cmake ..

- name: Build
shell: bash -l {0}
run: |
cd build
make -j$(nproc)

- name: Run tests
shell: bash -l {0}
run: |
cd build
ctest --output-on-failure --verbose
# - name: Run cppcheck

# - name: Run cppcheck
# uses: deep5050/cppcheck-action@main
# with:
# skip_preprocessor: disable
Expand Down Expand Up @@ -91,7 +90,7 @@ jobs:

- name: Clean previous build
run: rm -rf build

- name: Build Conda package
shell: bash -l {0}
run: |
Expand All @@ -102,3 +101,47 @@ jobs:
with:
name: fastder-conda
path: /usr/share/miniconda/envs/build-env/conda-bld/linux-64/*.conda

# Second job: build with libBigWig support so the BigWig round-trip and
# equivalence tests in UnitTests.cpp actually run instead of skipping.
# libBigWig is fetched at configure time. Its build needs zlib and libcurl
# headers; we pull them from conda-forge since the project requires
# cmake >= 4.0 which is also only available there on this runner.
build-and-test-libbigwig:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: 3.12
channels: conda-forge,nodefaults
activate-environment: bw-build-env

- name: Install build tools and libBigWig deps
shell: bash -l {0}
run: |
conda install -y make gxx_linux-64 cmake>=4.0 zlib libcurl

- name: Configure CMake with libBigWig
shell: bash -l {0}
run: |
mkdir -p build_bw
cd build_bw
cmake -DFASTDER_USE_LIBBIGWIG=ON ..

- name: Build
shell: bash -l {0}
run: |
cd build_bw
make -j$(nproc)

- name: Run tests (BigWig path active)
shell: bash -l {0}
run: |
cd build_bw
ctest --output-on-failure --verbose
22 changes: 22 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
option(CONDA_BUILD "Building inside conda-build" OFF)
# Build with libBigWig support so Parser::read_bigwig can parse .bw files
# directly. Off by default to keep the build hermetic; turning it on requires
# libBigWig and its transitive deps (libcurl, zlib) to be available.
option(FASTDER_USE_LIBBIGWIG "Build with libBigWig support for direct .bw reading" OFF)

cmake_minimum_required(VERSION 4.0)
project(fastder)
Expand Down Expand Up @@ -26,6 +30,24 @@ add_executable(fastder
)
target_link_libraries(fastder PRIVATE fastder_lib Threads::Threads)

if(FASTDER_USE_LIBBIGWIG)
# libBigWig ships its own CMakeLists and exports a static target called
# BigWig along with the headers under its source directory. Pull it in,
# link against the target, and add the source dir to our include path so
# the <bigWig.h> include in Parser.cpp resolves.
include(FetchContent)
FetchContent_Declare(
libBigWig_src
GIT_REPOSITORY https://github.com/dpryan79/libBigWig.git
GIT_TAG 0.4.7
)
FetchContent_MakeAvailable(libBigWig_src)

target_link_libraries(fastder_lib PRIVATE BigWig)
target_include_directories(fastder_lib PRIVATE ${libbigwig_src_SOURCE_DIR})
target_compile_definitions(fastder_lib PRIVATE FASTDER_USE_LIBBIGWIG)
endif()

enable_testing()

if(NOT CONDA_BUILD)
Expand Down
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,32 @@
It is intended to build on the `recount3` [resource](https://rna.recount.bio/), which consists of over 750'000 uniformly processed RNA-seq samples across different mouse and human studies.
The tool aims to reconstruct expressed genes prior to splicing in an annotation-agnostic approach.

`fastder` takes genome-wide coverage bigWig files and splice junction coordinates as an input. The tool averages across samples and performs thresholding to identify
consecutive regions with above-threshold expression. Following this, `fastder` attempts to stitch together expressed regions (ERs)
by searching for splice junction coordinates that overlap with the start and end position of these expressed regions.
`fastder` takes genome-wide coverage files and splice junction coordinates as input. Coverage can be supplied as BedGraph by default, or as BigWig when the build was configured with `-DFASTDER_USE_LIBBIGWIG=ON`. The tool averages across samples and applies a coverage threshold to identify consecutive regions with above-threshold expression. It then stitches expressed regions (ERs) together when a splice junction in the input matches the end of one ER and the start of the next.

Coverage is held in memory as a sparse list of intervals rather than a dense per-base vector. On chr21 this keeps the resident set in the low hundreds of MB instead of multiple GB at full hg38. The strand of each splice junction is read into the in-memory model but is not yet used by the stitching step; strand-aware stitching is planned and the data structures already carry the field.


## Building

The default build needs cmake (4.0 or newer) and a C++20 compiler:

```
mkdir build
cd build
cmake ..
make -j
```

To read BigWig coverage directly instead of converting to BedGraph first,
configure with `-DFASTDER_USE_LIBBIGWIG=ON`. CMake will fetch libBigWig from
GitHub at configure time. zlib and libcurl headers must be available.

```
cmake -DFASTDER_USE_LIBBIGWIG=ON ..
```

The unit tests run with `ctest` from the build directory. Two tests are gated
on the libBigWig option and are skipped in the default build.

## Installation

Expand Down
Loading
Loading