pestifer.util.densityprofile module

Species-resolved mass-density profiles \(\rho(z)\) along a bilayer normal.

Given a CHARMM/NAMD PSF (per-atom mass and residue name), a matching single-frame coordinate set (a PDB or a NAMD binary .coor), and an XSC cell file, this module computes and plots the mass density of water, lipid, protein, and ions as a function of \(z\). The bilayer midplane is placed at \(z=0\) and the bulk solvent is made continuous through the periodic boundary (so it does not spuriously read zero at the box edges). For a multicomponent bilayer the total lipid profile can be decomposed into one profile per lipid species.

The species of an atom is inferred from its residue name: explicit water, ion, and amino-acid residue-name sets are recognized, and everything else is treated as lipid. This is appropriate for the membrane-protein systems pestifer builds; the per-species sets can be overridden if needed.

This is a single-frame analysis. For a smoother, trajectory-averaged profile, average the per-frame results over a production DCD (e.g. via catdcd/VMD).

class pestifer.util.densityprofile.DensityProfile(psf, coor, xsc, **species_sets)[source]

Bases: object

Compute species-resolved mass-density profiles for one membrane frame.

compute(dz=1.0, lipid_components=False)[source]

Return (z_centers, profiles) with the midplane at z=0.

profiles is an ordered dict label -> rho(z) in g/cm^3. The canonical species present (water, lipid, protein, ion) are always included; when lipid_components is True the individual lipid residue names are added after the total lipid curve.

plot(outfile, title='', dz=1.0, lipid_components=False, figsize=(6.4, 4.4), dpi=150)[source]

Compute and render the profile to outfile; returns outfile.

pestifer.util.densityprofile.ION_RESNAMES = frozenset({'BAR', 'CAL', 'CD2', 'CES', 'CL', 'CLA', 'FE2', 'K', 'LIT', 'MG', 'NA', 'POT', 'RUB', 'SOD', 'ZN', 'ZN2'})

residue names treated as monatomic ions

pestifer.util.densityprofile.PROTEIN_RESNAMES = frozenset({'ACE', 'ALA', 'ARG', 'ASN', 'ASP', 'CT3', 'CYS', 'GLN', 'GLU', 'GLY', 'HIS', 'HSD', 'HSE', 'HSP', 'ILE', 'LEU', 'LYS', 'MET', 'NMA', 'NME', 'PHE', 'PRO', 'SER', 'THR', 'TRP', 'TYR', 'VAL'})

residue names treated as protein

pestifer.util.densityprofile.WATER_RESNAMES = frozenset({'HOH', 'OH2', 'OPC', 'SPC', 'SPCE', 'SWM4', 'TIP3', 'TIP3P', 'TIP4', 'TIP5', 'TP3M', 'WAT'})

residue names treated as water

pestifer.util.densityprofile.classify_species(resnames, water=frozenset({'HOH', 'OH2', 'OPC', 'SPC', 'SPCE', 'SWM4', 'TIP3', 'TIP3P', 'TIP4', 'TIP5', 'TP3M', 'WAT'}), ions=frozenset({'BAR', 'CAL', 'CD2', 'CES', 'CL', 'CLA', 'FE2', 'K', 'LIT', 'MG', 'NA', 'POT', 'RUB', 'SOD', 'ZN', 'ZN2'}), protein=frozenset({'ACE', 'ALA', 'ARG', 'ASN', 'ASP', 'CT3', 'CYS', 'GLN', 'GLU', 'GLY', 'HIS', 'HSD', 'HSE', 'HSP', 'ILE', 'LEU', 'LYS', 'MET', 'NMA', 'NME', 'PHE', 'PRO', 'SER', 'THR', 'TRP', 'TYR', 'VAL'}))[source]

Map an array of residue names to water/ion/protein/lipid.