pulsatrix 1.1.0
Loading...
Searching...
No Matches
protein_views.hpp
Go to the documentation of this file.
1
15#pragma once
16
17#include <cstdint>
18#include <string>
19
22#include "pulsatrix/viz/svg.hpp"
23
24namespace pulsatrix {
25
27inline constexpr const char* k3DmolVersion = "2.5.5";
28
37[[nodiscard]] std::string RenderMutationMapSvg(const MutationMapDocument& doc, const SvgOptions& options = {});
38
48[[nodiscard]] std::string RenderSequenceLogoSvg(const SequenceLogoDocument& doc, const SvgOptions& options = {});
49
53 int64_t min_separation = 6;
54};
55
66[[nodiscard]] std::string RenderContactMapSvg(const ContactMapDocument& doc, const ContactMapViewOptions& view = {},
67 const SvgOptions& options = {});
68
75[[nodiscard]] std::string RenderResidueTracksSvg(const ResidueTracksDocument& doc, const SvgOptions& options = {});
76
77// ---- pages ----------------------------------------------------------------------------------
78// Each page holds the SVG figure inline; HtmlOptions::width sets its width and title its heading.
79// Scripts options are ignored: the pages have none.
80
81[[nodiscard]] std::string RenderMutationMapHtml(const MutationMapDocument& doc, const HtmlOptions& options = {});
82[[nodiscard]] std::string RenderSequenceLogoHtml(const SequenceLogoDocument& doc, const HtmlOptions& options = {});
83[[nodiscard]] std::string RenderContactMapHtml(const ContactMapDocument& doc, const ContactMapViewOptions& view = {},
84 const HtmlOptions& options = {});
85[[nodiscard]] std::string RenderResidueTracksHtml(const ResidueTracksDocument& doc, const HtmlOptions& options = {});
86
107[[nodiscard]] std::string RenderStructureHtml(const std::string& structure, const std::string& chain,
108 const ResidueTracksDocument& tracks, const HtmlOptions& options = {});
109
117[[nodiscard]] std::string StructurePanelHtml(const std::string& structure, const std::string& chain, const ResidueTracksDocument& tracks,
118 const HtmlOptions& options, const std::string& id);
119
128[[nodiscard]] std::string RenderFeatureDashboardHtml(const FeatureDashboardDocument& doc, const std::string& structure,
129 const std::string& chain, size_t example, const HtmlOptions& options = {});
130
131} // namespace pulsatrix
Self-contained HTML views of the viz documents (VIZ-3): interactive Vega-Lite charts with tooltips,...
Definition acquisition_functions.hpp:16
std::string RenderMutationMapSvg(const MutationMapDocument &doc, const SvgOptions &options={})
A mutation map: a row per letter of the alphabet, a column per residue, each cell colored by its scor...
std::string RenderResidueTracksHtml(const ResidueTracksDocument &doc, const HtmlOptions &options={})
std::string RenderFeatureDashboardHtml(const FeatureDashboardDocument &doc, const HtmlOptions &options={}, const std::string &extra_html="")
The feature's statistics, its activation histogram, and its top examples with each token shaded by it...
std::string RenderStructureHtml(const std::string &structure, const std::string &chain, const ResidueTracksDocument &tracks, const HtmlOptions &options={})
A 3D structure, drawn as a cartoon with 3Dmol.js, with the residues of chain colored by one of tracks...
constexpr const char * k3DmolVersion
The 3Dmol.js version the structure page loads.
Definition protein_views.hpp:27
std::string RenderResidueTracksSvg(const ResidueTracksDocument &doc, const SvgOptions &options={})
Residue tracks: a ruler and the sequence, then a row of colored cells per track (signed tracks diverg...
std::string StructurePanelHtml(const std::string &structure, const std::string &chain, const ResidueTracksDocument &tracks, const HtmlOptions &options, const std::string &id)
RenderStructureHtml's viewer as a fragment to place in any page: the track menu, the legend,...
std::string RenderContactMapHtml(const ContactMapDocument &doc, const ContactMapViewOptions &view={}, const HtmlOptions &options={})
std::string RenderSequenceLogoHtml(const SequenceLogoDocument &doc, const HtmlOptions &options={})
std::string RenderMutationMapHtml(const MutationMapDocument &doc, const HtmlOptions &options={})
std::string RenderContactMapSvg(const ContactMapDocument &doc, const ContactMapViewOptions &view={}, const SvgOptions &options={})
A contact map: one square, residue against residue. Above the diagonal, the predicted scores (white t...
std::string RenderSequenceLogoSvg(const SequenceLogoDocument &doc, const SvgOptions &options={})
A sequence logo: at each position, the letters stacked to the position's information content in bits ...
Viz documents for proteins (PLM-5): the mutation map, the sequence logo, the contact map and residue ...
pulsatrix.contact_map.v1: predicted contacts between a sequence's residues, and the true ones when a ...
Definition protein_documents.hpp:105
Options for RenderContactMapSvg.
Definition protein_views.hpp:51
int64_t min_separation
The best-scored pairs at least this many residues apart are marked: L of them.
Definition protein_views.hpp:53
pulsatrix.feature_dashboard.v1: one learned feature (for example a sparse autoencoder unit) with its ...
Definition document.hpp:204
Options for every HTML view.
Definition html.hpp:36
pulsatrix.mutation_map.v1: a score for every substitution, residue by residue, such as a model's log-...
Definition protein_documents.hpp:31
pulsatrix.residue_tracks.v1: per-residue signals stacked under a sequence, and annotated stretches (d...
Definition protein_documents.hpp:137
pulsatrix.sequence_logo.v1: a distribution over letters at each residue, such as what a masked langua...
Definition protein_documents.hpp:62
Options shared by every SVG chart.
Definition svg.hpp:29
Dependency-free SVG figures from viz documents: bar, waterfall, heatmap, token strip,...