mts_genepairsChunkGeneration: Generate '.RData' files containing subsets of gene pairs

View source: R/mts_genepairsChunkGeneration.R

mts_genepairsChunkGenerationR Documentation

Generate .RData files containing subsets of gene pairs

Description

Generates .RData files ('chunks') containing subsets of gene pairs. These subsets are useful for MultiSEp applications in high-performance computing (HPC) environments, where each file ('chunk') may be analysed by one task in an array job. This function takes one or two list objects containing cluster assignments and generates .RData files containing subsets of the full gene pair list.

Each file contains a portion of the gene pairs that can be processed independently, enabling mts_patternDetection to run in parallel across array jobs. This facilitates scalable analysis of large gene pair sets.

Usage

mts_genepairsChunkGeneration(
  genepairs = NULL, 
  mixModelClusters1,
  mixModelClusters2=NULL, 
  num_tasks,
  output_dir = tempdir(), 
  cores
)

Arguments

genepairs

Optional. A data frame containing two columns of gene names. If genepairs is not supplied or is set to NULL, gene pairs are generated automatically from the genes present in the supplied cluster assignment object or objects. For unidirectional input using a single cluster assignment object, both genes in each pair must be present in mixModelClusters1. For bidirectional input using two cluster assignment objects, the first column must contain genes from mixModelClusters1, and the second column must contain genes from mixModelClusters2.

mixModelClusters1

A list object containing cluster assignments generated by mts_mixModelCluster, mts_mixModelCluster_XPR, mts_crisprPartition, or mts_formatMatrix. This object provides the gene set used to generate gene pairs when genepairs is not supplied or is set to NULL.

mixModelClusters2

Optional. A second list object containing cluster assignments generated by mts_mixModelCluster, mts_mixModelCluster_XPR, mts_crisprPartition or mts_formatMatrix. If supplied, gene pairs are generated between genes in mixModelClusters1 and genes in mixModelClusters2. If not supplied, gene pairs are generated within mixModelClusters1.

num_tasks

The number of .RData files into which the gene pairs are divided.

output_dir

Directory where the .RData files are saved. If the specified directory does not exist, an attempt is made to create the directory according to the given path. Defaults to a temporary directory.

cores

Number of compute cores to use. Defaults to 1.

Value

Splits the gene pairs into num_tasks chunks and writes each to the output directory as a ‘genepairs_chunk_<i>.RData’ file. Returns a list of length num_tasks whose elements are each NULL.

See Also

mts_mixModelCluster, mts_mixModelCluster_XPR, mts_crisprPartition, mts_formatMatrix, mts_patternDetection

Examples


data(depMapXPR_subset)
mixModelClusters = mts_mixModelCluster_XPR(
  dataMatrix = depMapXPR_subset[1:5,],
  cores=1
)

# Using a custom output directory to save the .RData files (chunks)
# Here we write to a temporary directory for the example
output_dir <- tempdir()

# Generate Gene Pairs and Save to 3 Files
mts_genepairsChunkGeneration(
  mixModelClusters1 = mixModelClusters,
  num_tasks = 3,
  output_dir = output_dir
)


MultiSEp documentation built on Aug. 27, 2026, 5:07 p.m.