Skip to content

Remove cavity lipids - #9

Merged
jaidevjoshi83 merged 2 commits into
BlankenbergLab:mainfrom
jaidevjoshi83:remove_cavity_lipids
Sep 22, 2026
Merged

jaidevjoshi83 merged 2 commits into
BlankenbergLab:mainfrom
jaidevjoshi83:remove_cavity_lipids

Conversation

@jaidevjoshi83

Copy link
Copy Markdown
Contributor

A function to detect and remove lipids inside protein cavities is added — it detects lipids that are inserted inside the protein, such as in a beta barrel, and removes them after embedding the protein in a membrane bilayer using tools like Packmol-Memgen.

jaidevjoshi83 and others added 2 commits September 21, 2026 12:45
Packmol-memgen can pack lipid tails into a protein's interior cavity
(e.g. a beta barrel) instead of only around its exterior. This adds a
`molpacd remove-lipids` command that estimates the cavity from the
protein's CA atoms and removes lipid residues centered inside it,
ported from the standalone MemGen remove_cavity_lipids.py script.

The CLI command uses a dedicated raw-PDB parser/writer
(cavity_lipids_pdb.py) instead of molpacd's Biopython-based structure
I/O, so kept lines (including TER records, segment IDs, and exact
column formatting) are copied through byte-for-byte from the input
file with no renumbering, and large multi-chain packmol-memgen output
is read completely instead of silently losing atoms to residue-id
collisions in Biopython's structure builder. A StructureData-based
`remove_cavity_lipids` is also exposed for programmatic PDB/mmCIF use.

Lipid residue names are recognized from a bundled lipid_fragments.json
(overridable via --lipid-fragments-json), matching both full lipid
names and the head/tail fragment residue names packmol-memgen writes
per lipid.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jaidevjoshi83
jaidevjoshi83 merged commit 2b9b0ce into BlankenbergLab:main Sep 22, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant