Skip to content

Commit

Permalink
Reactome v71
Browse files Browse the repository at this point in the history
  • Loading branch information
dvklopfenstein committed Jun 20, 2020
1 parent 5c31cbc commit c1a57c1
Show file tree
Hide file tree
Showing 20 changed files with 14,444 additions and 13,888 deletions.
80 changes: 78 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,85 @@

## Unreleased changes





## Reactome v71

#### Summary for Reactome v71 pathways that are not inferred
##### Pathways

|count| description
|-----|------------
|2,492| total pathways
| 508| is in disease
| 32| top-level pathway

##### 999 (40.09%) pathways have figures

|count| description
|-----|------------
| 999| generated figure or hand-drawn figurehttps://t.co/7xByA9uKKa?amp=1
| 826| generated figure
| 173| hand-drawn figure

##### 2,302 pathways (92.38%) have a publication:

```
Publications summary key:
P -> PubMed ID
B -> Book
U -> URL
```

| count | publication keys
|-------|-----------------
| 2,191 | P..
| 67 | PB.
| 34 | .B.
| 7 | P.U
| 2 | ..U
| 1 | PBU


#### Added:
* One species: Clostridium perfringens (cpe, taxid=1502)

#### Changed
* Number instances increased for relationships involving PhysicalEntity and Event except:
* Small decrease for:
* (PhysicalEntity)-[repeatedUnit]->(PhysicalEntity)
* No change for:
* (PhysicalEntity)-[entityOnOtherCell]->(PhysicalEntity)
* (Event)-[reverseReaction]->(Event)
* (Event)-[entityOnOtherCell]->(PhysicalEntity)
* (Person):
* Added about 4,000 more people (Person)
* Removed *BA Brown-Kipphut* and *MD Maines*
* (Figure):
* Number of figures reduced to 785 from 808
* Removed figure author, *Marcela Tello-Ruiz*
* Seven more pathways have figures
* (Summation):
* Added ~50 Pathway Summations
* Diseases: Added 47 and removed 4
* Node instances that were reduced:

|Node name | from | to
|----------------------|---------|------
|GO_CellularComponent | 338 | 304
|Depolymerisation | 38 | 31
|OtherEntity | 334 | 330
|Polymer | 1,518 | 1,507
|GenomeEncodedEntity | 6,909 | 5,915
|ReferenceDNASequence | 533,570 | 475,150
|OtherEntity | 334 | 330
|TopLevelPathway | 389 | 374

## Reactome v69

### Release 2019-NN-NN 0.9.5
### Release 2019-07-29 v69.00

#### Added:
* New relationships:
Expand All @@ -28,4 +104,4 @@
* ***negativelyRegulate***


Copyright (C) 2018-2019, DV Klopfenstein. All rights reserved.
Copyright (C) 2018-present, DV Klopfenstein. All rights reserved.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
[![Anaconda-Server Badge](https://anaconda.org/dvklopfenstein/reactomepy/badges/platforms.svg)](https://anaconda.org/dvklopfenstein/reactomepy)
[![Anaconda-Server Badge](https://anaconda.org/dvklopfenstein/reactomepy/badges/installer/conda.svg)](https://conda.anaconda.org/dvklopfenstein)

Explore biomolecular pathways in Reactome from the command-line or a Python script.
Explore biomolecular pathways in the Reactome graph database from the command-line or a Python script.

## Reactome

In addition to biomolecular pathways,
Reactome contains
Expand Down Expand Up @@ -75,4 +77,4 @@ _Zenodo_ | (2019) | DOI: 10.5281/zenodo.2634376
}
```

Copyright (C) 2018-2019, DV Klopfenstein. All rights reserved.
Copyright (C) 2018-present, DV Klopfenstein. All rights reserved.
12 changes: 8 additions & 4 deletions src/reactomepy/code/node/blackboxevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,14 @@ class BlackBoxEvent(ReactionLikeEvent):
'GenomeEncodedEntity', 'EntityWithAccessionedSequence',
'Complex', 'SimpleEntity', 'OtherEntity', 'Polymer']),
'precedingEvent': frozenset(['Polymerisation', 'Pathway', 'BlackBoxEvent', 'Reaction']),
# 'regulatedBy': frozenset(['Regulation']),
'regulatedBy': frozenset(['NegativeRegulation', 'PositiveGeneExpressionRegulation',
'Requirement',
'PositiveRegulation', 'NegativeGeneExpressionRegulation']),
'regulatedBy': frozenset(['Regulation']),
# 'regulatedBy': frozenset([
# 'PositiveRegulation', # <- regulatedBy <- [4]
# 'NegativeRegulation', # <- regulatedBy <- [4]
# 'PositiveGeneExpressionRegulation', # <- regulatedBy <- [1]
# 'NegativeGeneExpressionRegulation', # <- regulatedBy <- [2]
# 'Requirement',
# ]),
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/reactomepy/code/node/catalystactivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ class CatalystActivity(DatabaseObject):
'GenomeEncodedEntity', 'EntityWithAccessionedSequence',
'Complex']),
#'literatureReference': frozenset(['URL', 'Book', 'LiteratureReference']),
'literatureReference': frozenset(['LiteratureReference']),
'literatureReference': frozenset(['LiteratureReference', 'Book']),
# 'physicalEntity': frozenset(['PhysicalEntity']),
'physicalEntity': frozenset([
'CandidateSet', 'DefinedSet',
'GenomeEncodedEntity', 'EntityWithAccessionedSequence',
'Complex', 'OtherEntity', 'Polymer']),
'Complex', 'OtherEntity', 'Polymer', 'SimpleEntity']),
}

def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion src/reactomepy/code/node/catalystactivityreference.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CatalystActivityReference(ControlReference):
**ControlReference.relationships,
**{
'catalystActivity': frozenset(['CatalystActivity']),
'literatureReference': frozenset(['LiteratureReference']),
'literatureReference': frozenset(['LiteratureReference', 'Book']),
},
}
# 'activity': frozenset(['GO_MolecularFunction']),
Expand Down
2 changes: 1 addition & 1 deletion src/reactomepy/code/node/failedreaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ class FailedReaction(ReactionLikeEvent):
# 'entityOnOtherCell': frozenset(['PhysicalEntity']),
'entityOnOtherCell': frozenset(['EntityWithAccessionedSequence']),
'input': frozenset([
'ChemicalDrug', 'ProteinDrug',
'CandidateSet', 'DefinedSet',
'GenomeEncodedEntity', 'EntityWithAccessionedSequence',
'SimpleEntity', 'Complex', 'OtherEntity', 'Polymer']),
'precedingEvent': frozenset(['Reaction']),
# 'regulatedBy': frozenset(['Regulation']),
'regulatedBy': frozenset(['NegativeRegulation', 'PositiveRegulation']),
}
}
Expand Down
9 changes: 7 additions & 2 deletions src/reactomepy/code/node/negativegeneexpressionregulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
5,262 Regulation 197 NegativeGeneExpressionRegulation 151 197 0.7665 stIdVersion
"""

__copyright__ = "Copyright (C) 2018-2019, DV Klopfenstein. All rights reserved."
__copyright__ = "Copyright (C) 2018-present, DV Klopfenstein. All rights reserved."
__author__ = "DV Klopfenstein"

from reactomepy.code.node.negativeregulation import NegativeRegulation
Expand All @@ -52,11 +52,16 @@ class NegativeGeneExpressionRegulation(NegativeRegulation):
'regulator': frozenset(['CandidateSet', 'DefinedSet',
'EntityWithAccessionedSequence',
'Complex']),
'activeUnit': frozenset([
'EntityWithAccessionedSequence', 'DefinedSet', # <- activeUnit <- Regulation
'Complex', # <- activeUnit <- [4] NegReg* PosReg*
'CandidateSet', # <- activeUnit <- [3] NegReg* PosReg
]),
}
}

def __init__(self):
super(NegativeGeneExpressionRegulation, self).__init__('NegativeGeneExpressionRegulation')


# Copyright (C) 2018-2019, DV Klopfenstein. All rights reserved.
# Copyright (C) 2018-present, DV Klopfenstein. All rights reserved.
10 changes: 9 additions & 1 deletion src/reactomepy/code/node/negativeregulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ class NegativeRegulation(Regulation):
'regulator': frozenset(['CandidateSet', 'DefinedSet',
'ChemicalDrug',
'GenomeEncodedEntity', 'EntityWithAccessionedSequence',
'Complex', 'Polymer', 'SimpleEntity']),
'Complex', 'SimpleEntity']),
'activeUnit': frozenset([
'EntityWithAccessionedSequence', 'DefinedSet', # <- [5] activeUnit <- Regulation
'Complex', # <- activeUnit <- [4] NegReg* PosReg*
'CandidateSet', # <- activeUnit <- [3] NegReg* PosReg
'SimpleEntity', # <- activeUnit <- [2] NegReg PosReg
'ProteinDrug', # <- activeUnit <- [1] self
'ChemicalDrug', # <- activeUnit <- [1] self
]),
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/reactomepy/code/node/pathway.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from reactomepy.code.node.event import Event


# pylint: disable=too-few-public-methods
# pylint: disable=too-few-public-methods,line-too-long
class Pathway(Event):
"""Params seen on all Physical Entities."""

Expand All @@ -51,7 +51,7 @@ class Pathway(Event):
'figure': frozenset(['Figure']),
'relatedSpecies': frozenset(['Species']),
'crossReference': frozenset(['DatabaseIdentifier']),
'hasEvent': frozenset(['Pathway', 'TopLevelPathway',
'hasEvent': frozenset(['Pathway',
'Reaction', 'FailedReaction', 'BlackBoxEvent',
'Depolymerisation', 'Polymerisation']),
'precedingEvent': frozenset(['Pathway', 'Reaction', 'BlackBoxEvent']),
Expand Down
2 changes: 1 addition & 1 deletion src/reactomepy/code/node/polymerisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Polymerisation(ReactionLikeEvent):
'output': frozenset(['CandidateSet', 'DefinedSet',
'Complex', 'SimpleEntity', 'Polymer']),
'precedingEvent': frozenset(['Polymerisation', 'BlackBoxEvent', 'Reaction']),
'regulatedBy' : frozenset(['PositiveRegulation']),
'regulatedBy' : frozenset(['PositiveRegulation', 'NegativeRegulation']),
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/reactomepy/code/node/positivegeneexpressionregulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ class PositiveGeneExpressionRegulation(PositiveRegulation):
'Complex',
'SimpleEntity',
]),
'activeUnit': frozenset([
'EntityWithAccessionedSequence', 'DefinedSet', # <- activeUnit <- Regulation
'Complex', # <- activeUnit <- [4] NegReg* PosReg*
'CandidateSet', # <- activeUnit <- [3] NegReg* self
]),
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/reactomepy/code/node/positiveregulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ class PositiveRegulation(Regulation):
'OtherEntity',
'SimpleEntity',
]),
'activeUnit': frozenset([
'EntityWithAccessionedSequence', 'DefinedSet', # <- activeUnit <- Regulation
'Complex', # <- activeUnit <- [4] NegReg* PosReg*
'SimpleEntity', # <- activeUnit <- [2] NegReg PosReg
]),
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/reactomepy/code/node/reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ class Reaction(ReactionLikeEvent):
'Pathway']),
# 'regulatedBy': frozenset(['Regulation']),
'regulatedBy': frozenset([
'PositiveRegulation',
'Requirement', # [2] <- regulatedBy
'NegativeRegulation', # [4] <- regulatedBy
'PositiveRegulation', # [4] <- regulatedBy
'NegativeGeneExpressionRegulation', # [2] <- regulatedBy
#'PositiveGeneExpressionRegulation',
'Requirement',
'NegativeRegulation',
#'NegativeGeneExpressionRegulation']),
]),
# 'requiredInputComponent': frozenset(['PhysicalEntity']),
'requiredInputComponent': frozenset([
Expand Down
4 changes: 0 additions & 4 deletions src/reactomepy/code/node/regulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ class Regulation(DatabaseObject):

relationships = {
'literatureReference': frozenset(['LiteratureReference']),
#'regulator': frozenset(['PhysicalEntity']),
'summation': frozenset(['Summation']),
'activeUnit': frozenset(['EntityWithAccessionedSequence', 'GenomeEncodedEntity',
'CandidateSet', 'DefinedSet',
'Complex', 'SimpleEntity']),
'activity': frozenset(['GO_MolecularFunction']),
}

Expand Down
24 changes: 4 additions & 20 deletions src/reactomepy/code/node/regulationreference.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
--- RegulationReference
"""

__copyright__ = "Copyright (C) 2018-2019, DV Klopfenstein. All rights reserved."
__copyright__ = "Copyright (C) 2018-present, DV Klopfenstein. All rights reserved."
__author__ = "DV Klopfenstein"

from reactomepy.code.node.controlreference import ControlReference
Expand All @@ -22,36 +22,20 @@ class RegulationReference(ControlReference):
relationships = {
**ControlReference.relationships,
**{
#'regulation': 'Regulation',
'regulation': frozenset([
'NegativeRegulation',
'NegativeGeneExpressionRegulation',
'PositiveRegulation',
'PositiveGeneExpressionRegulation',
'Requirement',
]),
# 'catalystActivity': frozenset(['CatalystActivity']),
# 'literatureReference': frozenset(['LiteratureReference']),
# 'catalystActivity': frozenset(['CatalystActivity']),
'literatureReference': frozenset(['LiteratureReference', 'Book']),
},
}
#relationships = {
# 'activity': frozenset(['GO_MolecularFunction']),

# 'activeUnit': frozenset([
# 'CandidateSet', 'DefinedSet',
# 'GenomeEncodedEntity', 'EntityWithAccessionedSequence',
# 'Complex']),
# #'literatureReference': frozenset(['URL', 'Book', 'LiteratureReference']),
# 'literatureReference': frozenset(['LiteratureReference']),
# # 'physicalEntity': frozenset(['PhysicalEntity']),
# 'physicalEntity': frozenset([
# 'CandidateSet', 'DefinedSet',
# 'GenomeEncodedEntity', 'EntityWithAccessionedSequence',
# 'Complex', 'OtherEntity', 'Polymer']),
#}

def __init__(self):
super(RegulationReference, self).__init__('RegulationReference')


# Copyright (C) 2018-2019, DV Klopfenstein. All rights reserved.
# Copyright (C) 2018-present, DV Klopfenstein. All rights reserved.
1 change: 1 addition & 0 deletions src/reactomepy/code/node/requirement.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class Requirement(PositiveRegulation):
'Complex',
'SimpleEntity',
]),
'activeUnit': frozenset(['DefinedSet', 'EntityWithAccessionedSequence']),
}
}

Expand Down
19 changes: 16 additions & 3 deletions src/reactomepy/code/wrpy/inferredfrom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from __future__ import print_function

__copyright__ = "Copyright (C) 2018-2019, DV Klopfenstein. All rights reserved."
__copyright__ = "Copyright (C) 2018-present, DV Klopfenstein. All rights reserved."
__author__ = "DV Klopfenstein"

import os
Expand All @@ -22,6 +22,8 @@ class InferredFrom(object):
"""Print to Python all inferred Pathways and the Pathway that they are inferred from."""

QUERY = 'MATCH (hi:Pathway)<-[inferredTo]-(lo:Pathway{speciesName:"Mus musculus"}) RETURN hi, lo'
# https://github.com/reactome/graph-core/issues/3
# QUERY = 'MATCH (hi:Pathway)<-[inferredTo]-(lo:Pathway) RETURN hi, lo'

def __init__(self, gdbdr):
self.gdbdr = gdbdr # GraphDatabase.driver
Expand Down Expand Up @@ -64,15 +66,26 @@ def _init_dcts(self, fields_keep):
"""Determine pathways that are determined from another species."""
org2plo2phi = cx.defaultdict(lambda: cx.defaultdict(set))
tic = timeit.default_timer()
ctr_hi = cx.Counter()
ctr_lo = cx.Counter()
with self.gdbdr.session() as session:
res = session.run(self.QUERY)
for rec in res.records():
assert rec['lo']['isInferred']
ctr_hi[rec['hi']['speciesName']] += 1
ctr_lo[rec['lo']['speciesName']] += 1
# MATCH (hi:Pathway)<-[inferredTo]-(lo:Pathway) RETURN hi, lo
# isInferred: True False
assert rec['hi']['isInferred'], rec
# https://github.com/reactome/graph-core/issues/3
# if not rec['hi']['isInferred']:
# print(rec)
# if not rec['hi']['isInferred']:
# print(rec['hi'])
pidlo = rec['lo']['stId']
abc = pidlo.split('-')[1].lower()
org2plo2phi[abc][pidlo].add(rec['hi']['stId'])
print('HI', ctr_hi.most_common())
print('LO', ctr_lo.most_common())
print('{N} species pathways are inferred from other species'.format(N=len(org2plo2phi)))
print(sorted(org2plo2phi.keys()))
self.chk_cnts(org2plo2phi)
Expand All @@ -93,4 +106,4 @@ def chk_cnts(self, org2plo2phi):
print(ctr.most_common())


# Copyright (C) 2018-2019, DV Klopfenstein. All rights reserved.
# Copyright (C) 2018-present, DV Klopfenstein. All rights reserved.
Loading

0 comments on commit c1a57c1

Please # to comment.