checkObjectValidity {scClassifR} | R Documentation

## Internal functions of scClassifR package

### Description

Check if a scClassifR object is valid

Filter cells from ambiguous chars and non applicable cells in a `Seurat` object

Filter cells from ambiguous chars and non applicable cells in a `SingleCellExperiment` object

Construct a uniform tag vector for all forms of labels in a `Seurat` object

Construct a uniform tag vector for all forms of labels in a `SingleCellExperiment` object

Process parent classifier in a `Seurat` object

Process parent classifier in a `SingleCellExperiment` object

### Usage

    checkObjectValidity(object)

    checkCellTypeValidity(cell_type)

    checkFeaturesValidity(features)

    checkParentValidity(parent)

    checkPThresValidity(p_thres)

    checkClassifierValidity(clf)

    parent(classifier) <- value

    clf(classifier) <- value

    features(classifier) <- value

    balance_dataset(mat, tag)

    train_func(mat, tag)

    transform_to_zscore(mat)

    load_models(path_to_models)

    select_features(mat, features)

    check_parent_child_coherence(
      obj,
      pos_parent,
      parent_cell,
      cell_type,
      target_cell_type,
      ...
    )

    filter_cells(obj, tag_slot)

    ## S4 method for signature 'Seurat'
    filter_cells(obj, tag_slot)

    ## S4 method for signature 'SingleCellExperiment'
    filter_cells(obj, tag_slot)

    construct_tag_vect(obj, cell_type, ...)

    ## S4 method for signature 'Seurat'
    construct_tag_vect(obj, cell_type, tag_slot)

    ## S4 method for signature 'SingleCellExperiment'
    construct_tag_vect(obj, cell_type, tag_slot)

    process_parent_clf(
      obj,
      parent_tag_slot,
      parent_cell_type,
      parent_clf,
      path_to_models,
      zscore = TRUE,
      ...
    )

    ## S4 method for signature 'Seurat'
    process_parent_clf(
      obj,
      parent_tag_slot,
      parent_cell_type,
      parent_clf,
      path_to_models,
      zscore = TRUE,
      seurat_assay,
      seurat_slot,
      ...
    )

    ## S4 method for signature 'SingleCellExperiment'
    process_parent_clf(
      obj,
      parent_tag_slot,
      parent_cell_type,
      parent_clf,
      path_to_models,
      zscore = TRUE,
      sce_assay,
      ...
    )

    make_prediction(mat, classifier, pred_cells, ignore_ambiguous_result = TRUE)

    simplify_prediction(meta.data, full_pred, classifiers)

    verify_parent(mat, classifier, meta.data)

    test_performance(mat, classifier, tag)

    classify_clust(clusts, most_probable_cell_type)

### Arguments

`object` | The request classifier to check.
`cell_type` | name of cell type
`features` | list of selected features
`parent` | Classifier parent to check.
`p_thres` | Classifier probability threshold to check.
`clf` | Classifier to check.
`classifier` | classifier
`value` | the new classifier
`mat` | expression matrix
`tag` | tag of data
`path_to_models` | path to databases, or by default
`obj` | object
`pos_parent` | a vector indicating parent clf prediction
`parent_cell` | name of parent cell type
`target_cell_type` | alternative cell types (in case of testing clf)
`...` | arguments passed to other methods
`tag_slot` | tag slot in `SingleCellExperiment` object indicating cell type
`parent_tag_slot` | string, name of annotation tag slot in object indicating pre-assigned/predicted parent cell type
`parent_cell_type` | name of parent cell type
`parent_clf` | `scClassifR` object corresponding to classification model for the parent cell type
`zscore` | boolean indicating the transformation of gene expression in object to zscore or not
`seurat_assay` | name of assay to use in `Seurat` object
`seurat_slot` | type of expression data to use in `Seurat` object
`sce_assay` | name of assay to use in `SingleCellExperiment` object
`pred_cells` | a whole prediction for all cells
`ignore_ambiguous_result` | whether ignore ambigouous result
`meta.data` | object meta data
`full_pred` | full prediction
`classifiers` | classifiers
`clusts` | cluster info
`most_probable_cell_type` | predicted cell type

### Value

TRUE if the classifier is valid or the reason why it is not

TRUE if the cell type is valid or the reason why it is not.

TRUE if the features is valid or the reason why it is not.

TRUE if the parent is valid or the reason why it is not.

TRUE if the p_thres is valid or the reason why it is not.

TRUE if the classifier is valid or the reason why it is not.

scClassifR object with the new parent.

scClassifR object with the new trained classifier.

scClassifR object with the new features.

a list of balanced count matrix and corresponding tags of balanced count matrix

the classification model (caret object)

row wise center-scaled count matrix

list of classifiers

filtered matrix

list of adjusted object and adjusted tag slot

adjusted `Seurat` object

adjusted `SingleCellExperiment` object

a binary vector for cell tag

list of cells which are positive to parent clf

prediction

simplified prediction

applicable matrix

clf performance

[Package scClassifR version 1.2.0 Index]