DBresult: This function performs differetial analysis by fitting read...

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/DBresults.R

Description

This function performs likelihood ratio tests for given coefficinets contrasts after fitting read counts to GLM by DBanalysis. DBresult extracts the diffential analysis results of given contrasts for all genomic features or genomic features with significant differential events. DBresult.cluster returns similar results while the results only contain genomic features belong to a given cluster.

Usage

1
2
3
4
5
6
7
8
9
DBresult(object, group1 = NULL, group2 = NULL, contrasts = NULL,
  p.adjust = "fdr", top.sig = FALSE, pvalue = "paj",
  pvalue.threshold = 0.05, abs.fold = 2, direction = "both",
  result.type = "GRangesList")

DBresult.cluster(object, group1 = NULL, group2 = NULL, contrasts = NULL,
  p.adjust = "fdr", top.sig = FALSE, pvalue = "paj",
  pvalue.threshold = 0.05, abs.fold = 2, direction = "both", cluster,
  cmthreshold = NULL, result.type = "GRangesList")

Arguments

object

a TCA object, for DBresult, DBanalysis should already be called on the object; for DBresult.cluster, both DBanalysis and timeclust should be already called.

group1

character string giving the level to be compared, that is the denominator in the fold changes.

group2

a character vetor giving other levels to compared with group1. that are numerator in the fold changes.

contrasts

a character vector, each charcter string in the vector gives a contrast of two groups with the format group2vsgroup1', group1 is the denominator level in the fold changes and group2 is the numerator level in the fold changes.

p.adjust

character string specifying a correction method for p-values. Options are 'holm', hochberg', 'hommel', 'bonferroni', BH', 'BY', 'fdr', 'none'.

top.sig

logical if TRUE, only genomic regions with significant differential events will are returned. Significant differential events are defined by log2-fold changes,p-values or adjusted p-values.

pvalue

character string specify the type of p-values used to define significant differential events('PValue' or adjusted p-value 'paj')

pvalue.threshold

a numeric value giving threshold of selected p-value, Significant differential events have lower (ajusted) p-values than the threshold.

abs.fold

a numeric value, the least absolute log2-fold changes

direction

character string specify the direction of fold changes ('up' (positive fold changes), down' (negative fold changes), both'(both positive and negative fold changes)). Significant events have log2-fold changes exceeding abs.fold in defined directions.

result.type

character string giving the data type of return value. Options are "GRangesList" and "list".

cluster

an integer, the result tables of genomic features belong to the cluster are extracted.

cmthreshold

a numeric value, this argument is applicable only if cmeans' clustering method is selected when calling timeclust function. if not NULL, the result table of genomic features that belong to the defined cluster and the membership values to this cluster exceed cmthreshold are extracted.

Details

This function uses glmLRT from edgeR which perform likelihood ratio tests for testing significance of changes. For more deatils, see glmLRT

Value

A list or a GRangesList. If result.type is "GRangesList", a GRangesList is returned containing the differential analysis results for all provided contrasts. Each GRanges object of the list is one contrast, the analysis results are contained in 4 metadata columns:

logFC log2-fold changes of differential event between two tested.

PValue p-values.

paj adjusted p-values

id genomic feature name

If result.type is "list", a List of data frames is returned. Each data frame is one contrast and contains the following columns:

logFC log2-fold changes of differential event between two tested.

PValue p-values.

paj adjusted p-values

chr name of the chromosomes

start starting position of the feature in the chromosome

end ending postition of the feature in the chromosome

id genomic feature name

Note

If not NULL group1, group2 and contrasts, result tables are extracted from comparisons in constrasts.

Author(s)

Mengjun Wu, Lei Gu

See Also

glmLRT

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data(tca_ATAC)
tca_ATAC <- DBanalysis(tca_ATAC)
### extract differntial analysis of 24h, 72h to 0h
# set the contrasts using the 'group1' and 'group2' paramters
res1 <- DBresult(tca_ATAC, group1 = '0h', group2 = c('24h', '72h'))
# one can get the same result by setting the contrasts using hte 'contrasts' parameter
res2 <- DBresult(tca_ATAC, contrasts = c('24hvs0h', '72hvs0h'))
# extract significant diffential events
res.sig <- DBresult(tca_ATAC, contrasts = c('24hvs0h', '72hvs0h'),
                   top.sig = TRUE)

# extract differntial analysis of 24h, 72h to 0h of a given cluster
tca_ATAC <- timecourseTable(tca_ATAC, filter = TRUE)
tca_ATAC <- timeclust(tca_ATAC, algo = 'cm', k = 6)
res_cluster1 <- DBresult.cluster(tca_ATAC, group1 = '0h',
                                 group2 = c('24h', '72h'),
                                 cluster = 1)

TCseq documentation built on Nov. 8, 2020, 5:46 p.m.