# A Quick Start of Using cola Package

Author: Zuguang Gu ( z.gu@dkfz.de )

Date: 2019-05-02

Package version: 1.0.0

Assume your matrix is stored in an object called `mat`, to perform consensus partition, you only need to run following code:

    # code only for demonstration
    mat = adjust_matrix(mat)  # optional
    rl = run_all_consensus_partition_methods(mat, mc.cores = ...)
    cola_report(rl, output_dir = ...)

In above code, there are three steps:

1. Adjust the matrix. In this step, rows with too many `NA`s are removed. Rows with very low variance are removed. `NA` values are imputed if there are not too many in each row. Outliers are adjusted in each row. This step is optional.
2. Run consensus partition with multiple methods. The default partition methods are `hclust`, `kmeans`, `skmeans::skmeans`, `cluster::pam` and `Mclust::mclust`. The default methods to extract top n rows are `sd`, `cv`, `MAD` and `ATC`. It will try five different numbers of top rows, and in each partition, it randomly samples 80% from the top n rows.
3. Generate a detailed HTML report for the complete analysis.

To perform hierarchical partition, run following code:

    # code only for demonstration
    rh = hierarchical_partition(mat, mc.cores = ...)
    cola_report(rh, output_dir = ...)

For the hierarchical partition, you can only select one partition method and one top-value method. The default partition method is `kmeans()` and the default top-value method is `MAD`.

There are five examples on real datasets for cola analysis that can be found at https://jokergoo.github.io/cola_examples/.