isograph.io.artifacts

Dataset artifact I/O.

class isograph.io.artifacts.DatasetBundle(manifest, sample_table, feature_tables, matrices, truth_tables)
Parameters:
  • manifest (DatasetManifest)

  • sample_table (DataFrame)

  • feature_tables (dict[str, DataFrame])

  • matrices (dict[str, ndarray])

  • truth_tables (dict[str, DataFrame])

manifest: DatasetManifest
sample_table: DataFrame
feature_tables: dict[str, DataFrame]
matrices: dict[str, ndarray]
truth_tables: dict[str, DataFrame]
isograph.io.artifacts.save_dense_matrix(path, matrix)
Return type:

None

Parameters:
  • path (Path)

  • matrix (ndarray)

isograph.io.artifacts.load_dense_matrix(path)
Return type:

ndarray

Parameters:

path (Path)

isograph.io.artifacts.save_dataset_bundle(bundle, output_dir)
Return type:

Path

Parameters:
isograph.io.artifacts.load_dataset_bundle(dataset_dir)
Return type:

DatasetBundle

Parameters:

dataset_dir (Path)

isograph.io.artifacts.describe_dataset(dataset_dir)
Return type:

LoadedDataset

Parameters:

dataset_dir (Path)

isograph.io.artifacts.validate_bundle_inputs(sample_table, transcript_table, transcript_counts, gene_table=None, gene_counts=None)

Validate raw inputs before building a dataset bundle.

Checks alignment rules, required columns, and data integrity. Raises ValueError listing all violations found (not just the first).

Parameters:
  • sample_table (DataFrame) – One row per sample. Must contain sample_id. Column order must match the column order of every matrix.

  • transcript_table (DataFrame) – One row per transcript. Must contain transcript_id and gene_id. Row order must match the row order of transcript_counts.

  • transcript_counts (ndarray) – Dense count matrix of shape (n_transcripts, n_samples).

  • gene_table (DataFrame | None) – Optional. One row per gene. Must contain gene_id when provided. Row order must match the row order of gene_counts.

  • gene_counts (ndarray | None) – Optional. Dense count matrix of shape (n_genes, n_samples). Required when gene_table is provided, and vice versa.

Return type:

None

isograph.io.artifacts.build_feature_spec(kind, filename, table)
Return type:

FeatureTableSpec

Parameters:
  • kind (str)

  • filename (str)

  • table (DataFrame)

isograph.io.artifacts.build_matrix_spec(name, filename, matrix)
Return type:

MatrixSpec

Parameters:
  • name (str)

  • filename (str)

  • matrix (ndarray)