fork download
  1. import re
  2. s = """remark: Includes Ontology(OntologyID(OntologyIRI(<http://p...content-available-to-author-only...y.org/obo/go/never_in_taxon.owl>))) [Axioms: 18 Logical Axioms: 0]
  3. ontology: go
  4.  
  5. [Term]
  6. id: GO:0000001
  7. name: mitochondrion inheritance
  8. namespace: biological_process
  9. def: "The distribution of mitochondria, including the mitochondrial genome, into daughter cells after mitosis or meiosis, mediated by interactions between mitochondria and the cytoskeleton." [GOC:mcc, PMID:10873824, PMID:11389764]
  10. synonym: "mitochondrial inheritance" EXACT []
  11. is_a: GO:0048308 ! organelle inheritance
  12. is_a: GO:0048311 ! mitochondrion distribution
  13.  
  14. [Term]
  15. id: GO:0000002
  16. name: mitochondrial genome maintenance
  17. namespace: biological_process
  18. def: "The maintenance of the structure and integrity of the mitochondrial genome; includes replication and segregation of the mitochondrial chromosome." [GOC:ai, GOC:vw]
  19. is_a: GO:0007005 ! mitochondrion organization
  20.  
  21. [Term]
  22. id: GO:0000011
  23. name: vacuole inheritance
  24. namespace: biological_process
  25. def: "The distribution of vacuoles into daughter cells after mitosis or meiosis, mediated by interactions between vacuoles and the cytoskeleton." [GOC:mcc, PMID:10873824, PMID:14616069]
  26. is_a: GO:0007033 ! vacuole organization
  27. is_a: GO:0048308 ! organelle inheritance
  28.  
  29. [Typedef]
  30. id: positively_regulates
  31. name: positively regulates
  32. namespace: external
  33. xref: RO:0002213
  34. holds_over_chain: negatively_regulates negatively_regulates
  35. is_a: regulates ! regulates
  36. transitive_over: part_of ! part of
  37.  
  38. [Typedef]
  39. id: regulates
  40. name: regulates
  41. namespace: external
  42. xref: RO:0002211
  43. is_transitive: true
  44. transitive_over: part_of ! part of"""
  45. rx = r'(?m)^\[Term].*(?:\r?\n(?!\[(?:Typedef|Term)]).*)*'
  46. cnt=0
  47. for m in re.findall(rx, s):
  48. print(m)
  49. print('-------------- Next match ---------------')
  50. cnt = cnt + 1
  51.  
  52. print("Number of mathes: {}".format(cnt))
Success #stdin #stdout 0s 23304KB
stdin
Standard input is empty
stdout
[Term]
id: GO:0000001
name: mitochondrion inheritance
namespace: biological_process
def: "The distribution of mitochondria, including the mitochondrial genome, into daughter cells after mitosis or meiosis, mediated by interactions between mitochondria and the cytoskeleton." [GOC:mcc, PMID:10873824, PMID:11389764]
synonym: "mitochondrial inheritance" EXACT []
is_a: GO:0048308 ! organelle inheritance
is_a: GO:0048311 ! mitochondrion distribution

-------------- Next match ---------------
[Term]
id: GO:0000002
name: mitochondrial genome maintenance
namespace: biological_process
def: "The maintenance of the structure and integrity of the mitochondrial genome; includes replication and segregation of the mitochondrial chromosome." [GOC:ai, GOC:vw]
is_a: GO:0007005 ! mitochondrion organization

-------------- Next match ---------------
[Term]
id: GO:0000011
name: vacuole inheritance
namespace: biological_process
def: "The distribution of vacuoles into daughter cells after mitosis or meiosis, mediated by interactions between vacuoles and the cytoskeleton." [GOC:mcc, PMID:10873824, PMID:14616069]
is_a: GO:0007033 ! vacuole organization
is_a: GO:0048308 ! organelle inheritance

-------------- Next match ---------------
Number of mathes: 3