Customise display and IDs
How to use set_summary_display to transform data store summary output into richer objects, and set_id_from_source to control how unique identifiers are extracted from data.
Summary display default
By default, summary properties like .describe return Python primitive types like dict and list.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
Customising summary display
You can register a customised display function for your project. For cogent3, it converts them into cogent3 Table objects:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
This results in the following:
1 2 3 4 5 6 7 8 9 10 | |
Note
cogent3 registers this transformation automatically when you import cogent3.app, so you get Table output without any setup in cogent3 projects.
Unsetting the display function
Reset the display function and revert to the default scinexus behaviour as follows:
set_summary_display(None)
Default unique ID extraction
Being able to extract unique identifiers for individual data objects is fundamental to the ability of scinexus to track provenance of individual results. Because of its roots from cogent3, the scinexus default get_unique_id function extracts this information from a .source attribute. That function, strips format suffixes from file names to derive unique keys for data store records.
1 2 3 4 5 6 7 | |
Customising unique ID extraction
Register a custom extractor when your naming convention differs:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
Reset to default
1 2 3 | |
Over-riding the default per-call
You can also override per-call without affecting the global default:
result = app.apply_to(dstore, id_from_source=extract_ensembl_id)