Prepared Protein stamp¶
Helpers that detect and preserve the file-borne Prepared Protein stamp
(REMARK 99 DO_PREPARED) on PDB files.
Protein Prep writes this stamp onto the prepared PDB before upload. Downstream tools (Pocket Finder, Docking, System Prep) skip automatic protein cleanup when the stamp is present. The CLI must not drop it when rewriting or syncing a protein that already points at a stamped remote file.
Prepared Protein stamp: file-borne REMARK 99 DO_PREPARED token.
Mirrors the platform-toolbox stamp helper so the CLI can detect and preserve
the stamp without depending on toolbox_core. Downstream Pocket Finder,
Docking, and System Prep skip AUTO protein cleanup when the token is present.
Functions:¶
has_prepared_protein_stamp
¶
has_prepared_protein_stamp(path: str | Path) -> bool
Return True if a REMARK 99 DO_PREPARED token appears before ATOM/HETATM.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Local PDB path to inspect. |
required |
stamp_prepared_protein_pdb
¶
stamp_prepared_protein_pdb(path: str | Path) -> None
Prepend the canonical Prepared Protein stamp if it is not already present.
Uses a text prepend, not a structure rewrite, so ATOM/HETATM bytes are
unchanged. Idempotent when :func:has_prepared_protein_stamp is already
true.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Local PDB path to stamp. |
required |
Raises:
| Type | Description |
|---|---|
OSError
|
If the file cannot be read or written. |
FileNotFoundError
|
If path does not exist. |
text_has_prepared_protein_stamp
¶
text_has_prepared_protein_stamp(text: str) -> bool
Return True if a REMARK 99 DO_PREPARED token appears before ATOM/HETATM.
Whitespace around the remark number is lenient so a one-space rewrite still matches. The writer always emits the canonical two-space line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
PDB file contents as text. |
required |