semanticdifference {Onassis}R Documentation

semanticdifference

Description

semanticdifference function allows to test, within a given tissue class, the difference between i) the healthy samples and one or more disease states and ii) if there is a significant difference between the different disease states for each unit represented in each row of a scorematrix containing as rows genomic units and as columns GEO sample ids.

Usage

semanticdifference(score_matrix, list_of_annotations, fun_name, test_type)

Arguments

score_matrix

A matrix where rows represent units (GRanges or genes) and columns #' represent GSMs.

list_of_annotations

A list of lists where the firt level elements represent a tissue/cell line semantic set, the second level elements represent disease semantic sets and each element of the list is a named score matrix with column names corresponding to sample (GSM) identifiers

fun_name

The name of a testing function to measure the differences between semantic classes. For the test_type parameter = 'pair' the semanticdifference function applies the test function to the tissue semantic states including 'Healthy' and one or or more diseases. In this case the function (e.g. wilcoxon.test) should take as input a couple of vectors and return as output the value of the of the statistic '$statistic' field and a p-value '$p.value' field. For the test_type = 'multiple' the function tests if there are differences between the semantic disease classes within the tissue class. The function (e.g. kruskal.test) takes as input a list of vectors (one for each disease semantic set) and returns the value of the statistic in the '$statistic' field and the corresponding p-value.

test_type

This value can be 'pair' or 'multiple'. In case it is set to pair the function to provide in fun_name requires the tissue semantic class to include at least two disease semantic classes of which one has to be 'Healthy' to compare diseases against healthy. For example the 'wilcox.test'. When set to multiple the fun_name provided should take as input a list of input vectors corresponding to the different disease conditions. A minimum of three is required. For example the 'kruskal.test' can be used.

Value

The semanticdifference function returns a list where each element corresponds to a tissue/cell line semantic state. The content of the list for 'multiple' test types a matrix of the test results and corresponding p.values.

Examples

granges <- readRDS(system.file('extdata', 'sample_granges.rds', package='Onassis'))
ref_granges <- granges[[1]]
for(i in 2:length(granges)) {
 ref_granges <- GenomicRanges::union(ref_granges, granges[[i]])
}
score_mat <- create_score_matrix(ref_granges, granges)
gsm_list <- names(granges)
list_of_annotations <- readRDS(system.file('extdata', 'list_of_annotations.rds', package='Onassis'))
fun_name = 'wilcox.test'
fun_type = 'pair'
sem_dif <- semanticdifference(score_mat, list_of_annotations, fun_name, fun_type)

[Package Onassis version 1.4.5 Index]