packing_defect.run_defect

CLI entrypoint for packing-defect analysis.

Provides a convenience builder for a PackingDefectAnalyzer and a command-line interface that mirrors the common options used in notebooks.

Examples

Run against a topology and trajectory and write outputs to a folder:

python -m packing_defect.run_defect       --top system.gro       --traj traj.xtc       --out results       --leaflet both --start 0 --stop 100 --stride 1

Functions

build_packing_analyzer(top_file, traj_file, ...)

Construct a PackingDefectAnalyzer configured for a typical workflow.

packing_defect.run_defect.build_packing_analyzer(top_file: str, traj_file: str, out_dir: str, class_json: str | None = None, leaflet: str = 'both', start: int | None = None, stop: int | None = None, stride: int = 1)[source]

Construct a PackingDefectAnalyzer configured for a typical workflow.

Parameters:
  • top_file (str) – Topology file readable by MDAnalysis (e.g., GRO, PSF, PDB).

  • traj_file (str) – Trajectory file (e.g., XTC, DCD) aligned with top_file.

  • out_dir (str) – Directory where results and artifacts will be written.

  • class_json (str, optional) – Path to a user JSON classification mapping. If omitted, uses DefaultClassification.

  • leaflet ({"both", "up", "dw"}, optional) – Which leaflet(s) to analyze.

  • start (int, optional) – Frame slicing parameters (as in trajectory[start:stop:stride]).

  • stop (int, optional) – Frame slicing parameters (as in trajectory[start:stop:stride]).

  • stride (int, optional) – Frame slicing parameters (as in trajectory[start:stop:stride]).

Returns:

Configured analyzer instance ready to run().

Return type:

PackingDefectAnalyzer