Skip to content

Commit

Permalink
Merge pull request #36 from geneontology/issue-22-legend-graphic
Browse files Browse the repository at this point in the history
Add legend graphic to CX2 network descriptions
  • Loading branch information
pkalita-lbl authored Dec 11, 2024
2 parents 4c92293 + 5d3e215 commit 2d14f0f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gocam/translation/cx2/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
"Xenopus",
]

# This graph was produced by the NDEx team based on the style attributes in our CX2 networks. This
# image gets referenced in the network description. It seems a bit fragile to have this static image
# with no process in place to update it if the style changes. But the NDEx folks were fairly
# insistent that we include a legend graphic in the network description.
LEGEND_GRAPHIC_SRC = "https://home.ndexbio.org/img/go-cam_legend_2024108_v2.png"


def _remove_species_code_suffix(label: str) -> str:
for code in SPECIES_CODES:
Expand Down Expand Up @@ -155,6 +161,7 @@ def _add_input_output_nodes(
"@context": json.dumps(go_context.as_dict()),
"name": gocam.title if gocam.title is not None else gocam.id,
"prov:wasDerivedFrom": go_converter.expand(gocam.id),
"description": f"<p><img src=\"{LEGEND_GRAPHIC_SRC}\" style=\"width: 100%;\"/></p>"
}
)
# This gets added separately so we can declare the datatype
Expand Down

0 comments on commit 2d14f0f

Please sign in to comment.