Skip to content

ss

Module for dealing with secondary structure.

SecondaryStructureFilterQuery dataclass

Query object to filter on secondary structure.

Parameters:

Name Type Description Default
abs_min_helix_residues PositiveInt | None

Minimum number of residues in helices (absolute).

None
abs_max_helix_residues PositiveInt | None

Maximum number of residues in helices (absolute).

None
abs_min_sheet_residues PositiveInt | None

Minimum number of residues in sheets (absolute).

None
abs_max_sheet_residues PositiveInt | None

Maximum number of residues in sheets (absolute).

None
ratio_min_helix_residues Ratio | None

Minimum number of residues in helices (relative).

None
ratio_max_helix_residues Ratio | None

Maximum number of residues in helices (relative).

None
ratio_min_sheet_residues Ratio | None

Minimum number of residues in sheets (relative).

None
ratio_max_sheet_residues Ratio | None

Maximum number of residues in sheets (relative).

None

filter_file_on_secondary_structure(file_path, query)

Filter a structure file based on secondary structure criteria.

Parameters:

Name Type Description Default
file_path Path

The path to the structure file to analyze.

required
query SecondaryStructureFilterQuery

The filtering criteria to apply.

required

Returns:

Type Description
SecondaryStructureFilterResult

Filtering statistics and whether file passed.

filter_files_on_secondary_structure(file_paths, query)

Filter multiple structure files based on secondary structure criteria.

Parameters:

Name Type Description Default
file_paths Iterable[Path]

A list of paths to the structure files to analyze.

required
query SecondaryStructureFilterQuery

The filtering criteria to apply.

required

Yields:

Type Description
Generator[tuple[Path, SecondaryStructureFilterResult]]

For each file returns the filtering statistics and whether structure passed.

filter_on_secondary_structure(structure, query)

Filter a structure based on secondary structure criteria.

Parameters:

Name Type Description Default
structure Structure

The gemmi Structure object to analyze.

required
query SecondaryStructureFilterQuery

The filtering criteria to apply.

required

Returns:

Type Description
SecondaryStructureFilterResult

Filtering statistics and whether structure passed.

nr_of_residues_in_helix(structure)

Count the number of residues in alpha helices.

Requires structure to have secondary structure information.

Parameters:

Name Type Description Default
structure Structure

The gemmi Structure object to analyze.

required

Returns:

Type Description
int

The number of residues in alpha helices.

nr_of_residues_in_sheet(structure)

Count the number of residues in beta sheets.

Requires structure to have secondary structure information.

Parameters:

Name Type Description Default
structure Structure

The gemmi Structure object to analyze.

required

Returns:

Type Description
int

The number of residues in beta sheets.

nr_of_residues_in_total(structure)

Count the total number of residues in the structure.

Parameters:

Name Type Description Default
structure Structure

The gemmi Structure object to analyze.

required

Returns:

Type Description
int

The total number of residues in the structure.