Skip to content

chain

Filter structure files by chain.

filter_file_on_chain(file_and_chain, output_dir, out_chain='A', chain_system='auth', copy_method='copy', force=False)

Filter a single structure file by chain.

Parameters:

Name Type Description Default
file_and_chain tuple[Path, str]

Tuple of (structure file path, chain ID to keep). The chain ID is interpreted according to the chain_system argument.

required
output_dir Path

The directory where the filtered file will be written.

required
out_chain str

Under what name to write the kept chain. The chain system id is 'auth'.

'A'
chain_system ChainIdSystem

System for the given chain ids in file_and_chain.

'auth'
copy_method CopyMethod

How to copy when a direct copy is possible.

'copy'
force bool

Rewrite existing single-chain outputs and overwrite existing output files.

False

filter_files_on_chain(file2chains, output_dir, out_chain='A', chain_system='auth', scheduler_address=None, copy_method='copy', force=False)

Filter mmcif/PDB files by chain.

Parameters:

Name Type Description Default
file2chains Collection[tuple[Path, str]]

Which chain to keep for each PDB file. First item is the PDB file path, second item is the chain ID.

required
output_dir Path

The directory where the filtered files will be written.

required
out_chain str

Under what name to write the kept chain.

'A'
chain_system ChainIdSystem

System for the given chain ids.

'auth'
scheduler_address SchedulerAddress

The address of the Dask scheduler. If not provided, will create a local cluster. If set to sequential will run tasks sequentially.

None
copy_method CopyMethod

How to copy when a direct copy is possible.

'copy'
force bool

Rewrite existing single-chain outputs and overwrite existing output files.

False

Returns:

Type Description
list[ChainFilterStatistics]

Result of the filtering process.