{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from ontobio import OntologyFactory" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "ont = OntologyFactory().create('go')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "relations=['subClassOf', 'BFO:0000050']\n", "m = ont.create_slim_mapping(subset='goslim_generic', relations=relations)\n" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['GO:0051276', 'GO:0006464']" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m['GO:0016577']" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "GO:0052060 evasion or tolerance by symbiont of host-produced nitric oxide\n", " --> GO:0044403 symbiosis, encompassing mutualism through parasitism\n", "GO:0061698 protein deglutarylation\n", " --> GO:0006464 cellular protein modification process\n", "GO:0061092 positive regulation of phospholipid translocation\n", " --> GO:0061024 membrane organization\n", "GO:0048027 mRNA 5'-UTR binding\n", " --> GO:0003729 mRNA binding\n", "GO:0048325 negative regulation of axial mesodermal cell fate determination\n", " --> GO:0008150 biological_process\n", "GO:0061444 endocardial cushion cell development\n", " --> GO:0048856 anatomical structure development\n", " --> GO:0030154 cell differentiation\n", "GO:0000332 template for synthesis of G-rich strand of telomere DNA activity\n", " --> GO:0009058 biosynthetic process\n", " --> GO:0006259 DNA metabolic process\n", " --> GO:0003677 DNA binding\n", " --> GO:0016779 nucleotidyltransferase activity\n", "GO:0034367 macromolecular complex remodeling\n", " --> GO:0008150 biological_process\n", "GO:2001238 positive regulation of extrinsic apoptotic signaling pathway\n", " --> GO:0008150 biological_process\n", "GO:0003154 BMP signaling pathway involved in determination of left/right symmetry\n", " --> GO:0048856 anatomical structure development\n", " --> GO:0007165 signal transduction\n", "GO:0098839 postsynaptic density membrane\n", " --> GO:0043226 organelle\n", " --> GO:0005886 plasma membrane\n", "GO:2001116 methanopterin-containing compound biosynthetic process\n", " --> GO:0009058 biosynthetic process\n", " --> GO:0034641 cellular nitrogen compound metabolic process\n" ] } ], "source": [ "# show the first 20 GO terms plus their mappings\n", "for n in ont.nodes()[0:20]:\n", " if n.startswith('GO:'):\n", " print('{} {}'.format(n, ont.label(n)))\n", " for x in m[n]:\n", " print(' --> {} {}'.format(x, ont.label(x)))\n" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from ontobio.assoc_factory import AssociationSetFactory\n", "\n", "MOUSE = 'NCBITaxon:10090'\n", "\n", "# Create association set\n", "# Transparently uses remote Monarch service.\n", "# (May take a few seconds to run first time, Jupyter will show '*'. BE PATIENT, do\n", "# not re-execute cell)\n", "afactory = AssociationSetFactory()\n", "aset = afactory.create(ontology=ont,\n", " subject_category='gene',\n", " object_category='function', # this is ALL GO, not just MF\n", " taxon=MOUSE)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['MGI:1349388',\n", " 'MGI:3645524',\n", " 'MGI:1916411',\n", " 'MGI:2444552',\n", " 'MGI:2444277',\n", " 'MGI:106321',\n", " 'MGI:2444891',\n", " 'MGI:1933174',\n", " 'MGI:2676815',\n", " 'MGI:2152450',\n", " 'MGI:1349400',\n", " 'MGI:88460',\n", " 'MGI:2142075',\n", " 'MGI:2654437',\n", " 'MGI:1342248',\n", " 'MGI:2179723',\n", " 'MGI:2686534',\n", " 'MGI:1918361',\n", " 'MGI:2449771',\n", " 'MGI:1202388']" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sample = aset.subjects[0:20]\n", "sample" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "MGI:1349388 Cops7b\n", " GO:0000338 protein deneddylation\n", " --> GO:0006464 cellular protein modification process\n", " GO:0008180 COP9 signalosome\n", " --> GO:0043234 protein complex\n", " --> GO:0005634 nucleus\n", " GO:0005737 cytoplasm\n", " --> GO:0005737 cytoplasm\n", " GO:0005634 nucleus\n", " --> GO:0005634 nucleus\n", " GO:0003674 molecular_function\n", " --> GO:0003674 molecular_function\n", " GO:0005654 nucleoplasm\n", " --> GO:0005654 nucleoplasm\n", "MGI:3645524 Vmn1r224\n", " GO:0003674 molecular_function\n", " --> GO:0003674 molecular_function\n", " GO:0007606 sensory perception of chemical stimulus\n", " --> GO:0050877 neurological system process\n", " GO:0005575 cellular_component\n", " --> GO:0005575 cellular_component\n", "MGI:1916411 Manbal\n", " GO:0003674 molecular_function\n", " --> GO:0003674 molecular_function\n", " GO:0016020 membrane\n", " --> GO:0005575 cellular_component\n", " GO:0016021 integral component of membrane\n", " --> GO:0005575 cellular_component\n", " GO:0005575 cellular_component\n", " --> GO:0005575 cellular_component\n", " GO:0008150 biological_process\n", " --> GO:0008150 biological_process\n", "MGI:2444552 Actbl2\n", " GO:0070062 extracellular exosome\n", " --> GO:0043226 organelle\n", " --> GO:0005615 extracellular space\n", " GO:0005737 cytoplasm\n", " --> GO:0005737 cytoplasm\n", " GO:0003674 molecular_function\n", " --> GO:0003674 molecular_function\n", " GO:0005856 cytoskeleton\n", " --> GO:0005856 cytoskeleton\n", " GO:0005615 extracellular space\n", " --> GO:0005615 extracellular space\n", " GO:0000166 nucleotide binding\n", " --> GO:0003674 molecular_function\n", " GO:0005524 ATP binding\n", " --> GO:0043167 ion binding\n", " GO:0008150 biological_process\n", " --> GO:0008150 biological_process\n", "MGI:2444277 Islr2\n", " GO:0005515 protein binding\n", " --> GO:0003674 molecular_function\n", " GO:0016021 integral component of membrane\n", " --> GO:0005575 cellular_component\n", " GO:0005886 plasma membrane\n", " --> GO:0005886 plasma membrane\n", " GO:0045773 positive regulation of axon extension\n", " --> GO:0048856 anatomical structure development\n", " --> GO:0030154 cell differentiation\n", " GO:0007275 multicellular organism development\n", " --> GO:0048856 anatomical structure development\n", " GO:0016020 membrane\n", " --> GO:0005575 cellular_component\n", " GO:0007399 nervous system development\n", " --> GO:0048856 anatomical structure development\n", " GO:0009986 cell surface\n", " --> GO:0005623 cell\n", "MGI:106321 Dock9\n", " GO:0045296 cadherin binding\n", " --> GO:0003674 molecular_function\n", " GO:0005085 guanyl-nucleotide exchange factor activity\n", " --> GO:0003674 molecular_function\n", " --> GO:0008150 biological_process\n", " GO:0017048 Rho GTPase binding\n", " --> GO:0019899 enzyme binding\n", " GO:0005089 Rho guanyl-nucleotide exchange factor activity\n", " --> GO:0003674 molecular_function\n", " --> GO:0008150 biological_process\n", " GO:0007264 small GTPase mediated signal transduction\n", " --> GO:0007165 signal transduction\n", " GO:0043547 positive regulation of GTPase activity\n", " --> GO:0008150 biological_process\n", " GO:0016020 membrane\n", " --> GO:0005575 cellular_component\n", "MGI:2444891 Abra\n", " GO:0015031 protein transport\n", " --> GO:0006810 transport\n", " GO:0030016 myofibril\n", " --> GO:0043226 organelle\n", " --> GO:0005737 cytoplasm\n", " GO:0015629 actin cytoskeleton\n", " --> GO:0005856 cytoskeleton\n", " GO:0035025 positive regulation of Rho protein signal transduction\n", " --> GO:0008150 biological_process\n", " GO:0006810 transport\n", " --> GO:0006810 transport\n", " GO:0005737 cytoplasm\n", " --> GO:0005737 cytoplasm\n", " GO:0003779 actin binding\n", " --> GO:0008092 cytoskeletal protein binding\n", " GO:0000060 protein import into nucleus, translocation\n", " --> GO:0006913 nucleocytoplasmic transport\n", " GO:0030017 sarcomere\n", " --> GO:0043226 organelle\n", " --> GO:0005737 cytoplasm\n", " GO:0005856 cytoskeleton\n", " --> GO:0005856 cytoskeleton\n", " GO:0051091 positive regulation of sequence-specific DNA binding transcription factor activity\n", " --> GO:0008150 biological_process\n", " GO:0006355 regulation of transcription, DNA-templated\n", " --> GO:0008150 biological_process\n", " GO:0005886 plasma membrane\n", " --> GO:0005886 plasma membrane\n", " GO:0006351 transcription, DNA-templated\n", " --> GO:0009058 biosynthetic process\n", " --> GO:0034641 cellular nitrogen compound metabolic process\n", " GO:0045944 positive regulation of transcription from RNA polymerase II promoter\n", " --> GO:0008150 biological_process\n", " GO:0045893 positive regulation of transcription, DNA-templated\n", " --> GO:0008150 biological_process\n", "MGI:1933174 Bri3\n", " GO:0016020 membrane\n", " --> GO:0005575 cellular_component\n", " GO:0016021 integral component of membrane\n", " --> GO:0005575 cellular_component\n", " GO:0042802 identical protein binding\n", " --> GO:0003674 molecular_function\n", "MGI:2676815 Mir129-1\n", " GO:0045202 synapse\n", " --> GO:0005575 cellular_component\n", " GO:0060291 long-term synaptic potentiation\n", " --> GO:0008150 biological_process\n", " GO:0035195 gene silencing by miRNA\n", " --> GO:0008150 biological_process\n", "MGI:2152450 Usp3\n", " GO:0006508 proteolysis\n", " --> GO:0008150 biological_process\n", " GO:0016578 histone deubiquitination\n", " --> GO:0051276 chromosome organization\n", " --> GO:0006464 cellular protein modification process\n", " GO:0006511 ubiquitin-dependent protein catabolic process\n", " --> GO:0009056 catabolic process\n", " GO:0000278 mitotic cell cycle\n", " --> GO:0000278 mitotic cell cycle\n", " GO:0007049 cell cycle\n", " --> GO:0007049 cell cycle\n", " GO:0031647 regulation of protein stability\n", " --> GO:0008150 biological_process\n", " GO:0008234 cysteine-type peptidase activity\n", " --> GO:0008233 peptidase activity\n", " GO:0008270 zinc ion binding\n", " --> GO:0043167 ion binding\n", " GO:0042393 histone binding\n", " --> GO:0042393 histone binding\n", " GO:0005634 nucleus\n", " --> GO:0005634 nucleus\n", " GO:0006281 DNA repair\n", " --> GO:0006259 DNA metabolic process\n", " --> GO:0006950 response to stress\n", " GO:0070938 contractile ring\n", " --> GO:0005623 cell\n", " GO:0016787 hydrolase activity\n", " --> GO:0003674 molecular_function\n", " GO:0016569 covalent chromatin modification\n", " --> GO:0051276 chromosome organization\n", " GO:0008233 peptidase activity\n", " --> GO:0008233 peptidase activity\n", " GO:0004843 thiol-dependent ubiquitin-specific protease activity\n", " --> GO:0008233 peptidase activity\n", " GO:0000790 nuclear chromatin\n", " --> GO:0000228 nuclear chromosome\n", " GO:0016579 protein deubiquitination\n", " --> GO:0006464 cellular protein modification process\n", " GO:0006974 cellular response to DNA damage stimulus\n", " --> GO:0006950 response to stress\n", " GO:0000122 negative regulation of transcription from RNA polymerase II promoter\n", " --> GO:0008150 biological_process\n", " GO:0001046 core promoter sequence-specific DNA binding\n", " --> GO:0003677 DNA binding\n", " GO:0006355 regulation of transcription, DNA-templated\n", " --> GO:0008150 biological_process\n", " GO:0005654 nucleoplasm\n", " --> GO:0005654 nucleoplasm\n", " GO:0046872 metal ion binding\n", " --> GO:0043167 ion binding\n", " GO:0003682 chromatin binding\n", " --> GO:0003674 molecular_function\n", " GO:0036459 thiol-dependent ubiquitinyl hydrolase activity\n", " --> GO:0008233 peptidase activity\n", "MGI:1349400 Cops7a\n", " GO:0000338 protein deneddylation\n", " --> GO:0006464 cellular protein modification process\n", " GO:0008180 COP9 signalosome\n", " --> GO:0043234 protein complex\n", " --> GO:0005634 nucleus\n", " GO:0005829 cytosol\n", " --> GO:0005829 cytosol\n", " GO:0005737 cytoplasm\n", " --> GO:0005737 cytoplasm\n", " GO:0005634 nucleus\n", " --> GO:0005634 nucleus\n", " GO:0003674 molecular_function\n", " --> GO:0003674 molecular_function\n", " GO:0005654 nucleoplasm\n", " --> GO:0005654 nucleoplasm\n", "MGI:88460 Col6a2\n", " GO:0031012 extracellular matrix\n", " --> GO:0005576 extracellular region\n", "MGI:2142075 Nars2\n", " GO:0004812 aminoacyl-tRNA ligase activity\n", " --> GO:0016874 ligase activity\n", " GO:0016874 ligase activity\n", " --> GO:0016874 ligase activity\n", " GO:0006418 tRNA aminoacylation for protein translation\n", " --> GO:0006412 translation\n", " --> GO:0006520 cellular amino acid metabolic process\n", " --> GO:0006399 tRNA metabolic process\n", " GO:0005737 cytoplasm\n", " --> GO:0005737 cytoplasm\n", " GO:0005829 cytosol\n", " --> GO:0005829 cytosol\n", " GO:0006421 asparaginyl-tRNA aminoacylation\n", " --> GO:0006412 translation\n", " --> GO:0006520 cellular amino acid metabolic process\n", " --> GO:0006399 tRNA metabolic process\n", " GO:0006412 translation\n", " --> GO:0006412 translation\n", " GO:0000166 nucleotide binding\n", " --> GO:0003674 molecular_function\n", " GO:0005654 nucleoplasm\n", " --> GO:0005654 nucleoplasm\n", " GO:0004816 asparagine-tRNA ligase activity\n", " --> GO:0016874 ligase activity\n", " GO:0005524 ATP binding\n", " --> GO:0043167 ion binding\n", " GO:0003676 nucleic acid binding\n", " --> GO:0003674 molecular_function\n", " GO:0005739 mitochondrion\n", " --> GO:0005739 mitochondrion\n", "MGI:2654437 Asb16\n", " GO:0000151 ubiquitin ligase complex\n", " --> GO:0005622 intracellular\n", " GO:0005737 cytoplasm\n", " --> GO:0005737 cytoplasm\n", " GO:0005634 nucleus\n", " --> GO:0005634 nucleus\n", " GO:0004842 ubiquitin-protein transferase activity\n", " --> GO:0003674 molecular_function\n", " --> GO:0006464 cellular protein modification process\n", " GO:0031625 ubiquitin protein ligase binding\n", " --> GO:0019899 enzyme binding\n", " GO:0035556 intracellular signal transduction\n", " --> GO:0007165 signal transduction\n", " GO:0008150 biological_process\n", " --> GO:0008150 biological_process\n", "MGI:1342248 Slc25a17\n", " GO:0015908 fatty acid transport\n", " --> GO:0006810 transport\n", " GO:0055085 transmembrane transport\n", " --> GO:0055085 transmembrane transport\n", " GO:0015230 FAD transmembrane transporter activity\n", " --> GO:0022857 transmembrane transporter activity\n", " GO:0005779 integral component of peroxisomal membrane\n", " --> GO:0005777 peroxisome\n", " GO:0016020 membrane\n", " --> GO:0005575 cellular_component\n", " GO:0006810 transport\n", " --> GO:0006810 transport\n", " GO:0006635 fatty acid beta-oxidation\n", " --> GO:0044281 small molecule metabolic process\n", " --> GO:0006629 lipid metabolic process\n", " --> GO:0009056 catabolic process\n", " GO:0098655 cation transmembrane transport\n", " --> GO:0055085 transmembrane transport\n", " GO:0005737 cytoplasm\n", " --> GO:0005737 cytoplasm\n", " GO:0016021 integral component of membrane\n", " --> GO:0005575 cellular_component\n", " GO:0080121 AMP transport\n", " --> GO:0006810 transport\n", " GO:0005743 mitochondrial inner membrane\n", " --> GO:0005739 mitochondrion\n", " GO:0005739 mitochondrion\n", " --> GO:0005739 mitochondrion\n", " GO:0080122 AMP transmembrane transporter activity\n", " --> GO:0022857 transmembrane transporter activity\n", " GO:0015867 ATP transport\n", " --> GO:0006810 transport\n", " GO:0098656 anion transmembrane transport\n", " --> GO:0055085 transmembrane transport\n", " GO:0051087 chaperone binding\n", " --> GO:0003674 molecular_function\n", " GO:0015858 nucleoside transport\n", " --> GO:0006810 transport\n", " GO:0015228 coenzyme A transmembrane transporter activity\n", " --> GO:0022857 transmembrane transporter activity\n", " GO:0005778 peroxisomal membrane\n", " --> GO:0005777 peroxisome\n", " GO:0051724 NAD transporter activity\n", " --> GO:0003674 molecular_function\n", " --> GO:0006810 transport\n", " GO:0006839 mitochondrial transport\n", " --> GO:0006810 transport\n", " GO:0005347 ATP transmembrane transporter activity\n", " --> GO:0022857 transmembrane transporter activity\n", " GO:0015217 ADP transmembrane transporter activity\n", " --> GO:0022857 transmembrane transporter activity\n", " GO:0044610 FMN transmembrane transporter activity\n", " --> GO:0022857 transmembrane transporter activity\n", " GO:0005777 peroxisome\n", " --> GO:0005777 peroxisome\n", " GO:1901679 nucleotide transmembrane transport\n", " --> GO:0055085 transmembrane transport\n", "MGI:2179723 Casc3\n", " GO:0051028 mRNA transport\n", " --> GO:0006810 transport\n", " GO:0031965 nuclear membrane\n", " --> GO:0005635 nuclear envelope\n", " GO:0030529 intracellular ribonucleoprotein complex\n", " --> GO:0005622 intracellular\n", " GO:0000184 nuclear-transcribed mRNA catabolic process, nonsense-mediated decay\n", " --> GO:0034655 nucleobase-containing compound catabolic process\n", " GO:0031625 ubiquitin protein ligase binding\n", " --> GO:0019899 enzyme binding\n", " GO:0006810 transport\n", " --> GO:0006810 transport\n", " GO:0019899 enzyme binding\n", " --> GO:0019899 enzyme binding\n", " GO:0005737 cytoplasm\n", " --> GO:0005737 cytoplasm\n", " GO:0008298 intracellular mRNA localization\n", " --> GO:0008150 biological_process\n", " GO:0005634 nucleus\n", " --> GO:0005634 nucleus\n", " GO:0006417 regulation of translation\n", " --> GO:0008150 biological_process\n", " GO:0006397 mRNA processing\n", " --> GO:0006397 mRNA processing\n", " GO:0042802 identical protein binding\n", " --> GO:0003674 molecular_function\n", " GO:0035145 exon-exon junction complex\n", " --> GO:0043234 protein complex\n", " --> GO:0005634 nucleus\n", " GO:0003723 RNA binding\n", " --> GO:0003723 RNA binding\n", " GO:0008380 RNA splicing\n", " --> GO:0034641 cellular nitrogen compound metabolic process\n", " GO:0005515 protein binding\n", " --> GO:0003674 molecular_function\n", "MGI:2686534 A630073D07Rik\n", " GO:0003674 molecular_function\n", " --> GO:0003674 molecular_function\n", " GO:0005575 cellular_component\n", " --> GO:0005575 cellular_component\n", " GO:0008150 biological_process\n", " --> GO:0008150 biological_process\n", "MGI:1918361 Gpr39\n", " GO:0030641 regulation of cellular pH\n", " --> GO:0042592 homeostatic process\n", " GO:0008343 adult feeding behavior\n", " --> GO:0008150 biological_process\n", " GO:0042632 cholesterol homeostasis\n", " --> GO:0042592 homeostatic process\n", " GO:0016020 membrane\n", " --> GO:0005575 cellular_component\n", " GO:0000187 activation of MAPK activity\n", " --> GO:0008150 biological_process\n", " GO:0051281 positive regulation of release of sequestered calcium ion into cytosol\n", " --> GO:0042592 homeostatic process\n", " GO:0005575 cellular_component\n", " --> GO:0005575 cellular_component\n", " GO:0007186 G-protein coupled receptor signaling pathway\n", " --> GO:0007165 signal transduction\n", " GO:0042391 regulation of membrane potential\n", " --> GO:0008150 biological_process\n", " GO:0016021 integral component of membrane\n", " --> GO:0005575 cellular_component\n", " GO:0019216 regulation of lipid metabolic process\n", " --> GO:0008150 biological_process\n", " GO:0004871 signal transducer activity\n", " --> GO:0004871 signal transducer activity\n", " GO:0007165 signal transduction\n", " --> GO:0007165 signal transduction\n", " GO:0004930 G-protein coupled receptor activity\n", " --> GO:0004871 signal transducer activity\n", " GO:0060455 negative regulation of gastric acid secretion\n", " --> GO:0008150 biological_process\n", " GO:0071294 cellular response to zinc ion\n", " --> GO:0008150 biological_process\n", " GO:0035774 positive regulation of insulin secretion involved in cellular response to glucose stimulus\n", " --> GO:0008150 biological_process\n", " GO:0035483 gastric emptying\n", " --> GO:0008150 biological_process\n", " GO:0042593 glucose homeostasis\n", " --> GO:0042592 homeostatic process\n", " GO:0005886 plasma membrane\n", " --> GO:0005886 plasma membrane\n", " GO:0032024 positive regulation of insulin secretion\n", " --> GO:0008150 biological_process\n", " GO:0002024 diet induced thermogenesis\n", " --> GO:0008150 biological_process\n", " GO:0046872 metal ion binding\n", " --> GO:0043167 ion binding\n", "MGI:2449771 Cyp2r1\n", " GO:0004497 monooxygenase activity\n", " --> GO:0016491 oxidoreductase activity\n", " GO:0016705 oxidoreductase activity, acting on paired donors, with incorporation or reduction of molecular oxygen\n", " --> GO:0016491 oxidoreductase activity\n", " GO:0016491 oxidoreductase activity\n", " --> GO:0016491 oxidoreductase activity\n", " GO:0020037 heme binding\n", " --> GO:0003674 molecular_function\n", " GO:0043231 intracellular membrane-bounded organelle\n", " --> GO:0043226 organelle\n", " --> GO:0005622 intracellular\n", " GO:0005506 iron ion binding\n", " --> GO:0043167 ion binding\n", " GO:0030343 vitamin D3 25-hydroxylase activity\n", " --> GO:0044281 small molecule metabolic process\n", " --> GO:0009058 biosynthetic process\n", " --> GO:0016491 oxidoreductase activity\n", " --> GO:0006629 lipid metabolic process\n", " GO:0042359 vitamin D metabolic process\n", " --> GO:0044281 small molecule metabolic process\n", " --> GO:0006629 lipid metabolic process\n", " GO:0008395 steroid hydroxylase activity\n", " --> GO:0016491 oxidoreductase activity\n", " GO:0005783 endoplasmic reticulum\n", " --> GO:0005783 endoplasmic reticulum\n", " GO:0055114 oxidation-reduction process\n", " --> GO:0008150 biological_process\n", " GO:0016020 membrane\n", " --> GO:0005575 cellular_component\n", " GO:0046872 metal ion binding\n", " --> GO:0043167 ion binding\n", "MGI:1202388 Gas7\n", " GO:0030182 neuron differentiation\n", " --> GO:0048856 anatomical structure development\n", " --> GO:0030154 cell differentiation\n", " GO:0008360 regulation of cell shape\n", " --> GO:0008150 biological_process\n", " GO:0030154 cell differentiation\n", " --> GO:0030154 cell differentiation\n", " GO:0005737 cytoplasm\n", " --> GO:0005737 cytoplasm\n", " GO:0051017 actin filament bundle assembly\n", " --> GO:0022607 cellular component assembly\n", " --> GO:0007010 cytoskeleton organization\n", " GO:0048812 neuron projection morphogenesis\n", " --> GO:0030154 cell differentiation\n", " --> GO:0000902 cell morphogenesis\n", " GO:0001726 ruffle\n", " --> GO:0005623 cell\n", " GO:0007275 multicellular organism development\n", " --> GO:0048856 anatomical structure development\n", " GO:0030041 actin filament polymerization\n", " --> GO:0006461 protein complex assembly\n", " --> GO:0007010 cytoskeleton organization\n", " GO:0005884 actin filament\n", " --> GO:0005856 cytoskeleton\n", " GO:0007399 nervous system development\n", " --> GO:0048856 anatomical structure development\n", " GO:0051015 actin filament binding\n", " --> GO:0008092 cytoskeletal protein binding\n" ] } ], "source": [ "for g in sample:\n", " print('{} {}'.format(g,aset.label(g)))\n", " for a in aset.annotations(g):\n", " print(' {} {}'.format(a,ont.label(a)))\n", " for mn in m[a]:\n", " print(' --> {} {}'.format(mn,ont.label(mn)))\n", " \n", " " ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['GO:0006629', 'GO:0034641']" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t='GO:0006681'\n", "m[t]" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": true }, "outputs": [], "source": [ "subont=ont.subontology(relations=relations)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'GO:0006807', 'GO:0008150', 'GO:0008152', 'GO:0009987', 'GO:0044237'}" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "subont.ancestors('GO:0034641')" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'GO:0006629', 'GO:0034641'}" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "subont.filter_redundant(m[t])" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.2" } }, "nbformat": 4, "nbformat_minor": 2 }