tirank.Dataloader.PackData

tirank.Dataloader.PackData(savePath, mode, infer_mode, batch_size=1024)[source]

Loads all preprocessed data and packages it into PyTorch DataLoaders.

This function reads the training/validation gene pair matrices, clinical data, AnnData object, similarity matrix, and pathological labels from disk. It instantiates the Dataset classes (BulkDataset, STDataset, SCDataset) and wraps them in DataLoader objects. It also prepares the adjacency matrix (adj_A) and pathological labels (patholabels) for the model.

All resulting DataLoader objects and supporting data are saved to the ‘3_Analysis/data2train’ directory.

Parameters:
  • savePath (str) – The main project directory path.

  • mode (str) – The analysis mode (‘Cox’, ‘Classification’, ‘Regression’).

  • infer_mode (str) – The inference data type (‘ST’ or ‘SC’).

  • batch_size (int, optional) – Batch size for the DataLoaders. Defaults to 1024.

Returns:

None