Skip to content

Support RleList genomic tracks for compartment eigenvector phasing#18

Merged
js2264 merged 8 commits into
develfrom
copilot/support-genomic-track-phase-compartments
Apr 19, 2026
Merged

Support RleList genomic tracks for compartment eigenvector phasing#18
js2264 merged 8 commits into
develfrom
copilot/support-genomic-track-phase-compartments

Conversation

Copilot AI commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

getCompartments() already supported phasing with sequence/gene-derived inputs, but not with coverage-style genomic tracks. This PR adds support for BigWig-imported tracks provided as RleList, so compartment sign phasing can use arbitrary per-base signal tracks (e.g. GC coverage tracks).

  • Core fix: RleList phasing path

    • In .eigChr(), the RleList branch now correctly uses the provided track as the coverage source before computing per-bin means.
    • This resolves the broken code path where the coverage object was referenced but never initialized.
  • API/docs alignment

    • Updated getCompartments() parameter docs to explicitly list supported genome input types: BSgenome, DNAStringSet, TxDb, and RleList.
    • Synced generated Rd docs with the updated contract.
  • Focused test coverage

    • Added a test that builds an RleList track and runs:
      • getCompartments(full_contacts_yeast, genome = cov_track, chromosomes = "VI")
    • Verifies the RleList phasing route executes without error for a chromosome-scoped run.
cov_track <- IRanges::RleList(
  VI = IRanges::Rle(seq_len(max(GenomicRanges::end(VI_regions))))
)

comps <- getCompartments(
  full_contacts_yeast,
  genome = cov_track,
  chromosomes = "VI"
)

Copilot AI linked an issue Apr 18, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add support for genomic track to phase compartments Support RleList genomic tracks for compartment eigenvector phasing Apr 18, 2026
Copilot AI requested a review from js2264 April 18, 2026 14:07
@js2264

js2264 commented Apr 18, 2026

Copy link
Copy Markdown
Owner

In the test for phasing with coverage track, use a coverage track of GC content (calculated from the yeast genomic sequence, and smoothed along chromosomes with a bon width of 100)

test_that("compartments can be phased with an RleList track", {
full_contacts_yeast <- HiCExperiment::contacts_yeast(full = TRUE)
full_contacts_yeast_VI <- full_contacts_yeast["VI"]
VI_regions <- HiCExperiment::regions(full_contacts_yeast_VI)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot In the test for phasing with coverage track, use a coverage track of GC content (calculated from the yeast genomic sequence, and smoothed along chromosomes with a bon width of 100). Also, IRanges::Rle() does not exist

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in commit cfe7482 (plus cleanup 06a8417): the test now uses GC-content coverage from yeast sequence with 100-bin smoothing, and replaces IRanges::Rle() with S4Vectors::Rle() inside an IRanges::RleList.

Copilot AI commented Apr 19, 2026

Copy link
Copy Markdown
Contributor Author

In the test for phasing with coverage track, use a coverage track of GC content (calculated from the yeast genomic sequence, and smoothed along chromosomes with a bon width of 100)

Updated in commit cfe7482 (plus follow-up cleanup 06a8417): the test now builds an RleList GC-coverage track from the yeast reference genome and smooths it along chromosomes with bin width 100 before calling getCompartments().

Copilot AI requested a review from js2264 April 19, 2026 01:26
@js2264 js2264 marked this pull request as ready for review April 19, 2026 07:30
@js2264 js2264 merged commit 7864b42 into devel Apr 19, 2026
4 checks passed
@js2264 js2264 deleted the copilot/support-genomic-track-phase-compartments branch April 19, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support genomic track to phase compartments

2 participants