modos.io#

Attributes#

Functions#

extract_cram_metadata(cram)

Extract metadata from the CRAM file header and

dict_to_instance(element)

get_loader(path)

Get a loader based on the file extension using regex.

parse_instance(path, target_class)

Load a model of target_class from a file.

parse_attributes(path)

Load model specification from file into a list of dictionaries. Model types must be specified as @type

parse_multiple_instances(path)

Load one or more model from file. Model types must be specified as @type

extract_metadata(instance, base_path)

Extract metadata from files associated to a model instance

Module Contents#

modos.io.extract_cram_metadata(cram)[source]#

Extract metadata from the CRAM file header and convert specific attributes according to the modo schema.

Parameters:

cram (pysam.AlignmentFile)

Return type:

List

modos.io.dict_to_instance(element)[source]#
Parameters:

element (Mapping[str, Any])

Return type:

Any

modos.io.ext2loader[source]#
modos.io.get_loader(path)[source]#

Get a loader based on the file extension using regex.

Parameters:

path (pathlib.Path)

modos.io.parse_instance(path, target_class)[source]#

Load a model of target_class from a file.

Parameters:

path (pathlib.Path)

modos.io.parse_attributes(path)[source]#

Load model specification from file into a list of dictionaries. Model types must be specified as @type

Parameters:

path (pathlib.Path)

Return type:

List[dict]

modos.io.parse_multiple_instances(path)[source]#

Load one or more model from file. Model types must be specified as @type

Parameters:

path (pathlib.Path)

Return type:

List

modos.io.extract_metadata(instance, base_path)[source]#

Extract metadata from files associated to a model instance

Parameters:

base_path (pathlib.Path)

Return type:

List