
Map Splice Junctions to Multiple Genomic Sequence Alignments
findOSJ.RdProjects 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.
Arguments
- data
List. Experiment object from
newExperimentcontaining:orthogroupsGRanges with metadata columns
geneID,orthogroupID,speciesID, and genomic coordinates.sampleInfodata.frame with columns
sampleID,speciesID.dirs$msaDirectory containing MSA files from
orthogroupMSA.
- cov
data.frame. Splice junction coverage from
coverageSJwith columns:geneIDGene identifier.
sampleIDSample identifier.
donorGenomic position of the last nucleotide of the donor exon.
acceptorGenomic position of the first nucleotide of the acceptor exon.
splicedInNumber of reads spanning this junction.
- nbThreads
Integer. Number of orthogroups processed in parallel. Default: 1.
Value
A SummarizedExperiment object with:
assays$countsMatrix of orthologous splice junction counts. Rows are orthologous splice junctions (named by
orthogroupID_donorMSA_acceptorMSA), columns are sample-state combinations (sampleID_splicedIn,sampleID_splicedOut).rowRangesGRanges 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).colDataSample metadata with columns
sampleID,speciesID,group,state(splicedIn/splicedOut),id, andsizeFactor(initialized to 1).
Details
The function performs the following steps for each orthogroup:
Loads the MSA and its coordinate reference mapping.
For each sample, converts genomic junction positions to relative positions within the gene (accounting for strand).
Maps relative positions to MSA column positions using the reference.
Identifies orthologous splice junctions across species based on matching MSA positions.
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)
} # }