macでインフォマティクス

macでインフォマティクス

HTS (NGS) 関連のインフォマティクス情報についてまとめています。

共発現遺伝子の自動クラスタリングツール CLust

 

 遺伝子の転写は、すべての生物において動的かつ協調的に調節される。そのような協調的調節は、時系列およびperturbation-responseデータセット (参考HP) における転写産物の協調的変化として明白である。遺伝子の転写は、遺伝子のプロモーター領域またはエンハンサー領域に位置するDNA /クロマチンelementsへの転写因子の結合によって調節される。典型的には、転写因子は、ゲノム中の全遺伝子数の約10%を構成し、転写の複雑な時空間パターンは、制御ネットワークにおけるこれらの遺伝子のcombinatorialなアクションを介して達成される[論文より ref.1]。これらのネットワークのcombinatorial な性質は、それらの動作が生来conditionalであることを意味する。すなわち、ある条件の下で同時発現しているように見える遺伝子は、必ずしもすべての条件下で同時発現されるとは限らない。この結果は、いずれかの実験的状況(例えば、いくつかの生物学的プロセスにまたがる時系列実験またはperturbation-response実験)において、すべての遺伝子が協調的に行動するわけではないということである。代わりに、遺伝子のサブセットは、実験的な状況の中では特定のレギュレーターの組み合わせにより協調的に行動するが、他の遺伝子は、実験のデザインとは独立したパターンに従う。したがって、与えられたobservation window(すなわち実験内容)内では、すべての遺伝子が限られた協調的振る舞いにアサインされることは期待されない[ref.2,3, link2,  pubmed3]。

 遺伝子のサブセットのみが特定の状況において同時発現される可能性が高いことを考えると、これらのサブセットの同定はデータ抽出問題であり、データ分割問題ではない。すなわち、遺伝子発現クラスタリングの目的は、特定の状況において検出される完全な遺伝子セットから協調的に行動する遺伝子のコホート(集団)を同定および抽出することであり、全遺伝子セットを分類することではない。実際には、クラスタリングは、それらがコーディネートされた挙動(すなわち、同時発現遺伝子のクラスター)を有する遺伝子の個別コホートの完全なセットを同定することを期待して遺伝子発現データに広く適用されており、それらの行動を示す遺伝子は、正しいクラスターに割り当てられる[ref.4,5]。しかし、共発現遺伝子のコホートを同定することを目的とする大部分の方法は、データ分割(例えば、k-means [ref.6]、階層的クラスタリング[ref.7]、自己組織化マップ[ref.8])(参考HP)に基づいている。これらのアプローチは、データ分割メトリックの数値最適化によって決定されるクラスタの数を用いて、すべての遺伝子を有限集合のクラスタに割り当てようと試みる[ref.9]。従って、調査中の文脈において同時発現されていない遺伝子もまた、それらの「最良適合」クラスターに割り当てられ、その結果、クラスターの大部分は、共発現遺伝子および非共発現遺伝子の両方を含むであろう。この結果は、共発現された遺伝子クラスターの生物学的特性の期待に従わない。すなわち、各クラスターは、問題の実験的または生物学的状況において強調した挙動を示す遺伝子のみを含み、どのクラスターも同一のプロファイルを持たない。データ分割メソッドが最も一般的に使用されており、多くの部分クラスタリング方法も提案されており [ref.5,10,11,12]、それの方法では、完全なデータセットクラスタ間で分割される必要はない。代わりに、クラスタに簡単に割り当てることができるサブセットを特定することを目指している。

 ここでは、5つのモデル生物から100の実際の生物学的データセットの分析を通して、データ分割ベースおよび部分クラスタリングベースの方法を遺伝子発現データに適用すると、アサインに信頼性のない相当数の遺伝子が出ることを示す、すなわち排他的に適合しない遺伝子で、そのクラスターでは除外されていたはずの遺伝子である。そのような信頼できないコンテンツは、これらのクラスタの約50%までを構成する。この問題を解決するために、遺伝子発現データからクラスタ抽出のためのclustと呼ばれる新しい方法を提供する。 Clustは、同時発現遺伝子クラスターの生物学的期待を満たす遺伝子の共発現クラスターを抽出するように設計されている。Clustは、データ分割方法および部分的クラスタリング方法よりも低い分散レベルで共発現されたクラスターを抽出するこことを示す。著者らはまた、7つの評価metricsを使い、clustによって生成されるクラスタが他のテストされたどのツールより良好であることを示す。さらに、clustによって抽出されたクラスターのfunctional termsが、他の方法によって生成されたものよりも同等に、または大幅に豊富であることを示す。最後に、clustを使い複数のデータセットで一貫して同時発現する遺伝子のクラスタを抽出し、このclustを活用することで、研究者が複数のデータセットを活用して、高精度に co-expressedの遺伝子クラスターを同定可能になることを示す。

 

f:id:kazumaxneo:20181027194058p:plain

 

Githubより

 

Features (Githubより)

  1. No need to pre-process your data; clust automatically normalises the data.
  2. No need to preset the number of clusters; clust finds this number automatically.
  3. You can control the tightness of the clusters by varying a single parameter -t
  4. It is okay if the datasets:
  • Were generated by different technologies (e.g. RNA-seq or microarrays)
  • Are from different species
  • Have different numbers of conditions or time points
  • Have multiple replicates for the same condition
  • Require different types of normalisation
  • Were generated in different years and laboratories
  • Have some missing values
  • Do not include every single gene in every single dataset

 

インストール

ubuntu16.04のminiconda2-4.0.5環境にてテストした(docker使用。ホストOS: mac os10.12)。

依存

Clust is a Python package that requires Python 2.7 but is not compatible with Python 3 yet.

  • numpy
  • scipy
  • matplotlib
  • sklearn
  • sompy
  • joblib
  • portalocker

本体 Github

> clust

$ clust  

usage: clust [-h] [-n <file or int> [<file or int> ...]] [-r <file>]

             [-m <file>] [-o <directory>] [-t <real number>]

             [-basemethods <string> [<string> ...]]

             [-K <integer> [<integer> ...]] [-s <real number>] [-d <integer>]

             [-fil-v <real number>] [-fil-c <integer>] [-fil-d <integer>]

             [--fil-abs] [--fil-perc] [--fil-flat] [--no-fil-flat]

             [-cs <integer>] [-q3s <real number>] [--no-optimisation]

             [--deterministic] [-np <integer>]

             datapath

 

/===========================================================================\

|                                   Clust                                   |

|     Optimised consensus clustering of multiple heterogeneous datasets     |

|                              Version v1.8.4                               |

|                                                                           |

|                            By Basel Abu-Jamous                            |

|                       Department of Plant Sciences                        |

|                         The University of Oxford                          |

|                      basel.abujamous@plants.ox.ac.uk                      |

+---------------------------------------------------------------------------+

|                                 Citation                                  |

|                                 ~~~~~~~~                                  |

| When publishing work that uses Clust, please cite:                        |

| Basel Abu-Jamous and Steven Kelly (2018) Clust: automatic extraction of   |

| optimal co-expressed gene clusters from gene expression data. Genome      |

| Biology 19:172; doi: https://doi.org/10.1186/s13059-018-1536-8.           |

+---------------------------------------------------------------------------+

| Full description of usage can be found at:                                |

| https://github.com/BaselAbujamous/clust                                   |

\===========================================================================/

 

positional arguments:

  datapath              The directory that includes the data files.

 

optional arguments:

  -h, --help            show this help message and exit

  -n <file or int> [<file or int> ...]

                        Normalisation file or list of codes (default: 1000)

  -r <file>             Replicates structure file

  -m <file>             OrthoGroups (OGs) mapping file

  -o <directory>        Output directory

  -t <real number>      Cluster tightness (default: 1.0).

  -basemethods <string> [<string> ...]

                        One or more base clustering methods (default: k-means)

  -K <integer> [<integer> ...]

                        K values, e.g. 2 4 6 10 ... (default: 4 to 20 (step=4))

  -s <real number>      Outlier standard deviations (default: 3.0)

  -d <integer>          Min datasets in which a gene must exist (default: 1)

  -fil-v <real number>  Filtering: gene expression threshold (default: -inf)

  -fil-c <integer>      Filtering: number of conditions (default: 0)

  -fil-d <integer>      Filtering: number of datasets (default: 0)

  --fil-abs             Filter using absolute values of expression

  --fil-perc            -fil-v is a percentile of genes rather than raw value

  --fil-flat            Filter out genes with flat expression profiles (default)

  --no-fil-flat         Cancels the default --fil-flat option

  -cs <integer>         Smallest cluster size (default: 11)

  -q3s <real number>    Q3s defining outliers (default: 2.0)

  --no-optimisation     Skip cluster optimsation & completion

  --deterministic       Obsolete as all steps are already deterministic (v1.7.4+)

  -np <integer>         Number of parallel processes (default: 1)

gene expressionのファイルをディレクトリに用意すればランできる。書式は、1列目にgene ID、1行目にユニークな名前(下の画像 (Githubより) )。タブ区切りにする。

f:id:kazumaxneo:20181027204431p:plain

#実行方法 - ファイルをinput/にいれているなら
clust input/

 

 

テストラン 

ここでは3つの異なる生物種から replicatesデータ数も異なるデータセット画像)のクラスタリングを実行する(three datasets from two yeast species, two datasets from fission yeast, and one from budding yeast)。

Git clone https://github.com/BaselAbujamous/clust.git
cd clust/ExampleData/1_RawData/

#Data/のX1.txt、X2.txt、X3.txtを入力としてクラスタリングを実行
clust Data/ -r Replicates.txt -n Normalisation.txt -m MapIDs.txt

1データセットに複数のreplicatesがある時は、 画像(リンク)のようなファイルを準備して、上のテストのように"-r replicates_file"で指定する。複数の生物種のデータセットからのクラスタリング時は"-m MapIDs.txt"で指定する(Data from multiple species)。複数のトランスクリプトームテクニックからのクラスタリングData from multiple technologies (e.g. mixing RNA-seq and microarrays)にも対応している。

解析

/===========================================================================\

|                              RESULTS SUMMARY                              |

+---------------------------------------------------------------------------+

| Clust received 3 datasets with 9332 unique genes. After filtering, 9330   |

| genes made it to the clustering step. Clust generated 14 clusters of      |

| genes, which in total include 6124 genes. The smallest cluster includes   |

| 122 genes, the largest cluster includes 1006 genes, and the average       |

| cluster size is 437.428571429 genes.                                      |

+---------------------------------------------------------------------------+

|                                 Citation                                  |

|                                 ~~~~~~~~                                  |

| When publishing work that uses Clust, please include this citation:       |

| Basel Abu-Jamous and Steven Kelly (2018) Clust: automatic extraction of   |

| optimal co-expressed gene clusters from gene expression data. Genome      |

| Biology 19:172; doi: https://doi.org/10.1186/s13059-018-1536-8.           |

+---------------------------------------------------------------------------+

| For enquiries contact:                                                    |

| Basel Abu-Jamous                                                          |

| Department of Plant Sciences, University of Oxford                        |

| basel.abujamous@plants.ox.ac.uk                                           |

| baselabujamous@gmail.com                                                  |

\===========================================================================/

kazu@becc7e791608:~/clust/ExampleData/1_RawData$ l

total 68K

正規化方法は自動で算出される(マニュアル指定は-nを使う)。数値それぞれ異なる意味がある。詳細はGithub参照

出力

f:id:kazumaxneo:20181027181900p:plain

Clust generates the following output files (Githubより)

  • A table of clustering statistics
  • A table listing genes included in each cluster
  • Pre-processed (normalised, summarised, and filtered) datasets' files
  • Plotted gene expression profiles of clusters (a PDF file)

> cat /Results_27_Oct_18/Normalisation_actual #正規化ファイル

$ cat /Results_27_Oct_18/Normalisation_actual 

X1.txt 101 4

X2.txt 101 4

X3.txt 101 3 4

>  cat Results_27_Oct_18/Summary.tsv 

$ cat Results_27_Oct_18/Summary.tsv 

Starting data and time Saturday 27 October 2018 (09:14:00)

Ending date and time Saturday 27 October 2018 (09:15:34)

Time consumed 0 hours, 1 minute, and 34 seconds

Number of datasets 3

Total number of input genes 9332

Genes included in the analysis 9330

Genes filtered out from the analysis 2

Number of clusters 14

Total number of genes in clusters 6124

Genes not included in any cluster 3206

Min cluster size 122

Max cluster size 1006

Average cluster size 437.428571429

Total number of samples (including replicates) 38

Average number of samples (including replicates) per dataset 12.6666666667

Total number of conditions 38

Average number of conditions per dataset 12.6666666667

**********************************

Genes included in all datasets 0

Genes missed from 1 dataset 4911

Genes missed from 2 datasets 4421

Genes missed from 3 datasets 0

Genes missed from more than 3 datasets 0

Clusters_Objects.tsv

f:id:kazumaxneo:20181027200217p:plain

クラスターの厳密さは-t で指定する。デフォルトは1.0(Are you obtaining noisy clusters?)。

 

すでにノーマライズ済みのデータも使うことができる。

cd ExampleData/2_Preprocessed/

#このデータにはreplicatesがない。ノーマライズの必要もないので、関連オプションは全くなしでランする。
clust Data/ -t 5 -o MyResultsDirectory/
  • -o   Output directory
  • -t    Cluster tightness (default: 1.0).

 

引用

Clust: automatic extraction of optimal co-expressed gene clusters from gene expression data

Basel Abu-Jamous, Steven Kelly

Genome Biology, 201819:172