plinder.core.scores.mapping#

Compact residue mappings shared by search and score reconstruction.

plinder.core.scores.mapping.cigar_alignment_sql(path: Path, chain_lookup: Path) → str[source]#

DuckDB relation recovering sparse residue positions without a Python UDF.

plinder.core.scores.mapping.decode_cigar_residue_positions(alignments: DataFrame, *, chain_lookup: Path) → DataFrame[source]#

Recover selected residue pairs from CIGARs and the chain lookup.

Only selected query residues are visited; target position zero denotes a residue outside the target’s selected pocket/interface residues.

plinder.core.scores.mapping.pack_residue_identities(values: Iterable[bool]) → bytes[source]#

Pack residue identity flags least-significant bit first.

plinder.core.scores.mapping.unpack_residue_identities(value: object, count: int) → list[bool][source]#

Expand count flags from a packed identity bitset.

plinder.core.scores.mapping.expand_residue_positions(alignments: DataFrame, *, chain_lookup: Path) → DataFrame[source]#

Expand compact chain-relative positions to label-sequence numbers.