Commit 0afa0d5e authored by hh1966's avatar hh1966
Browse files

Add CIT_ID to reactions in UDM export

parent ef9d884d
Pipeline #45610 failed with stage
......@@ -216,7 +216,10 @@ module Export
# xml.LINKS
# xml.GROUPS
# xml.ANIMALS
# xml.CIT_ID
fetch_reaction_literature(uuid).each do |literature_uuid, _|
xml.CIT_ID literature_uuid
end
end
def build_reactants(xml, uuid, fields)
......@@ -348,5 +351,22 @@ module Export
uuids.include? uuid
end
end
def fetch_reaction_literature(reaction_uuid)
# fetch literals for this reaction
literals = @data.fetch('Literal', {}).select do |uuid, fields|
fields.fetch('element_type') == "Reaction" && fields.fetch('element_id') == reaction_uuid
end
# create an array of the literature uuids
uuids = literals.values.map do |literal|
literal.fetch('literature_id')
end
# filter samples according to literature uuids and return
return @data.fetch('Literature', {}).select do |uuid, _|
uuids.include? uuid
end
end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment