tirank.Dataloader.transform_test_exp
- tirank.Dataloader.transform_test_exp(train_exp, test_exp)[source]
Transforms a test expression matrix into a gene pair matrix using pairs from a training set.
Given a gene pair matrix from training (columns are ‘GeneA__GeneB’) and a new expression matrix (genes as rows), this function computes the gene pair values for the new data, matching the pairs from training.
- Parameters:
train_exp (pd.DataFrame) – The gene pair matrix from the training set. Its columns define the gene pairs to be used.
test_exp (pd.DataFrame) – The raw gene expression matrix for the test set (genes as rows, samples as columns).
- Returns:
- A new gene pair matrix (samples x gene pairs) for the
test set, with the same columns as train_exp.
- Return type:
pd.DataFrame