Skip to content

Commit

Permalink
Fixed floating evidence from issue #22
Browse files Browse the repository at this point in the history
  • Loading branch information
dustine32 committed Jul 14, 2020
1 parent bf58a2c commit 238e3bc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pathway_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def generate_model(filename, title):

total_pcs = len(p_connections.connections)
print(total_pcs, "initial pathway_connections")
skipped_count = 0

p_connections = pathway_connection_filter_protein_binding(p_connections)

Expand Down Expand Up @@ -126,8 +125,9 @@ def generate_model(filename, title):
participant_relation = HAS_OUTPUT
# mechanism -has_input/output-> entity_b
has_input_triple = (mechanism_uri, participant_relation, bpc.entity_a.uri)
model.writer.emit(*has_input_triple)
has_input_axiom = model.writer.emit_axiom(*has_input_triple)
if len(model.triples_by_ids(*has_input_triple)) == 0:
model.writer.emit(*has_input_triple)
has_input_axiom = model.find_or_create_axiom(*has_input_triple)
model.add_evidence(has_input_axiom, evidence=evidence)
if is_small_mol_catalysis:
# Skip adding causal relation
Expand Down Expand Up @@ -185,7 +185,6 @@ def generate_model(filename, title):
regulation_axiom = model.writer.emit_axiom(*regulation_triple)
model.add_evidence(regulation_axiom, evidence=evidence)

print(skipped_count, "causal statements skipped")
print(len(p_connections.connections), "pathway_connections at finish")

grouped = map(lambda x:x.id_a, p_connections.connections)
Expand Down

0 comments on commit 238e3bc

Please sign in to comment.