Skip to contents

An optimized wrapper function for training cross-condition multi-task learning (CCMTL) models in the DEGAS framework. This function handles the complete training pipeline including data preparation, model configuration, and execution with enhanced performance and error handling.

Usage

runCCMTL.optimized(
  scExp,
  scLab,
  patExp,
  patLab,
  tmpDir,
  model_type,
  architecture,
  FFdepth,
  DEGAS.seed,
  force_rewrite = FALSE,
  verbose = TRUE
)

Arguments

scExp

A matrix or data frame containing single-cell expression data for model training.

scLab

A matrix containing single-cell labels corresponding to the expression data.

patExp

A matrix or data frame containing patient-level expression data for multi-task learning.

patLab

A matrix containing patient-level labels corresponding to the patient expression data.

tmpDir

Character string specifying the temporary directory path for storing intermediate files and model outputs.

model_type

Character string specifying the type of model to train. Should match available DEGAS model types.

architecture

Character string specifying the neural network architecture. One of: "DenseNet", "Standard".

FFdepth

Integer specifying the number of layers in the feed-forward network architecture.

DEGAS.seed

Integer specifying the random seed for reproducible model training.

force_rewrite

Logical indicating whether to force rewriting of input files even if they already exist. Default: FALSE.

Value

Returns a trained CCMTL model object that can be used for predictions and further analysis.

Details

Workflow:

  1. File Management: Efficient handling of temporary directories and input files with optional forced rewriting

  2. Architecture Configuration: Supports multiple neural network architectures (DenseNet, Standard) with customizable depth

  3. Python Environment: Validates Python availability and executes training scripts with proper error handling

  4. Model Training: Executes the DEGAS training process with specified hyperparameters and architecture choices

Note

This function requires a properly configured Python environment with DEGAS dependencies installed. The temporary directory (tmpDir) should have sufficient disk space for model files and intermediate data.

References

Johnson TS, Yu CY, Huang Z, Xu S, Wang T, Dong C, et al. Diagnostic Evidence GAuge of Single cells (DEGAS): a flexible deep transfer learning framework for prioritizing cells in relation to disease. Genome Med. 2022 Feb 1;14(1):11.