seismicrna.core.io package
Subpackages
Submodules
- class seismicrna.core.io.batch.MutsBatchIO(*args, section: Section, **kwargs)
Bases:
MutsBatch,ReadBatchIO,ABCPickled file of a batch of mutational data.
- class seismicrna.core.io.batch.ReadBatchIO(*, batch: int, **kwargs)
Bases:
ReadBatch,BrickleIO,ABCPickled file of a batch of data.
- classmethod btype()
- seismicrna.core.io.brickle.digest_data(data: bytes)
Compute the MD5 digest of the data as a hexadecimal number.
- seismicrna.core.io.brickle.load_brickle(file: Path, checksum: str, check_type: None | type | tuple[type, ...] = None)
Unpickle and return an object from a Brotli-compressed file.
- seismicrna.core.io.brickle.save_brickle(item: Any, file: Path, brotli_level: int = 10, force: bool = False)
Pickle an object, compress with Brotli, and save to a file.
- class seismicrna.core.io.file.BrickleIO
-
Brotli-compressed file of a Pickled object (Brickle).
- class seismicrna.core.io.file.FileIO
Bases:
ABCAny file saved by SEISMIC-RNA, rather than by a dependency.
- classmethod build_path(**path_fields)
Build the file path from the given field values.
- abstract classmethod dir_seg_types() tuple[Segment, ...]
Types of the directory segments in the path.
- path_field_values(top: Path | None = None, exclude: Iterable[str] = ())
Path field values as a dict.
- classmethod path_fields()
Path fields for the file type.
- classmethod seg_types()
Types of the segments in the path.
- class seismicrna.core.io.file.RefIO(*, sample: str, ref: str, **kwargs)
-
Saved file with a sample, command, and reference.
- classmethod dir_seg_types()
Types of the directory segments in the path.
- class seismicrna.core.io.file.SectIO(*, sect: str, **kwargs)
-
File with a section of a reference.
- classmethod dir_seg_types()
Types of the directory segments in the path.
- seismicrna.core.io.file.recast_file_path(input_path: Path, input_type: type[FileIO], output_type: type[FileIO], **override: Any)
Recast input_path from input_type to output_type.
- Parameters:
input_path (
Path) – Input path from which to take the path fields.input_type (
type[FileIO]) – Type of file to use to determine the fields in input_path.output_type (
type[FileIO]) – Type of file to use for fitting the path fields and building a new path.**override (
Any) – Override fields in input_path (but not output_type).
- Returns:
Path for file of output_type made from fields in input_path (as determined by the file of input_type).
- Return type:
Path