Skip to content

residues

Filter structure files by number of residues.

ResidueFilterStatistics dataclass

Statistics for filtering files based on residue count in a specific chain.

Parameters:

Name Type Description Default
input_file Path

The path to the input file.

required
residue_count int

The number of residues.

required
passed bool

Whether the file passed the filtering criteria.

required
output_file Path | None

The path to the output file, if passed.

required

filter_files_on_residues(input_files, output_dir, min_residues, max_residues, chain='A', copy_method='copy')

Filter PDB/mmCIF files by number of residues in given chain.

Parameters:

Name Type Description Default
input_files list[Path]

The list of input PDB/mmCIF files.

required
output_dir Path

The directory where the filtered files will be written.

required
min_residues int

The minimum number of residues in chain.

required
max_residues int

The maximum number of residues in chain.

required
chain str

The chain to count residues of.

'A'
copy_method CopyMethod

The method used to copy passed files to the output directory.

'copy'

Yields:

Type Description
Generator[ResidueFilterStatistics]

Objects containing information about the filtering process for each input file.