Here we present a noise removal R package for CyTOF data. You can either use the main function rm_noise
to remove the noise applying the current trained models, or train your own models and then call them into the main function.
You will need to install the devtools
CRAN package. All other dependencies will be automatically installed with the package installation.
# Install devtools
install.packages("devtools")
# Install denoisingCTF
devtools::install_github("msenosain/denoisingCTF")
This function will remove zeros, beads and debris from the FCS files in the current working directory using previously trained models.
If you want to train your own classification models for beads and debris, you can do it following these steps:
# Unsupervised beads detection and training/testing data sets generation.
Beads_TrainTest(sample_size = 40, method = 'k_means',
bsample = 5000, class_col = 'BeadsSmp_ID')
# Train model
TrainModel(train_set, test_set, alg = 'all', class_col = 'BeadsSmp_ID',
seed = 40, name_0 = 'cells', name_1 = 'beads', label = 'beads',
allowParallel = T, free_cores = 2)
# Removal of zeros, beads and addition of row ID column
pre_gate(sample_size=30, model_beads=model_beads, alg_bd = 'RF')
# Manually gate debris and dead cells using Gaussian Parameters and a live/dead cell marker.
# Comparison of pre-gated and post-gated files, noise labeling and training/testing data sets generation.
post_gate(bsample = 5000, path_pregated = '../')
# Train model
TrainModel(train_set, test_set, alg = 'all', class_col = 'GP_Noise',
seed = 40, name_0 = 'cells', name_1 = 'debris', label = 'debris',
allowParallel = T, free_cores = 2)
For a detailed example, see our tutorial.
For further details on these models, click here.