searchCluster.batch: Search for clusters using pre-defined labels in cytometry...

Description Usage Arguments Details Value Examples

View source: R/searchCluster.batch.R

Description

A function that searches for clusters using pre-defined labels in cytometry data from different studies in batch.

Usage

1
2
searchCluster.batch(preprocessOutputFolder, outpath = "search_output",
  clusterLabel, ifPlot = TRUE)

Arguments

preprocessOutputFolder

Directory where the pre-processed results are stored.

outpath

A string indicating the directory the results should be written to.

clusterLabel

A vector containing labels, such as c("CD3+|CD4+|CD8-")

ifPlot

True or False. Used to specify if a the density plot for each cluster should be plotted

Details

The function writes out the summary statistics for each cluster. A separate directory will be created for each study.

Value

Results will be written to the outpath folder

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#get meta-data
fn=system.file("extdata","fcs_info.csv",package="MetaCyto")
fcs_info=read.csv(fn,stringsAsFactors=FALSE,check.names=FALSE)
fcs_info$fcs_files=system.file("extdata",fcs_info$fcs_files,
                               package="MetaCyto")
# Make sure the transformation parameter "b" and the "assay" argument
# are correct of FCM and CyTOF files
b=assay=rep(NA,nrow(fcs_info))
b[grepl("CyTOF",fcs_info$study_id)]=1/8
b[grepl("FCM",fcs_info$study_id)]=1/150
assay[grepl("CyTOF",fcs_info$study_id)]="CyTOF"
assay[grepl("FCM",fcs_info$study_id)]="FCM"
# preprocessing
preprocessing.batch(inputMeta=fcs_info,
                    assay=assay,
                    b=b,
                    outpath="Example_Result/preprocess_output",
                    excludeTransformParameters=c("FSC-A","FSC-W","FSC-H",
                    "Time","Cell_length"))
# Make sure marker names are consistant in different studies
files=list.files("Example_Result",pattern="processed_sample",recursive=TRUE,
                 full.names=TRUE)
nameUpdator("CD8B","CD8",files)
# find the clusters
cluster_label=c("CD3-|CD19+","CD3+|CD4-|CD8+")
searchCluster.batch(preprocessOutputFolder="Example_Result/preprocess_output",
                    outpath="Example_Result/search_output",
                    clusterLabel=cluster_label)

hzc363/MetaCyto documentation built on July 27, 2020, 2:46 a.m.