mergeSocratesRDS: mergeSocratesRDS

View source: R/quality_control.R

mergeSocratesRDSR Documentation

mergeSocratesRDS

Description

This function merges Socrates data RDS objects. Useful for joining replicates and multiple samples for downstream analysis. obj simple way to aggregate multiple samples into obj single socrates object is to move all the samples of interest into obj directory and load the paths with list.files. IMPORTANT - only merge RDS objects where the same bins/peaks were used for generating the sparse matrices. The easiest way to ensure mergeable objects is to use the same window size (instead of ACRs) for the function generateMatrix from each sample.

Usage

mergeSocratesRDS(filenames = NULL, obj.list = NULL)

Arguments

filenames

Named vector of filepaths.

obj.list

Named list of Socrates objects output from convertSparseData.

specify input files

input.files <- list.files(pattern="*.rds", path="/path/to/rds/directory")input.files1 "rep1.rds" "rep2.rds"

name the input files

names(input.files) <- c("rep1", "rep2")input.filesrep1 rep2"rep1.rds" "rep2.rds"

merge reps 1 and 2

merged.obj <- mergeSocratesRDS(filenames=input.files)

check data structure

str(merged.obj)

one can also load using obj list of socrates objects.

all.soc.obj <- list(rep1=soc.obj1, rep22=soc.obj2)merged.obj <- mergeSocratesRDS(obj.list=all.soc.obj)


plantformatics/Socrates documentation built on April 3, 2025, 1:02 p.m.