Skip to content

confidence

ConfidenceFilterQuery dataclass

Query for filtering AlphaFoldDB structures based on confidence.

Parameters:

Name Type Description Default
confidence float

The confidence threshold for filtering residues. Residues with a pLDDT (b-factor) above this value are considered high confidence.

required
min_threshold int

The minimum number of high-confidence residues required to keep the structure.

required
max_threshold int

The maximum number of high-confidence residues required to keep the structure.

required

ConfidenceFilterResult dataclass

Result of filtering AlphaFoldDB structures based on confidence (pLDDT).

Parameters:

Name Type Description Default
input_file str

The name of the mmcif/PDB file that was processed.

required
count int

The number of residues with a pLDDT above the confidence threshold.

required
filtered_file Path | None

The path to the filtered mmcif/PDB file, if passed filter.

None

filter_file_on_residues(file, query, filtered_dir)

Filter a single AlphaFoldDB structure file based on confidence.

Parameters:

Name Type Description Default
file Path

The path to the PDB file to filter.

required
query ConfidenceFilterQuery

The confidence filter query.

required
filtered_dir Path

The directory to save the filtered PDB file.

required

Returns:

Type Description
ConfidenceFilterResult

result with filtered_file property set to Path where filtered PDB file is saved.

ConfidenceFilterResult

or None if structure was filtered out.

filter_files_on_confidence(alphafold_pdb_files, query, filtered_dir)

Filter AlphaFoldDB structures based on confidence.

Parameters:

Name Type Description Default
alphafold_pdb_files list[Path]

List of mmcif/PDB files from AlphaFoldDB to filter.

required
query ConfidenceFilterQuery

The confidence filter query containing the confidence thresholds.

required
filtered_dir Path

Directory where the filtered mmcif/PDB files will be saved.

required

Yields:

Type Description
Generator[ConfidenceFilterResult]

For each mmcif/PDB files yields whether it was filtered or not, and number of residues with pLDDT above the confidence threshold.

filter_out_low_confidence_residues(structure, allowed_residues)

Filter out residues from the structure that do not have high confidence.

Parameters:

Name Type Description Default
structure Structure

The AlphaFoldDB structure to filter.

required
allowed_residues set[int]

The set of residue sequence numbers to keep.

required

Returns:

Type Description
Structure

A new AlphaFoldDB structure with low confidence residues removed.

find_high_confidence_residues(structure, confidence)

Find residues in the structure with pLDDT confidence above the given threshold.

Parameters:

Name Type Description Default
structure Structure

The AlphaFoldDB structure to search.

required
confidence float

The confidence threshold (pLDDT) to use for filtering.

required

Yields:

Type Description
Generator[int]

The sequence numbers of residues with pLDDT above the confidence threshold.