50 std::string method =
"", int64_t first_position = 1);
84 std::string_view sequence, std::string method =
"",
85 int64_t first_position = 1);
115 [[nodiscard]] int64_t
length()
const {
return static_cast<int64_t
>(
sequence.size()); }
123 const ContactMap* truth =
nullptr, std::string method =
"",
124 int64_t first_position = 1);
A tokenizer: added tokens are split out of the raw text first (longest match, earliest first); each r...
Definition text_tokenizer.hpp:166
Definition acquisition_functions.hpp:16
ContactMapDocument MakeContactMapDocument(std::string_view sequence, const ContactMap &predicted, const ContactMap *truth=nullptr, std::string method="", int64_t first_position=1)
Pairs a prediction with the structure's contacts (TrueContacts), if any.
std::vector< std::string > ResidueIds(const StructureChain &chain)
chain's residue ids, for ResidueTracksDocument::residue_ids.
SequenceLogoDocument MakeSequenceLogoDocument(const ResidueLogProbs &log_probs, const TextTokenizer &tokenizer, std::string_view sequence, std::string method="", int64_t first_position=1)
A logo from a model's log-probabilities (VariantScorer::masked_marginals or wild_type_marginals): eac...
ContactMapDocument ParseContactMapDocument(std::string_view json)
std::vector< float > InformationContent(const SequenceLogoDocument &doc)
Each position's information content in bits, log2(letters) - entropy: 0 when every letter is equally ...
JsonValue ToJson(const AttackResult &result, const AttackOptions &options)
The result as a pulsatrix.attack.v1 document, without the adversarial inputs.
MutationMapDocument MakeMutationMapDocument(std::string_view sequence, const std::vector< float > &scan, std::string method="", int64_t first_position=1)
A mutation map from VariantScorer::single_mutant_scan (L x 20, in kAminoAcids order).
ResidueTracksDocument ParseResidueTracksDocument(std::string_view json)
SequenceLogoDocument ParseSequenceLogoDocument(std::string_view json)
MutationMapDocument ParseMutationMapDocument(std::string_view json)
constexpr const char * kAminoAcids
The 20 standard amino acids, in the order SingleMutantScan's columns use.
Definition variant_scoring.hpp:47
std::vector< float > MeanSubstitutionScore(const MutationMapDocument &doc)
Each residue's mean score over its substitutions (the wild type left out): how much the model minds a...
Protein structures (PLM-4): PDB and mmCIF coordinates, residue distances and true contacts,...
pulsatrix.mutation_map.v1: a score for every substitution, residue by residue, such as a model's log-...
Definition protein_documents.hpp:31
std::string title
Definition protein_documents.hpp:32
std::vector< float > values
Row-major (residues, alphabet). NaN marks a substitution that wasn't scored.
Definition protein_documents.hpp:42
std::string alphabet
The substitutions scored at each residue, one letter each: the columns of values.
Definition protein_documents.hpp:40
std::string sequence
The wild-type sequence, one letter per residue.
Definition protein_documents.hpp:36
int64_t first_position
The number of the sequence's first residue.
Definition protein_documents.hpp:38
std::string method
How the scores were made, for example "masked_marginals". Optional.
Definition protein_documents.hpp:34
Log-probabilities of every token at each residue: length rows of vocab values.
Definition variant_scoring.hpp:39
An annotated stretch: positions start to end inclusive, in the document's numbering.
Definition protein_documents.hpp:152
std::string name
Definition protein_documents.hpp:153
int64_t start
Definition protein_documents.hpp:154
int64_t end
Definition protein_documents.hpp:155
std::string category
What kind of feature, such as "domain" or "site"; one row per category.
Definition protein_documents.hpp:157
Definition protein_documents.hpp:141
std::vector< float > values
One value per residue; NaN where there is none.
Definition protein_documents.hpp:144
std::string name
Definition protein_documents.hpp:142
bool is_signed
Signed values are drawn on a diverging scale around zero, others from zero up. A reader treats a miss...
Definition protein_documents.hpp:147
pulsatrix.residue_tracks.v1: per-residue signals stacked under a sequence, and annotated stretches (d...
Definition protein_documents.hpp:137
std::vector< std::string > residue_ids
Empty, or each residue's id in a structure: the author's number and insertion code,...
Definition protein_documents.hpp:165
std::vector< Feature > features
Definition protein_documents.hpp:159
int64_t first_position
Definition protein_documents.hpp:140
std::string title
Definition protein_documents.hpp:138
std::string sequence
Definition protein_documents.hpp:139
std::vector< Track > tracks
Definition protein_documents.hpp:149
pulsatrix.sequence_logo.v1: a distribution over letters at each residue, such as what a masked langua...
Definition protein_documents.hpp:62
std::string alphabet
Definition protein_documents.hpp:68
int64_t first_position
Definition protein_documents.hpp:67
std::string title
Definition protein_documents.hpp:63
std::vector< float > probabilities
Row-major (positions, alphabet); each row is a distribution (non-negative, summing to 1 within 1e-3).
Definition protein_documents.hpp:71
int64_t positions() const
std::string sequence
The sequence the distributions belong to (its letters are marked), or empty.
Definition protein_documents.hpp:66
std::string method
Definition protein_documents.hpp:64
A chain's residues, in file order.
Definition protein_structure.hpp:39
The tokenizer interface (TOK-1): a pipeline of normalizer, pre-tokenizer, model, post-processor and d...
Zero-shot variant effects from a protein language model (PLM-3): how much the model prefers a mutant ...