gbDUreport-method: Differential gene expression and differential bin usage...

Description Usage Arguments Value Author(s) See Also Examples

Description

Estimate differential expression at gene level and differential usage at bin level using diffSpliceDGE function from edgeR package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  gbDUreport( counts, 
             minGenReads = 10, 
             minBinReads = 5,
             minRds = 0.05, 
             contrast = NULL, 
             ignoreExternal = TRUE, 
             ignoreIo = TRUE, 
             ignoreI = FALSE,
             filterWithContrasted = TRUE,
             verbose = TRUE,
             formula = NULL,
             coef = NULL)

Arguments

counts

An object of class ASpliCounts

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

contrast

Either a formula or a contrast can be tested. If contrast is used, it defines 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

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 TRUE, 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.

formula

Either a formula or a contrast can be tested. If formula is used, complex tests can be run. formula should be a formula specifying which experimental conditions defined by targets to test. If coef is specified, then that coefficient will be tested. If not, it defaults to the last term in the formula.

coef

For formula only. The coefficient to be tested. If null the test defaults to the last term in the formula

Value

An ASpliDU object with results at genes, bins level.

genesDE

symbol: gene symbol locus_overlap: genes overlaping the same locus gene_coordinates: gene coordinates start: gene start end: gene end length: gene length effective_length: gene effective length logFC: gene log2 fold change between conditions pvalue: p-value gen.fdr: fdr corrected p-value for multiple testing

binsDU

feature: bin type event: type of event asigned by ASpli when bining. locus: gene locus locus_overlap: genes overlaping the same locus symbol: gene symbol gene_coordinates: gene coordinates start: bin start end: bin end length: bin length logFC: bin log2 fold change between conditions pvalue: p-value bin.fdr: fdr corrected p-value for multiple testing

Author(s)

Estefania Mancini, Andres Rabinovich, Javier Iserte, Marcelo Yanovsky, Ariel Chernomoretz

See Also

edgeR, jDUreport Accessors: genesDE, binsDU Export: writeDU

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
  
  # 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'),
               subject = c(0, 1, 2, 0, 1, 2))
  
  # Read counts from bam files
   gbcounts  <- gbCounts( features = features, 
                        targets = targets, 
                        minReadLength = 100, 
                        maxISize = 50000,
                        libType="SE", 
                        strandMode=0)

# Test for factor1
  # Test for factor1 controlling for paired subject
  gbPaired   <- gbDUreport(gbcounts, formula = formula(~subject+factor1))
  
  # Show all genes and bins ordered by FDR
  genesDE(gbPaired)
  binsDU(gbPaired)
  
  # Test for factor1 without controlling for paired subject. 
  # Must change conditions inside gbcounts object to accommodate the contrast.
  gbcounts@targets$condition <- targets$factor1
  gbcounts@condition.order   <- c("C", "D") 
  gbContrast <- gbDUreport(gbcounts, contrast = c(1, -1))
  
  # Show all genes and bins ordered by FDR
  genesDE(gbContrast)
  binsDU(gbContrast)
  
  # Export results  
  writeDU( du = gbPaired, output.dir = paste0(tempdir(), "/gbPaired") )
  writeDU( du = gbContrast, output.dir = paste0(tempdir(), "/gbContrast") )

chernolab/ASpli documentation built on March 11, 2021, 12:24 a.m.