Edit on GitHub

starplast.report

The figures a recipe run would go into a paper with.

Instruction 46. The application already lets a result be read on screen; this writes the same run out as a document somebody could put in a manuscript -- vector output, one page per map, and every number on it traceable to a rebuildable run.

One page per UMAP, and the alternatives are included on purpose. A run tunes several maps and keeps the best; a report that showed only the winner would hide what the choice was between, which is exactly the thing a reviewer asks about. Each page reads left to right in the order the question is actually asked: what the map's settings were, what the clustering's settings were, the map coloured by cluster, by the label it had to recover, and by the independent control -- then, underneath, how well each of those labels actually maps onto those clusters.

The three-way comparison is the point. Cluster against label says whether the structure found the biology; cluster against validation label says whether it found the biology it was ASKED about rather than something else that happens to separate genes. Those two panels sit above their own quality graphs so the eye can move between the picture and the number.

A 3D embedding drawn on paper is a projection, and the page says so. The scatter panels are components 1 and 2 of a three-component UMAP, labelled as such, because a reader who assumes they are seeing the whole map will read two clusters as touching when they are separated in the third.

HEATMAP_CLUSTERS = 24
SCATTER_LABELS = 8
def recipe_pdf(result, path: str) -> str:

Write the run to path as a PDF and return the path.

A refused recipe still gets a document: the refusal and what caused it is the result, and a reader looking for the run needs to find the reason rather than an absent file.