Repository navigation
Remove cavity lipids - #9
Merged
jaidevjoshi83 merged 2 commits intoSep 22, 2026
Merged
Conversation
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>
# Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.