PointClass Documentation#

The PointClass module provides the Point class for membrane manipulation.

class PointClass.point.Point(path: str | Path)[source]#

Bases: object

A class representing a membrane structure with inclusions and exclusions. Can be initialized from a point folder or built from scratch.

Examples:

# Create bilayer >>> membrane = Point.create_empty() >>> membrane.add_membrane_points(coordinates, normals)

# Create monolayer >>> monolayer = Point.create_empty(monolayer=True) >>> monolayer.add_membrane_points(coordinates, normals)

class Exclusion(data: ndarray | None = None)[source]#

Bases: object

Manages lipid exclusions in the membrane.

add_pore(point_id: int, radius: float = 1.0)[source]#

Add a pore in the lipid membrane.

Args:

point_id: Point ID where lipids should be excluded radius: Radius of exclusion zone

property count: int#

Number of exclusion points.

get_all() List[int][source]#

Get all excluded points.

class Inclusion(data: ndarray | None = None)[source]#

Bases: object

Manages protein inclusions in the membrane.

add_protein(type_id: int, point_id: int, orientation: ndarray | None = array([1, 0, 0]))[source]#

Add a protein inclusion.

Args:

type_id: Type identifier for the protein point_id: Point ID where protein should be placed orientation: Vector specifying protein orientation

property count: int#

Number of protein inclusions.

get_all() List[dict][source]#

Get all points with protein inclusions.

get_by_type(type_id: int) List[dict][source]#

Get all inclusions of a specific type.

class Membrane(data: ndarray)[source]#

Bases: object

Represents a membrane layer with associated properties.

add_points(coordinates: ndarray, normals: ndarray | None = None, domain_ids: ndarray | None = None, areas: ndarray | None = None)[source]#

Add points to the membrane layer.

Args:
coordinates: Nx3 array of point coordinates

normals: Nx3 array of normal vectors (optional) domain_ids: Array of domain IDs (optional) areas: Array of point areas (optional)

classmethod create_empty()[source]#

Create an empty membrane layer.

gaussian_curvature() ndarray[source]#

Calculate Gaussian curvature for all points.

get_points_by_domain(domain_id: int) ndarray[source]#

Get coordinates of all points in a specific domain.

property mean_curvature: ndarray#

Calculate mean curvature for all points.

add_lipids(coordinates: ndarray, normals: ndarray, domain_ids: ndarray | None = None, areas: ndarray | None = None, bilayer_spacing: float = 4.0)[source]#

convenience method to add lipids to the membrane. adds points to both leaflets offset by bilayer_spacing along the normal vectors.

args:

coordinates: nx3 array of midplane lipid positions domain_ids: array of domain ids (optional) layer: which layer to add lipids to (“both”, “inner”, or “outer”) bilayer_spacing: distance between inner and outer leaflets in nm (default=4.0)

add_membrane_points(coordinates: ndarray, normals: ndarray | None = None, domain_ids: ndarray | None = None, areas: ndarray | None = None, bilayer_spacing: float = 4.0)[source]#

Add points to membrane layer(s) with proper bilayer spacing.

Args:

coordinates: Nx3 array of point coordinates (midplane coordinates) normals: Nx3 array of normal vectors (optional) domain_ids: Array of domain IDs (optional) areas: Array of point areas (optional) bilayer_spacing: Distance between leaflets in nm (default=4.0, only used for bilayers)

classmethod create_empty(box, monolayer=False)[source]#

Create an empty Point instance.

Args:

box: Tuple of (x, y, z) box dimensions monolayer: If True, only creates outer membrane layer

save(output_path: str | Path | None = None)[source]#

Save membrane structure to files.

Args:
output_path: Path where to save the point folder. If None, saves to original location.

Backup is only created if saving to the original location.

update_domains(domain_ids: ndarray | None = None)[source]#

Update domain assignments for membrane layer(s). For bilayers, updates both leaflets. For monolayers, updates only the outer leaflet.

Args:

domain_ids: New domain assignments as numpy array