Skip to content

convert

Conversion orchestration for structure files.

convert_to_cif_file(input_file, output_dir, copy_method, output_format='.cif', pdb2uniprot=None, chain_system='auth')

Convert a single structure file to CIF format.

Parameters:

Name Type Description Default
input_file Path

The structure file to convert. See StructureFileExtensions for supported extensions.

required
output_dir Path

Directory to save the converted file.

required
copy_method CopyMethod

How to copy when no changes are needed to output file.

required
output_format CifOutputFormat

Output file format to write.

'.cif'
pdb2uniprot Pdb2UniprotChainsMapping | None

Optional dictionary mapping PDB ID to structured UniProt chain mappings. If provided, will not use any shortcuts for copying files and will always read and write the structure to ensure UniProt accessions are verified and injected if necessary.

None
chain_system ChainIdSystem

System of chain ids in pdb2uniprot mapping.

'auth'

Returns:

Type Description
Path

Path to the converted file.

Raises:

Type Description
ValueError

If the requested output format is not supported.

convert_to_cif_files(input_files, output_dir, copy_method, output_format='.cif', pdb2uniprot=None, chain_system='auth')

Convert structure files to CIF format.

Parameters:

Name Type Description Default
input_files Iterable[Path]

Iterable of structure files to convert.

required
output_dir Path

Directory to save the converted files.

required
copy_method CopyMethod

How to copy when no changes are needed to output file.

required
output_format CifOutputFormat

Output file format to write.

'.cif'
pdb2uniprot Pdb2UniprotChainsMapping | None

Optional dictionary mapping PDB ID to structured UniProt chain mappings. If provided, will be used to inject UniProt accessions into structures that lack them.

None
chain_system ChainIdSystem

System of chain ids in pdb2uniprot mapping.

'auth'

Yields:

Type Description
Generator[tuple[Path, Path]]

A tuple of the input file and the output file.