
Initialize a phyloDS Experiment
newExperiment.RdCreates an experiment object containing all metadata required for phylogenetic differential splicing analysis. This is the entry point for any phyloDS workflow.
Usage
newExperiment(
sampleInfo,
speciesInfo,
orthogroups,
dnaDir,
msaDir,
speciesTree,
requireUltrametric = TRUE,
ultrametricTol = 1e-06
)Arguments
- sampleInfo
data.frame or character. Sample metadata table (or path to tab-delimited file) with required columns:
sampleIDUnique identifier for each RNA-seq sample.
speciesIDSpecies identifier matching
speciesInfo.bamPath to the aligned BAM file.
strandSpecificLibrary strandedness: 0 = unstranded, 1 = stranded (read 1 on the transcript strand), 2 = reversely stranded (read 1 antisense, e.g. dUTP or Illumina TruSeq Stranded).
isPairedEndLogical.
TRUEfor paired-end sequencing.
- speciesInfo
data.frame or character. Species metadata table (or path to
tab-delimited file) with required columns:
speciesIDUnique species identifier.
genomePath to reference genome FASTA file.
groupGroup assignment:
"1"(background) or"2"(foreground/test). The differential splicing test evaluates changes along the branch(es) leading to group 2 species
Optional columns:
annotation(path to GTF/GFF file).- orthogroups
data.frame or character. Orthogroup definitions (or path to tab-delimited file) with required columns:
geneIDGene identifier (unique within species).
orthogroupIDOrthogroup identifier grouping homologous genes.
speciesIDSpecies identifier matching
speciesInfo.seqidChromosome or scaffold name.
chromStartGene start position.
chromEndGene end position.
strandStrand:
"+"or"-".
Orthogroups must be 1-to-1: exactly one gene per species per orthogroup. All species in
speciesInfomust be represented.- dnaDir
Character. Directory path for storing extracted DNA sequences. Created if it does not exist.
- msaDir
Character. Directory path for storing multiple sequence alignments. Created if it does not exist.
- speciesTree
phyloobject or character. Species phylogeny as anape::phyloobject or path to a Newick tree file. Required. Tip labels must exactly matchspeciesIDvalues inspeciesInfo. The tree must carry branch lengths.- requireUltrametric
Logical. If
TRUE(default), the species tree must be ultrametric (all tips equidistant from the root), as expected when comparing extant taxa under phylogenetic comparative models. Set toFALSEto allow non-ultrametric trees (e.g. additive/phylogram trees).- ultrametricTol
Numeric. Tolerance passed to
is.ultrametricwhenrequireUltrametric = TRUE. A small positive value absorbs the rounding error introduced when a tree is written to / read from Newick with limited decimal precision. Default: 1e-6.
Value
A list (experiment object) with components:
sampleInfodata.frame. Sample metadata merged with group assignments. Contains all input columns plus
groupas a factor.speciesInfodata.frame. Species metadata as provided.
speciesTreephyloobject. Parsed species phylogeny.orthogroupsGRanges object. Orthogroup genomic coordinates with metadata columns
geneID,orthogroupID, andspeciesID.dirslist. Absolute paths to working directories:
dna: DNA sequence storagemsa: Multiple alignment storage
Details
This function performs the following steps:
Reads input tables from files or validates provided data.frames.
Validates that all required columns are present.
Checks consistency between tables (e.g., all sample species exist in speciesInfo).
Parses the species tree if provided as a file path, and checks that it has branch lengths and (optionally) is ultrametric.
Converts orthogroups to a GRanges object for genomic operations.
Creates output directories if they do not exist.
Input File Formats
All input tables can be provided as tab-delimited text files with headers.
Example sampleInfo.tsv:
sampleID speciesID bam strandSpecific isPairedEnd
human_rep1 Homo_sapiens data/human_rep1.bam 2 TRUE
human_rep2 Homo_sapiens data/human_rep2.bam 2 TRUE
mouse_rep1 Mus_musculus data/mouse_rep1.bam 2 TRUE
Example speciesInfo.tsv:
speciesID genome group annotation
Homo_sapiens genomes/human.fa 1 annot/human.gtf
Mus_musculus genomes/mouse.fa 2 annot/mouse.gtf