Skip to contents

Creates a comprehensive set of visualization files from phyloDS analysis results. Generates consensus sequences, BAM alignments, BigWig tracks, GTF annotations, and an IGV session file for interactive exploration.

Usage

exportResults(
  data,
  se,
  outputDir,
  predDir = NULL,
  models = "model_10000nt_rs10",
  speciesOrder = NULL,
  nbThreads = 1,
  nbThreadsBySpecies = 1
)

Arguments

data

List. Experiment object from newExperiment containing:

speciesInfo

data.frame with speciesID, group, and annotation columns.

orthogroups

GRanges with gene locations and orthogroup assignments.

dirs$msa

Path to directory containing MSA files.

se

SummarizedExperiment. Results from runDS containing:

rowRanges

Orthologous splice junction coordinates.

mcols

Species-specific coordinates, statistical results (significant, DID, padj).

outputDir

Character. Directory for output files. Created if needed.

predDir

Character. Directory containing OpenSpliceAI predictions from predictDID. Set to NULL to skip BigWig generation.

models

Character vector. OpenSpliceAI model IDs to average. Default: "model_10000nt_rs10".

speciesOrder

Character vector or NULL. Custom species order for IGV display. Default: order from data$speciesInfo.

nbThreads

Integer. Threads for processing orthogroups. Default: 1.

nbThreadsBySpecies

Integer. Threads for per-species operations. Default: 1.

Value

Invisible NULL. Files are written to outputDir.

Details

The export pipeline has 6 steps:

Step 1 - Consensus Sequences: Computes consensus from each MSA and merges into consensus.fa.

Step 2 - BAM Alignments: Converts MSA to BAM format with CIGAR strings encoding matches/mismatches/gaps. One BAM per species: <speciesID>.bam.

Step 3 - OpenSpliceAI BigWig: Projects splice site probabilities to consensus coordinates. One BigWig per species per site type: <speciesID>_[acceptors|donors]_openspliceai.bw.

Step 4 - phyloDS Results GTF: Exports orthologous splice junctions as GTF with color coding:

  • Red: significant & DID > 0 (increased in group 2)

  • Blue: significant & DID < 0 (decreased in group 2)

  • Grey: not significant

Step 5 - Annotation Projection: Projects species annotations to consensus coordinates. Color-coded by group (red = group 2, blue = group 1).

Step 6 - IGV Session: Creates session.xml with all tracks organized into panels.

Output Files

consensus.fa[.fai]

Consensus sequences with index

<speciesID>.bam[.bai]

BAM alignments with index

<speciesID>_[acceptors|donors]_openspliceai.bw

Splice site BigWig

phyloDS_results.gtf

Differential splicing results

<speciesID>_annotations.gtf

Projected annotations

session.xml

IGV session file

Requirements

  • samtools must be in PATH

  • MSA files must exist in data$dirs$msa

  • Annotation files in data$speciesInfo$annotation

See also

runDS for differential splicing analysis, predictDID for OpenSpliceAI predictions.

Examples

if (FALSE) { # \dontrun{
exportResults(
  data      = experiment,
  se        = se,
  outputDir = "igv_output/",
  predDir   = "predictions/",
  nbThreads = 4
)

# Open in IGV: File > Open Session > igv_output/session.xml
} # }