Data I/O (sdq.io)#
sdq.io.read_h5ad
- scdiffeq.io._data._read_h5ad.read_h5ad(h5ad_path: str, silent: bool = False, annotate_path: bool = True) AnnData[source]
Read an AnnData object from a path to a .h5ad file.
- Parameters:
- Returns:
- anndata.AnnData
The (annotated) single-cell data matrix of shape n_obs × n_vars. Rows correspond to cells and columns to genes.
For more information, visit: https://anndata.readthedocs.io/en/latest/.
Notes
Documentation for AnnData: https://anndata.readthedocs.io/en/stable/
sdq.io.read_pickle
sdq.io.write_pickle
sdq.io.Project
- class scdiffeq.io.Project(path: str | Path = PosixPath('/home/runner/work/scDiffEq/scDiffEq/docs/source'), metrics_groupby: str = 'epoch', *args, **kwargs)[source]
Object container for an scDiffEq project
- metrics_groupby
Grouping method for metrics, default is “epoch”.
- Type:
Initialize the project object by providing a path.
- Parameters:
- Returns:
None
- __init__(path: str | Path = PosixPath('/home/runner/work/scDiffEq/scDiffEq/docs/source'), metrics_groupby: str = 'epoch', *args, **kwargs) None[source]
Initialize the project object by providing a path.
sdq.io.Version
- class scdiffeq.io.Version(path: Path | str = None, groupby: str = 'epoch', *args, **kwargs)[source]
scDiffEq Version object container
- _groupby
Grouping method for metrics, default is “epoch”.
- Type:
Instantiate Version by providing a path
- Parameters:
- Return type:
None
- __init__(path: Path | str = None, groupby: str = 'epoch', *args, **kwargs)[source]
Instantiate Version by providing a path
- property hparams
Check if the .yaml exists and instantiate the HParams class each time
- Returns:
Instance of HParams class if hparams.yaml exists
- Return type:
- property metrics_df: DataFrame
Check if metrics.csv path exists and read it
- Returns:
DataFrame containing the metrics if metrics.csv exists
- Return type:
pd.DataFrame
- property per_epoch_metrics
Group metrics by the specified groupby attribute
- Returns:
Instance of GroupedMetrics class
- Return type:
GroupedMetrics
- property ckpts: Dict
Format and update available checkpoints for the version
- Returns:
Dictionary of checkpoints
- Return type:
Dict
sdq.io.Checkpoint
- class scdiffeq.io.Checkpoint(path: Path | str, *args, **kwargs)[source]
Instantiates checkpoint object.
- property path: Path
Returns: pathlib.Path The path to the checkpoint.
- property version
Returns: str Version of the checkpoint.
- property F_hat
Returns: pd.DataFrame or None DataFrame containing F_hat data if the path exists, otherwise None.
sdq.io.HParams
- class scdiffeq.io.HParams(yaml_path: Path | str)[source]
scDiffEq container for HyperParams
- _yaml_file
Dictionary containing the contents of the yaml file.
- Type:
- _attrs
Formatted attribute dictionary from hparams.yaml.
- Type:
Dict[str, Any]
Initialize the HParams object by providing a path to thecorresponding yaml file (created by Lightning)
- Parameters:
yaml_path (Union[Path, str]) – Path to the hparams file created by Lightning.
- Returns:
None
- __init__(yaml_path: Path | str) None[source]
Initialize the HParams object by providing a path to thecorresponding yaml file (created by Lightning)
- __getitem__(attr: str) Any[source]
Format version key and return path
- Parameters:
attr (str) – Attribute name.
- Returns:
Any Attribute value.