RoarDataset {roar} | R Documentation

## Creates a `RoarDataset` object

### Description

This function creates an `RoarDataset` object from two lists of of `GAlignments` and a `GRanges` containing a suitable annotation of alternative APA sites.

### Usage

          RoarDataset(treatmentGappedAlign, controlGappedAlign, gtfGRanges)

### Arguments

`treatmentGappedAlign` | A list of `GAlignments` representing alignment of samples for the treatment condition (by convention it is considered the “treated” condition: this simply means that the package will compute roar values (ratios of the m/M) using this condition as the numerator) to be considered.
`controlGappedAlign` | A list of `GAlignments` representing alignment of samples for the control condition to be considered.
`gtfGRanges` | A `GRanges` object with coordinates for the portions of transcripts that has to be considered pertaining to the short (or long) isoform. This `GRanges` object must have a character metadata column called "gene_id" that ends with "_PRE" or "_POST" to address respectively the short and the long isoform. An element in the annotation is considered "PRE" (i.e. common to the short and long isoform of the transcript) if its gene_id ends with "_PRE". If it ends with "_POST" it is considered the portion present only in the long isoform. The prefix of gene_id should be a unique identifier for the gene and each identifier has to be associated with only one "_PRE" and one "_POST", leading to two genomic region associated to each gene_id. The `GRanges` object can also contain a numeric metadata column that represents the lengths of PRE and POST portions on the transcriptome. If this is omitted the lengths on the genome are used instead. Note that right now every gtf entry (or none of them) should have it.

### Value

A `RoarDataset` object ready to be analyzed via the other methods.

### See Also

`RoarDatasetFromFiles`

### Examples

       library(GenomicAlignments)
       gene_id <- c("A_PRE", "A_POST", "B_PRE", "B_POST")
       features <- GRanges(
          seqnames = Rle(c("chr1", "chr1", "chr2", "chr2")),
          strand = strand(rep("+", length(gene_id))),
          ranges = IRanges(
             start=c(1000, 2000, 3000, 3600),
             width=c(1000, 900, 600, 300)),
          DataFrame(gene_id)
       )
       rd1 <- GAlignments("a", seqnames = Rle("chr1"), pos = as.integer(1000), cigar = "300M", strand = strand("+"))
       rd2 <- GAlignments("a", seqnames = Rle("chr1"), pos = as.integer(2000), cigar = "300M", strand = strand("+"))
       rd3 <- GAlignments("a", seqnames = Rle("chr2"), pos = as.integer(3000), cigar = "300M", strand = strand("+"))
       rds <- RoarDataset(list(c(rd1,rd2)), list(rd3), features)

[Package roar version 1.22.0 Index]