goatools.associations module

Routines to read in association file between genes and GO terms.

goatools.associations.dnld_assc(assc_name, go2obj=None, namespace='BP', prt=sys.stdout)[source]

Download association from http://geneontology.org/gene-associations.

goatools.associations.dnld_annotation(assc_file, prt=sys.stdout)[source]

Download gaf, gpad, or gpi from http://current.geneontology.org/annotations/

goatools.associations.read_associations(assoc_fn, anno_type='id2gos', namespace='BP', **kws)[source]

Return associatinos in id2gos format

goatools.associations.get_assoc_ncbi_taxids(taxids, force_dnld=False, **kws)[source]

Download NCBI’s gene2go. Return annotations for user-specified taxid(s).

goatools.associations.dnld_ncbi_gene_file(fin, force_dnld=False, log=sys.stdout)[source]

Download a file from NCBI Gene’s ftp server.

goatools.associations.dnld_annofile(fin_anno, anno_type)[source]

Download annotation file, if needed

goatools.associations.read_ncbi_gene2go(fin_gene2go, taxids=None, namespace='BP', **kws)[source]

Read NCBI’s gene2go. Return gene2go data for user-specified taxids.

goatools.associations.get_gaf_hdr(fin_gaf)[source]

Read Gene Association File (GAF). Return GAF version and data info.

goatools.associations.read_gaf(fin_gaf, prt=sys.stdout, hdr_only=False, namespace='BP', allow_missing_symbol=False, **kws)[source]

Read Gene Association File (GAF). Return data.

goatools.associations.get_b2aset(a2bset)[source]

Given gene2gos, return go2genes. Given go2genes, return gene2gos.

goatools.associations.get_assc_pruned(assc_geneid2gos, min_genecnt=None, max_genecnt=None, prt=sys.stdout)[source]

Remove GO IDs associated with large numbers of genes. Used in stochastic simulations.

goatools.associations.read_annotations(**kws)[source]

Read annotations from either a GAF file or NCBI’s gene2go file.

goatools.associations.get_tcntobj(go2obj, **kws)[source]

Return a TermCounts object if the user provides an annotation file, otherwise None.