Skip to contents

Projects splice junction positions from species-specific genomic coordinates to multiple genomic sequence alignment (MSA) coordinates. This enables cross-species comparison of splice junctions by identifying orthologous splice junctions based on their aligned positions.

Usage

findOSJ(data, cov, nbThreads = 1)

Arguments

data

List. Experiment object from newExperiment containing:

orthogroups

GRanges with metadata columns geneID, orthogroupID, speciesID, and genomic coordinates.

sampleInfo

data.frame with columns sampleID, speciesID.

dirs$msa

Directory containing MSA files from orthogroupMSA.

cov

data.frame. Splice junction coverage from coverageSJ with columns:

geneID

Gene identifier.

sampleID

Sample identifier.

donor

Genomic position of the last nucleotide of the donor exon.

acceptor

Genomic position of the first nucleotide of the acceptor exon.

splicedIn

Number of reads spanning this junction.

nbThreads

Integer. Number of orthogroups processed in parallel. Default: 1.

Value

A SummarizedExperiment object with:

assays$counts

Matrix of orthologous splice junction counts. Rows are orthologous splice junctions (named by orthogroupID_donorMSA_acceptorMSA), columns are sample-state combinations (sampleID_splicedIn, sampleID_splicedOut).

rowRanges

GRanges with MSA coordinates (seqnames = orthogroupID, ranges = donor-acceptor in MSA space). Metadata columns include species-specific genomic coordinates: <speciesID>.geneID, <speciesID>.seqnames, <speciesID>.strand, <speciesID>.donor (3' end of donor exon), <speciesID>.acceptor (5' end of acceptor exon).

colData

Sample metadata with columns sampleID, speciesID, group, state (splicedIn/splicedOut), id, and sizeFactor (initialized to 1).

Details

The function performs the following steps for each orthogroup:

  1. Loads the MSA and its coordinate reference mapping.

  2. For each sample, converts genomic junction positions to relative positions within the gene (accounting for strand).

  3. Maps relative positions to MSA column positions using the reference.

  4. Identifies orthologous splice junctions across species based on matching MSA positions.

  5. Computes splicedOut counts as the sum of splicedIn counts from competing (overlapping) orthologous splice junctions.

Every junction observed in at least one sample is kept, including junctions detected in a single species; cross-species support is enforced later by the minSpecies filter of runDS.

Coordinate Systems

Three coordinate systems are used:

  • Genomic: Chromosome positions (e.g., chr1:1000-2000).

  • Relative: Position within gene (1-based, strand-aware).

  • MSA: Alignment column position (1-based, includes gap columns).

Junctions are identified as orthologous when they map to the same MSA column positions, even if their genomic positions differ due to insertions/deletions between species.

SplicedOut Counts

For each focal orthologous splice junction, splicedOut counts the reads supporting its competing orthologous splice junctions, i.e. those whose donor-acceptor interval overlaps that of the focal junction in MSA space (including junctions sharing a single splice site). It is computed by summing the splicedIn counts of all overlapping orthologous splice junctions, then subtracting the focal orthologous splice junction's own count.

See also

newExperiment to create the experiment object, coverageSJ to quantify junction coverage (previous step), orthogroupMSA to generate alignments, runDS for differential splicing analysis (next step).

Examples

if (FALSE) { # \dontrun{
data <- newExperiment(sampleInfo, speciesInfo, orthogroups,
                      dnaDir, msaDir, speciesTree)
orthogroupDNA(data, nbThreads = 4)
orthogroupMSA(data, nbThreads = 4)
coverage <- coverageSJ(data, nbThreads = 4)

# Map junctions to MSA coordinates
se <- findOSJ(data, cov = coverage, nbThreads = 8)

# Explore the result
dim(se)
head(rowRanges(se))
colData(se)
} # }