Skip to content

Commit

Permalink
#2652 - Skip Name and/or Reaction Conditions metadata fields on save …
Browse files Browse the repository at this point in the history
…to RDF if no data is available (#2656)
  • Loading branch information
even1024 authored Nov 27, 2024
1 parent e79b727 commit 993a320
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,6 @@ $MOL
M END
$DTYPE Name
$DATUM Published reaction
$DTYPE Reaction Conditions
$DATUM Not available
$RFMT
$RXN

Expand Down
8 changes: 0 additions & 8 deletions api/tests/integration/tests/formats/ref/pathway12.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ $DATUM 123456789012345678901234567890
123456789012345678901234567890
123456789012345678901234567890
123456789012345678901234567890...
$DTYPE Reaction Conditions
$DATUM Not available
$RFMT
$RXN

Expand Down Expand Up @@ -152,8 +150,6 @@ ABCDEFGHIJKLMNOPQRSTUVWXYZABCD
ABCDEFGHIJKLMNOPQRSTUVWXYZABCD
ABCDEFGHIJKLMNOPQRSTUVWXYZABCD
ABCDEFGHIJKLMNOPQRSTUVWXYZABCD
$DTYPE Reaction Conditions
$DATUM Not available
$RFMT
$RXN

Expand Down Expand Up @@ -340,8 +336,6 @@ M END
$DTYPE Name
$DATUM 123456789012345678901234567890
12
$DTYPE Reaction Conditions
$DATUM Not available
$RFMT
$RXN

Expand Down Expand Up @@ -466,5 +460,3 @@ $DATUM 123456789012345678901234567890
123456789012345678901234567890
123456789012345678901234567890
123456789012345678901234567890...
$DTYPE Reaction Conditions
$DATUM Not available
14 changes: 10 additions & 4 deletions core/indigo-core/reaction/src/reaction_multistep_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,11 +733,17 @@ void ReactionMultistepDetector::collectProperties(PathwayReaction::SimpleReactio
is_condition = true;
}

int id = sr.properties.insert(PathwayLayout::REACTION_NAME);
sr.properties.value(id).readString(name.empty() ? PathwayLayout::REACTION_PROPERTY_NA : name.c_str(), true);
if (name.size())
{
int id = sr.properties.insert(PathwayLayout::REACTION_NAME);
sr.properties.value(id).readString(name.c_str(), true);
}

id = sr.properties.insert(PathwayLayout::REACTION_CONDITIONS);
sr.properties.value(id).readString(condition.empty() ? PathwayLayout::REACTION_PROPERTY_NA : condition.c_str(), true);
if (condition.size())
{
int id = sr.properties.insert(PathwayLayout::REACTION_CONDITIONS);
sr.properties.value(id).readString(condition.c_str(), true);
}
}

void ReactionMultistepDetector::constructMultipleArrowReaction(BaseReaction& rxn)
Expand Down

0 comments on commit 993a320

Please sign in to comment.