GO-Figure! 是一个基于pyhton写的GO富集小软件,方便我们拿到富集结果后直接使用命令行的形式进行可视化,绘制出具有灵活性、可重复性的图形,且可基于最新的GO数据库内容进行富集。效果图如下,若用惯了常见的气泡柱形图,这种形式也不失为一种新颖的可视化方法~

pip安装packages
首先要确保使用的python3以上
##安装软件
git clone https://gitlab.com/evogenlab/GO-Figure.git
##下载以下几个packages
pip install numpy
pip install matplotlib
pip install seaborn
pip install scikit-learn
pip install adjustText
##检测是否成功使用
python3 gofigure.py -h

重要参数
-rs/--random_seed: 相当于随机种子,图形label有重叠时候可以替换,默认1
-i/-o: 输入、输出
-a,--max_clusters: 要绘制的最大term数量(整数值)。默认= 50。
-j: 输入文件的类型
-n, --ontology: 使用哪个本体:生物过程('bpo')、分子功能('mfo')、细胞成分('cco'),还是所有本体('all')。默认就是all。
-si, --similarity_cutoff:GO terms相似性阈值介于0到1之间. Default = 0.5.
-r, --representatives: 具有作为代表的优先级的GO terms。逗号分割,如 'GO:0000001,GO:0000002
-v, --max_pvalue: 最大的p value
-so, --sort_by: 基于哪列的值进行排序
nc, --name_changes: 更改名字
.......(还有挺多有用参数,自行了解)
输入数据类型
具有以下4种类型
1. Standard input
标准的输入数据只含有两列信息:GO term 和 富集的Pvalue

2. Standard-plus input
我们也可以增添一列显著term中包含的gene数量

3. TopGO input
使用TopGO富集结果,带上行号共有以下7列数据

4. GOStats input
使用GOStats包的输出结果,包含以下7列信息,开头的几行信息可以删除。

绘图
这里我们拿自带的standard-plus_example_input.tsv文件举例进行分析
基础图形
python3 gofigure.py -i example_data/standard-plus_example_input.tsv -j standard-plus -o result
##

这里可以通过-si 参数设置阈值 , -v 设置显著性阈值
python3 gofigure.py -i example_data/standard-plus_example_input.tsv -j standard-plus -si 0.8 -v 0.00001

改变色彩
python3 gofigure.py -i example_data/standard-plus_example_input.tsv -j standard-plus -p viridis -o result

添加标签及箭头
python3 gofigure.py -i example_data/standard-plus_example_input.tsv -j standard-plus -u go-arrows -o result

更多参数及使用例子详见文档Waterhouse Lab / GO-Figure · GitLab学习。
注:更新GO-Figure!
开头的地方提到了可基于最新的GO数据库内容进行富集,就是因为该软件进行分析基于的数据主要来自于以下两个文件:
- go.obo (http://geneontology.org/docs/download-ontology/)
- goa_uniprot_all.gaf.gz (https://ftp.ebi.ac.uk/pub/databases/GO/goa/UNIPROT/) 解压后100G~左右
这两个文件是持续更新的,因此我们使用前下载这两个最新的文件,就可以富集到更加可靠的结果。
下载完毕后,我们还需要使用软件自带的脚本对这两个文件进行解析:
python3 scripts/relations.py data/go.obo > data/relations.tsv
python3 scripts/ics.py data/relations.tab goa_uniprot_all.gaf data/go.obo > data/ic.tab
至此,拿到relations.tsv和ic.tab两个文件后,我们就可以使用上述的命令行进行富集分析了~自己体验下吧!
网友评论