Cell Cycle genes

Using Gene Ontologies (GO), create an up-to-date list of all human protein-coding genes that are know to be associated with cell cycle.

1. Download Ontologies, if necessary

# Get http://geneontology.org/ontology/go-basic.obo
from goatools.base import download_go_basic_obo
obo_fname = download_go_basic_obo()
  EXISTS: go-basic.obo

2. Download Associations, if necessary

# Get ftp://ftp.ncbi.nlm.nih.gov/gene/DATA/gene2go.gz
from goatools.base import download_ncbi_associations
gene2go = download_ncbi_associations()
  EXISTS: gene2go

3. Read associations

Normally, when reading associations, GeneID2GOs are returned. We get the reverse, GO2GeneIDs, by adding the key-word arg, “go2geneids=True” to the call to read_ncbi_gene2go.

from goatools.anno.genetogo_reader import Gene2GoReader

objanno = Gene2GoReader("gene2go", taxids=[9606])
go2geneids_human = objanno.get_id2gos(namespace='BP', go2geneids=True)

print("{N:} GO terms associated with human NCBI Entrez GeneIDs".format(N=len(go2geneids_human)))
HMS:0:00:05.295771 323,107 annotations, 19,649 genes, 18,246 GOs, 1 taxids READ: gene2go 
12285 IDs in loaded association branch, BP
12285 GO terms associated with human NCBI Entrez GeneIDs

4. Initialize Gene-Search Helper

from goatools.go_search import GoSearch

srchhelp = GoSearch("go-basic.obo", go2items=go2geneids_human)
go-basic.obo: fmt(1.2) rel(2020-01-01) 47,337 GO Terms; optional_attrs(comment def relationship synonym xref)