Files

class emdb.models.files.AdditionalMapFile(*, filename: str, format: str | None = None, size_kbytes: float | None = None, symmetry: Dict | None = None, data_type: str, dimensions: Dict, origin: Dict, spacing: Dict, cell: Dict, axis_order: Dict, statistics: Dict | None = None, pixel_spacing: Dict, contour_list: Dict | None = None, label: str | None = None, annotation_details: str | None = None, details: str | None = None)[source]

Bases: BaseMapFile

Model for additional map files in an EMDB entry.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property source_path: str

Abstract property to get the source path of the file. Must be implemented in subclasses.

class emdb.models.files.BaseFile(*, filename: str, format: str | None = None, size_kbytes: float | None = None)[source]

Bases: BaseModel, ABC

Base model for EMDB files.

classmethod from_api(data: dict) BaseFile[source]

Create an EMDBBaseFile instance from API data.

Parameters:

data – Dictionary containing file data.

Returns:

An instance of EMDBBaseFile.

download(output_path: str)[source]

Download the file from the source path to the specified output path.

Parameters:

output_path – The local path where the file should be saved.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

filename: str
format: str | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

size_kbytes: float | None
abstract property source_path: str

Abstract property to get the source path of the file. Must be implemented in subclasses.

class emdb.models.files.BaseMapFile(*, filename: str, format: str | None = None, size_kbytes: float | None = None, symmetry: Dict | None = None, data_type: str, dimensions: Dict, origin: Dict, spacing: Dict, cell: Dict, axis_order: Dict, statistics: Dict | None = None, pixel_spacing: Dict, contour_list: Dict | None = None, label: str | None = None, annotation_details: str | None = None, details: str | None = None)[source]

Bases: BaseFile

Base model for EMDB map files.

classmethod from_api(data: dict) BaseMapFile[source]

Create an EMDBBaseMapFile instance from API data.

Parameters:

data – Dictionary containing map file data.

Returns:

An instance of EMDBBaseMapFile.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

annotation_details: str | None
axis_order: Dict
cell: Dict
contour_list: Dict | None
data_type: str
details: str | None
dimensions: Dict
label: str | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

origin: Dict
pixel_spacing: Dict
abstract property source_path: str

Abstract property to get the source path of the file. Must be implemented in subclasses.

spacing: Dict
statistics: Dict | None
symmetry: Dict | None
class emdb.models.files.EMDBMetadataCIFFile(*, filename: str, format: str | None = None, size_kbytes: float | None = None)[source]

Bases: BaseFile

Model for CIF files in an EMDB entry.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property source_path: str

Abstract property to get the source path of the file. Must be implemented in subclasses.

class emdb.models.files.EMDBMetadataXMLFile(*, filename: str, format: str | None = None, size_kbytes: float | None = None)[source]

Bases: BaseFile

Model for XML files in an EMDB entry.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property source_path: str

Abstract property to get the source path of the file. Must be implemented in subclasses.

class emdb.models.files.FigureFile(*, filename: str, format: str | None = None, size_kbytes: float | None = None)[source]

Bases: BaseFile

Model for figure files in an EMDB entry.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property source_path: str

Abstract property to get the source path of the file. Must be implemented in subclasses.

class emdb.models.files.HalfMapFile(*, filename: str, format: str | None = None, size_kbytes: float | None = None, symmetry: Dict | None = None, data_type: str, dimensions: Dict, origin: Dict, spacing: Dict, cell: Dict, axis_order: Dict, statistics: Dict | None = None, pixel_spacing: Dict, contour_list: Dict | None = None, label: str | None = None, annotation_details: str | None = None, details: str | None = None)[source]

Bases: BaseMapFile

Model for half map files in an EMDB entry.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property source_path: str

Abstract property to get the source path of the file. Must be implemented in subclasses.

class emdb.models.files.MaskFile(*, filename: str, format: str | None = None, size_kbytes: float | None = None, details: str | None = None, map_file: BaseMapFile | None = None)[source]

Bases: BaseFile

Model for mask files in an EMDB entry.

classmethod from_api(data: dict) MaskFile[source]

Create an EMDBMaskFile instance from API data.

Parameters:

data – Dictionary containing mask file data.

Returns:

An instance of EMDBMaskFile.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

details: str | None
map_file: BaseMapFile | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property source_path: str

Abstract property to get the source path of the file. Must be implemented in subclasses.

class emdb.models.files.ModelCifFile(*, filename: str, format: str | None = None, size_kbytes: float | None = None, pdb_id: str)[source]

Bases: BaseFile

Model for PDB model files in an EMDB entry.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pdb_id: str
property source_path: str

Abstract property to get the source path of the file. Must be implemented in subclasses.

class emdb.models.files.PrimaryMapFile(*, filename: str, format: str | None = None, size_kbytes: float | None = None, symmetry: Dict | None = None, data_type: str, dimensions: Dict, origin: Dict, spacing: Dict, cell: Dict, axis_order: Dict, statistics: Dict | None = None, pixel_spacing: Dict, contour_list: Dict | None = None, label: str | None = None, annotation_details: str | None = None, details: str | None = None)[source]

Bases: BaseMapFile

Model for the primary map file in an EMDB entry.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property source_path: str

Abstract property to get the source path of the file. Must be implemented in subclasses.