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

Add legend graphic to CX2 network descriptions #36

Merged
merged 1 commit into from
Dec 11, 2024
Merged
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
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
Loading