runibic: parallel UniBic biclustering algorithm for R

This package contains an updated parallel implementation of UniBic biclustering algorithm for gene expression data [Wang2016]. The algorithm locates trend-preserving biclusters within complex and noisy data and is considered one of the most accurate among biclustering methods.

Introduction

Since their first application to gene expression data [Cheng2000] biclustering algorithms have gained much popularity [Eren2012]. The reason for this is the ability of the methods to simultaneously detect valid patterns within the data that include only subset of rows and columns.

In this package we provide an efficient parallel improved implementation of UniBic biclustering algorithm. This state-of-the-art algorithm is said to outperform multiple biclustering methods on both synthetic and genetic datasets. Our major contributions are reimplementing the method into more modern C++11 language as well as multiple improvements in code (memory management, code refactoring etc.)

Functions

This package provides the following main functions: * BCUnibic/runibic - parallel UniBic for continuous data * BCUnibicD - parallel UniBic for discrete data

The package provides some additional functions: * pairwiseLCS - calculates Longest Common Subsequence (LCS) between two vectors * calculateLCS - calculates LCSes between all pairs of the input dataset (Fibonacci heap or standard sort) * backtrackLCS - recovers LCS from the dynamic programming matrix * cluster - main part of UniBic algorithm (biclusters seeding and expanding) * unisort - returns matrix of indexes based on the increasing order in each row * discretize - performs discretization using Fibonacci heap (sorting method used originally in UniBic)

Installation

The package may be installed as follows:

Examples

Synthetic data

This example shows the basic usage of runibic on synthetic data. We start with loading the libraries.

First we prepare a random matrix.

Then, we run UniBic biclustering algorithm on the dataset. We use a Biclust package wrapper.

We can inspect the results returned by the method. Let’s see how many biclusters were detected.

We could also inspect the rows of a specific bicluster, for example the third one.

Similarly we could check the indexes of columns of the third bicluster.

Visual analyses are very useful in biclustering. Let’s draw the heatmap with the obtained bicluster using drawHeatmap function from biclust package.

We could also present parallel coordinates plot of the bicluster with function parallelCoordinates from biclust package.

Similarly the package could be used to find trends in discrete data. We run runiDiscretize function.

Finally, we run the UniBic algorithm dedicated to work with discrete datasets.

Data provided by other packages

This example presents how to use runibic package on a sample dataset. After loading all required libraries

we apply UniBic biclustering method to the sample yeast dataset from biclust package.

The method has found 92 biclusters. Now we are going to analyze the results. We will start with drawing a heatmap of the first found bicluster using drawHeatmap from biclust package.

Then we may check the result drawing the genes from the bicluster using parallel coordinates plot with parallelCoordinates function from biclust package.

Summarized experiment

The third application of runibic is using the algorithm on the dataset from an RNA-Seq experiment (SummarizedExperiment). We start with loading necessary packages (runibic, SummarizedExperiment) and load the airway dataset.

We will take only a subset of the data to check if the method can return any patterns.

Let’s see if UniBic detects any pattern in the dataset.

The result could be visualized using parallelCoordinates method from biclust package.

We can also draw a heatmap with the second bicluster.

Gene expression dataset

Another very useful application of the runibic package is analyzing real dataset obtained from Gene Expression Omnibus (GEO). For this task we will use three packages: getGEO from GEOquery to download the data, GDS2eSet from affy to convert the dataset to ExpressionSet and finally exprs to extract gene expression matrix.

We download dataset with Rat peripheral and brain regions from Gene Expression Omnibus.

Now we convert dataset to ExpressionSet and take subset of the dataset.

We perform analysis on first 100 of genes.

Finally, we draw the heatmap with the first bicluster using drawHeatmap function from biclust package.

Comparing the results of different biclustering algorithms

We load package with QUBIC biclustering algorithm for comparison

Now, we perform biclustering using CC, Bimax, Qubic, Plaid and Unibic:

The results of clustering could be compared using showinfo from QUBIC package.

Finding the Longest Common Subsequence between two vectors (1)

The Longest Common Subsequence (LCS) between two vectors is the longest series of the data that is present in both analyzed vectors. Let’s prepare two vectors for the analysis.

You may notice that the values (1,2,4) are contained in both vectors: in vector A: (1,2,x,x,4,x) and in vector B: (x,1,x,2,x,4)

Let’s use the methods provided by the package to calculate the longest common subsequence. We first check which values are common for both vectors using backtrackLCS.

Then we calculate using dynamic programming the matrix for Longest Common Subsequence with pairwiselLCS

Finding the Longest Common Subsequence between two vectors (2)

In our next example we will find the length of the longest common subsequence within the matrix We start with preparing input matrix.

We sort data in each row with the function unisort provided by the runibic package.

Now we calculate the length of LCS between each pair of rows using calculateLCS either using Fibonacci Heap or standard sort.

You may notice that depending on the method chosen the results may differ.

We can check the length of the longest common subsequence (e.g. LCS between rows 6 and 7 is equal to 10).

Discretizing a matrix using the quantile method from UniBic

First we create a random matrix

Discretization from UniBic (using original sorting method using Fibonacci Heap) could be applied using runiDiscretize function.

Running UniBic algorithm step by step

In order to take full advantage of the modularity offered by runibic, we apply UniBic algorithm step by step using standard stable sort. The last example shows how to use cluster function from the package. After creating a matrix we sort values in each row and calculate LCS between all pairs of rows.

Finally, we apply cluster function to inspect the results.

Citation

For the original sequential biclustering algorithm please use the following citation:

Zhenjia Wang, Guojun Li, Robert W. Robinson, Xiuzhen Huang UniBic: Sequential row-based biclustering algorithm for analysis of gene expression data Scientific Reports 6, 2016; 23466, doi: https://doi:10.1038/srep23466

If you use in your work this package with parallel version of UniBic please use the following citation:

Patryk Orzechowski, Artur Pańszczyk, Xiuzhen Huang, Jason H Moore; runibic: a Bioconductor package for parallel row-based biclustering of gene expression data Bioinformatics, , bty512, https://doi.org/10.1093/bioinformatics/bty512

BibTex entry:

@article{orzechowski2018runibic,
  author = {Orzechowski, Patryk and Pańszczyk, Artur and Huang, Xiuzhen and Moore, Jason H},
  title = {runibic: a Bioconductor package for parallel row-based biclustering of gene expression data},
  journal = {Bioinformatics},
  volume = {},
  number = {},
  pages = {bty512},
  year = {2018},
  doi = {10.1093/bioinformatics/bty512},
  URL = {http://dx.doi.org/10.1093/bioinformatics/bty512},
  eprint = {/oup/backfile/content_public/journal/bioinformatics/pap/10.1093_bioinformatics_bty512/4/bty512.pdf}
}

References