使用预计算数据库从基因名列表中进行富集分析
goenrichment的Python项目详细描述
去浓缩包
这个包使用一个预计算的数据库从基因名列表中执行go富集分析。 go项是用超几何检验来分析的。
去充实数据库
go图结构是从基因本体obo创建的。 文件http://current.geneontology.org/ontology/go.obo
ncbi基因
NCBI基因数据库用于将基因包含到GO术语图中。所需文件包括: ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/gene_info.gz和 ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/gene2go.gz
这些文件可以筛选为特定的分类ID。此示例适用于人类:9606
gunzip -c gene_info.gz | grep -P "^9606\t" > gene_info_${taxid}
gzip gene_info_${taxid}
gunzip -c gene2go.gz | grep -P "^9606\t" > gene2go_${taxid}
gzip gene2go_${taxid}
uniprot果阿
uniprot goa文件还可以用于向go图添加更多的基因。 完整的文件是: ftp://ftp.ebi.ac.uk/pub/databases/GO/goa/UNIPROT/goa_uniprot_all.gaf.gz
uniprot goa还包括一些预过滤的有机体:ftp://ftp.ebi.ac.uk/pub/databases/GO/goa/
tsv文件:gene<;tab>;go term
任何带有基因名和go-term之间关系的tsv文件也可以包含在数据库中。 文件只需要在第一列中包含基因名,在第二列中包含go项。 任何其他额外的列都将被忽略。
Ensembl Biomart
集成数据可以是很多,包括使用他们的biomart工具。转到Ensembl Biomart网站: http://useast.ensembl.org/biomart/。 使用此工具,可以使用 第一列是基因名,第二列是go词。
数据库创建
这个例子是给人类的。请注意,所有输入文件都应该被gzip压缩。
python ./bin/goenrichDB.py --gene_info gene_info.gz --gene2go gene2go.gz --goa_uniprot goa_uniprot_all.gaf.gz --gobo go.obo --taxid 9606 --goenrichDB goenrichDB_20190419.pickle
用法
usage: goenrichDB.py [-h] [--gene_info GENE_INFO] [--gene2go GENE2GO]
[--tsv TSV] [--goenrichDB GOENRICHDB]
[--goa_uniprot GOA_UNIPROT] [--gobo GOBO] [--taxid TAXID]
-o O
Creates pickle data structure used by "goenrich.py"
optional arguments:
-h, --help show this help message and exit
--gene_info GENE_INFO
NCBI gene_info file
--gene2go GENE2GO NCBI gene2go file
--tsv TSV TSV file with at least two columns: Gene_name<tab>GO
terms
--goenrichDB GOENRICHDB
Previous created goenrich pickle file. The new genes
will be added to this database
--goa_uniprot GOA_UNIPROT
Uniprot GOA file GAF format
--gobo GOBO UGO Obo file from Gene Ontology
--taxid TAXID Process genes for tax id if it is possible
-o O Pickle output file name
预计算数据库
我们提供一些预计算数据库https://ftp.ncbi.nlm.nih.gov/pub/goenrichment/
进行富集分析
使用脚本goenrich.py
执行分析。输入文件是一个文本文件
每行一个基因名。
./bin/goenrich.py --goenrichDB gene2GO_human.pickle -i query.tsv -o goenrich.tsv
可以从https://ftp.ncbi.nlm.nih.gov/pub/goenrichment/goenrichDB_human.pickle下载gene2GO_human.pickle
usage: goenrich.py [-h] -i I -o O [--goenrichDB GOENRICHDB]
[--min_category_depth MIN_CATEGORY_DEPTH]
[--min_category_size MIN_CATEGORY_SIZE]
[--max_category_size MAX_CATEGORY_SIZE] [--alpha ALPHA]
Calculate GO enrichment from a list of genes. Default database organism: human
optional arguments:
-h, --help show this help message and exit
-i I Input list of gene names
-o O TSV file with all results
--goenrichDB GOENRICHDB
Gene2GO pickle file created with "goenrichDB.py". If
not provided the database is loaded from:
--min_category_depth MIN_CATEGORY_DEPTH
Min GO term graph depth to include in the report.
Default: 4
--min_category_size MIN_CATEGORY_SIZE
Min number of gene in a GO term to include in the
report. Default: 3
--max_category_size MAX_CATEGORY_SIZE
Max number of gene in a GO term to include in the
report. Default: 500
--alpha ALPHA Alpha value for p-value correction. Default: 0.05
要求
- Python3.7
- 努比
- scipy
- 统计模型
- 熊猫
- 网络x
公共域通知
国家生物技术信息中心。
根据美国的条款,这个软件是“美国政府的作品” 版权法。这是作者作为美国官方职责的一部分而写的 政府雇员因此不受版权保护。这个软件是免费的 供公众使用。国家医学图书馆和美国政府没有 限制其使用或复制。
尽管已经尽了一切合理的努力来确保准确性和可靠性 在软件和数据方面,NLM和美国政府没有也不能保证 使用此软件或数据可能获得的性能或结果。NLM和 美国政府否认所有明示或暗示的保证,包括保证 性能、适销性或任何特定用途的适用性。
请在任何基于此材料的工作或产品中引用NCBI。