Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2652 - Skip Name and/or Reaction Conditions metadata fields on save to RDF if no data is available #2656

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading