compare {Onassis} | R Documentation

## `compare`

### Description

This method compares a list of scored entities according to the semantic annotations of this entities in the semantic sets defined by a single ontology or, in case of annotations with two ontologies, the difference between second level semantic sets within a give first level semantic set (e.g. different diseases within a given tissue)

### Usage

    compare(onassis, ...)

    ## S4 method for signature 'Onassis'
    compare(onassis, score_matrix = NA, by = "row",
      fun_name = "wilcox.test")

### Arguments

`onassis` | instance of class `Onassis-class`
`...` | Optional parameters
`score_matrix` | a matrix of scores containing on the rows genomic units and on the columns the samples annotated in the entities
`by` | 'row' if the test refers to single genomic units in multiple conditions, 'col' if the test compares all the genomic units across different conditions
`fun_name` | name of the test to apply

### Value

The results of the comparison between semantic classes

### Examples

    geo_chip <- readRDS(system.file('extdata', 'vignette_data','GEO_human_chip.rds', package='Onassis'))
    geo_chip <- geo_chip[sample(nrow(geo_chip), 30) ,]
    obo1 <- system.file('extdata', 'sample.cs.obo', package='OnassisJavaLibs')
    obo2 <- system.file('extdata', 'sample.do.obo', package='OnassisJavaLibs')
    onassis_results1 <- annotate(geo_chip, 'OBO', dictionary=obo1)
    onassis_results2 <- annotate(geo_chip, 'OBO', dictionary=obo2)
    n <- length(unique(geo_chip$sample_accession))
    m <- 50
    score_matrix <-   matrix(sample(0:1, m * n, replace = TRUE), m, n)
    colnames(score_matrix) <- unique(geo_chip$sample_accession)
    rownames(score_matrix) <- paste0('gene_', seq(1, m, 1))
    my_onassis <- mergeonassis(onassis1 = onassis_results1, onassis2 = onassis_results2)
    scores(my_onassis) <- score_matrix

    comparisons <- compare(my_onassis)
    comparisons2 <- compare(my_onassis, by='col', fun_name='kruskal.test')
    scores(onassis_results1) <- score_matrix
    comparisons3 <- compare(onassis_results1)
    comparisons4 <- compare(onassis_results1, by='col', fun_name='kruskal.test')

[Package Onassis version 1.2.7 Index]