DUreport {ASpli} | R Documentation

## Differential gene expression and differential bin usage estimation

### Description

Estimate differential expression at gene level and differential usage at bin level. When targets has only two conditions, and contrast is not set, the estimation of differential expression and usage is done with an exact test, otherwise is estimated using a generalized linear model.

### Usage

      DUreport( counts,
                targets,
                minGenReads = 10,
                minBinReads = 5,
                minRds = 0.05,
                offset = FALSE,
                offsetAggregateMode =  c( "geneMode", "binMode" )[1],
                offsetUseFitGeneX = TRUE,
                contrast = NULL,
                forceGLM = FALSE,
                ignoreExternal = TRUE,
                ignoreIo = TRUE,
                ignoreI = FALSE,
                filterWithContrasted = FALSE,
                verbose = FALSE)

### Arguments

`counts` | An object of class ASpliCounts
`targets` | A data.frame containing sample, bam and experimental factor columns.
`minGenReads` | Genes with at least an average of `minGenReads` reads for any condition are included into the differential expression test. Bins from genes with at least an average of `minGenReads` reads for all conditions are included into the differential bin usage test. Default value is 10 reads.
`minBinReads` | Bins with at least an average of `minGenReads` reads for any condition are included into the differential bin usage test. Default value is 5 reads.
`minRds` | Genes with at least an average of `minRds` read density for any condition are included into the differential expression test. Bins from genes with at least an average of `minRds` read density for all conditions are included into the differential bin usage test. Bins with at least an average of `minRds` read density for any condition are included into the differential bin usage test. Default value is 0.05.
`ignoreExternal` | Ignore Exon Bins at the beginning or end of the transcript. Default value is TRUE.
`ignoreIo` | Ignore original introns. Default TRUE
`ignoreI` | Ignore intron bins, test is performed only for exons. Default FALSE
`offset` | Corrects bin expression using an offset matrix derived from gene expression data. Default = FALSE
`offsetAggregateMode` | Choose the method to aggregate gene counts to create the offset matrix. When `offsetAggregateMode` is 'geneMode' and option `offsetUseFitGeneX` is TRUE, a generalized linear model is used to create the offset matrix. When `offsetAggregateMode` is 'geneMode' and option `offsetUseFitGeneX` is FALSE, the offset matrix is generated by adding a prior count to the gene count matrix. When `offsetAggregateMode` is 'binMode' a matrix from obtained from the sum of exonic bin counts, this only takes those bins that passes filters using minGenReads, minBinReads and minRds. Options:=c( "geneMode", "binMode" )[ 1 ]

,

`offsetUseFitGeneX` | Default= TRUE
`contrast` | Define the comparison between conditions to be tested. `contrast` should be a vector with length equal to the number of experimental conditions defined by `targets`. The values of this vector are the coefficients that will be used to weight each condition, the order of the values corresponds to the order given by `getConditions` function. When `contrast` is NULL, defaults to a vector containing -1, as the first value, 1 as the second an zero for all the remaining values, this corresponds to a pair comparison where the first condition is assumed to be a control and the second condition is the treatment, all other conditions are ignored. Default = NULL
`forceGLM` | Force the use of a generalized linear model to estimate differential expression and usage. Default = FALSE
`filterWithContrasted` | A logical value specifying if bins, genes and junction will be filtered by read quantity and read density using data from those conditions that will be used in the comparison, i.e. those which coefficients in contrast argument are different from zero. The default value is FALSE, it is strongly recommended to do not change this value.
`verbose` | A logical value that indicates that detailed information about each step in the analysis will be presented to the user.

### Value

An ASpliDU object with results at `genes`, `bins` level.

### Author(s)

Estefania Mancini, Javier Iserte, Marcelo Yanovsky, Ariel Chernomoretz

### See Also

`edgeR`, `junctionDUreport` Accessors: `genesDE`, `binsDU` Export: `writeDU`

### Examples

      # Create a transcript DB from gff/gtf annotation file.
      # Warnings in this examples can be ignored.
      library(GenomicFeatures)
      genomeTxDb <- makeTxDbFromGFF( system.file('extdata','genes.mini.gtf',
                                     package="ASpli") )

      # Create an ASpliFeatures object from TxDb
      features <- binGenome( genomeTxDb )

      # Define bam files, sample names and experimental factors for targets.
      bamFileNames <- c( "A_C_0.bam", "A_C_1.bam", "A_C_2.bam",
                         "A_D_0.bam", "A_D_1.bam", "A_D_2.bam" )
      targets <- data.frame(
                   row.names = paste0('Sample_',c(1:6)),
                   bam = system.file( 'extdata', bamFileNames, package="ASpli" ),
                   factor1 = c( 'C','C','C','D','D','D') )

      # Load reads from bam files
      bams <- loadBAM( targets )

      # Read counts from bam files
      counts   <- readCounts( features, bams, targets, cores = 1, readLength = 100,
                              maxISize = 50000 )

      # Calculate differential usage of genes and bins
      du       <- DUreport( counts, targets )

      # Export results
      writeDU( du = du, output.dir = "only_du" )

[Package ASpli version 1.12.0 Index]