Skip to content

combined

CombinedFilterQuery dataclass

Query object to apply combined filtering.

Parameters:

Name Type Description Default
min_confidence Annotated[float, Parameter(validator=Number(lte=100, gte=0))]

Minimal confidence (plDDT) for AlphaFold structures to pass the filter.

70.0
min_residues NonNegativeInt

Min residues in chain A.

0
max_residues PositiveInt

Max residues in chain A.

10000000
min_geometry_quality float

Minimal geometry quality score to pass the filter.

50.0
min_sequence_identity NormFloat

Minimum sequence identity ratio to the Uniprot sequence for a structure to be passed. If not set then discards structures that are not fully identical to the Uniprot sequence. For example if set to 0.8 then structures that have sequence identity below 0.8 are discarded.

1.0
top_uniprot_cluster NonNegativeInt

Maximum number of files to keep for structures per cluster per Uniprot accession. Alphafold structures are excluded from this limit.

1000
top_non_uniprot NonNegativeInt

Maximum number of files to keep for structures without Uniprot accession.

0

CombinedFilterResult dataclass

Result of combined filtering.

Compatible with SortableStructure protocol.

Parameters:

Name Type Description Default
input_file Path | None

Path to the input structure file.

None
pdb_id str | None

PDB ID of the structure.

None
metadata StructureMetadata | None

Structure metadata.

None
high_confidence_residues_count int | None

Number of residues with high confidence (plDDT) for AlphaFold structures.

None
geometry_quality float | None

Geometry quality score.

None
passed bool

Whether the structure passed the filter.

False
reason str | None

Reason for failure if the structure did not pass the filter.

None
output_file Path | None

Path to the output structure file if the structure passed the filter.

None

CombinedPartitions dataclass

Partitions of structures and results.

Used internally by the combined_filter function.

Attributes:

Name Type Description
uniprot_with_resolution list[ResolutionOrGeometryQualityClusterableStructure]

Structures with UniProt accession and resolution.

uniprot_with_geometry_quality list[ResolutionOrGeometryQualityClusterableStructure]

Structures with UniProt accession and geometry quality.

resolution_only list[CombinedFilterResult]

Structures with resolution but no UniProt accession.

geometry_quality_only list[CombinedFilterResult]

Structures with geometry quality but no UniProt accession.

processed list[CombinedFilterResult]

Results of structures that have been processed.

ResolutionOrGeometryQualityClusterableStructure dataclass

Structure that can be clustered.

Compatible with ClusterableStructure protocol.

Used internally by the combined_filter function.

Parameters:

Name Type Description Default
input_file Path

Path to the input structure file.

required
metadata StructureMetadata

Structure metadata.

required
geometry_quality float | None

Geometry quality score.

None

combined_filter(input_files, scores, filters, output_dir, copy_method='hardlink', scheduler_address=None)

Combined filter for PDB/mmCIF files.

Rules:

  • All non-AlphaFold structures are filtered by number of residues in chain A. See protein-quest filter residue --help for details.
  • All non-AlphaFold structures with Uniprot accession are filtered by sequence identity.
  • AlphaFold structures are filtered by confidence (plDDT) and afterwards by number of residues in chain A. See protein-quest filter confidence --help for details.
  • Structures with uniprot accession and resolution are filtered by grouping/clustering and sorting cluster members by resolution. See protein-quest filter resolution --help for details.
  • Structures with Uniprot accesion and without resolution are filtered by grouping/clustering and sorting cluster members by PDBe quality scores.
  • Structures without Uniprot accession and with resolution are filtered/sorted by resolution.
  • Structures without Uniprot accession and without resolution are filtered by PDBe quality scores.
  • Structures without Uniprot accession, without resolution and without PDBe quality scores are discarded.
flowchart TD
    A[Input PDB/mmCIF files] --> B{AlphaFold structure?}

    B -->|Yes| C[Filter by confidence plDDT]
    C --> D[Filter by residues in chain A]

    B -->|No| F[Filter by residues in chain A]
    F --> U[Filter by sequence identity]
    U --> G{UniProt accession?}

    G -->|Yes| H{Resolution available?}
    H -->|Yes| I[Group by UniProt accession and cluster by residue ranges]
    I --> J[Sort cluster members by resolution]
    J --> K[Keep up to top_uniprot_cluster per cluster]

    H -->|No| L[Group by UniProt accession and cluster by residue ranges]
    L --> M[Sort cluster members by PDBe quality]
    M --> N[Keep up to top_uniprot_cluster per cluster]

    G -->|No| O{Resolution available?}
    O -->|No| P[Sort by PDBe quality]
    P --> R[Select up to top_non_uniprot entries]
    O -->|Yes| S[Sort by resolution]
    S --> T[Select up to top_non_uniprot entries]

    D --> Q[Write output structure files]
    K --> Q
    N --> Q
    R --> Q
    T --> Q

Parameters:

Name Type Description Default
input_files list[Path]

List of input PDB/mmCIF files.

required
scores dict[str, Scores]

Dictionary of PDB IDs to PDBe scores.

required
filters CombinedFilterQuery

Combined filter query.

required
output_dir Path

Directory to write output structure files.

required
copy_method CopyMethod

Method to copy files to output directory.

'hardlink'
scheduler_address SchedulerAddress

Address of the Dask scheduler for parallel processing.

None

Returns:

Type Description
list[CombinedFilterResult]

List of results.