callHarman {Harman} | R Documentation

## Wrapper function to call the shared C/C++ library code

### Description

This wrapper should probably not be addressed directly except for debugging. Instead use `harman`. Input of PCA scores and the experiment structure (treatments and batches) and returns a batch corrected version of the PCA scores matrix

### Usage

    .callHarman(pc_data_scores, group, limit, numrepeats, randseed, forceRand,
      printInfo)

### Arguments

`pc_data_scores` | 2D NumericMatrix of PCA scores data (from the `prcomp$x` slot), rows = samples, cols = PC scores
`group` | The structure of the experiment, consisting of batch numbers and treatment numbers forming 2 rows or columns (HarmanMain works out which). Each entry for a sample describes what batch it came from and what treatment it was given. Has to be integer formated data.
`limit` | A double precsion value indicating the limit of confidence in which to stop removing a batch effect
`numrepeats` | The number of repeats in which to run the simulated batch mean distribution estimator. Probably should be greater than 100,000.
`randseed` | Random seed to pass to the random number generator (0 for use default from system time)
`forceRand` | Force algorithm
`printInfo` | Print update information to screen

### Value

SEXP R list: scores.corrected = harman_res_list["corrected_scores"] correction = harman_res_list["correction"] confidence = harman_res_list["confidence"]

### Note

A data matrix with samples in columns must be transposed before PCA analysis and these scores in turn are tweaked a little before handing over to .callHarman. See the example below.

[Package Harman version 1.14.0 Index]