p_thres {scAnnotatR} | R Documentation

## p_thres

### Description

Returns the probability threshold for the given classifier.

### Usage

    p_thres(classifier)

    ## S4 replacement method for signature 'scAnnotatR'
    p_thres(classifier) <- value

### Arguments

`classifier` | scAnnotatR object. The object is returned from the train_classifier function.
`value` | the new threshold

### Value

Predicting probability threshold of object

scAnnotatR object with the new threshold.

### Examples

    data("tirosh_mel80_example")
    selected_marker_genes_B = c("CD19", "MS4A1", "CD79A")
    set.seed(123)
    classifier_b <- train_classifier(train_obj = tirosh_mel80_example,
    assay = 'RNA', slot = 'counts', marker_genes = selected_marker_genes_B,
    cell_type = "B cells", tag_slot = 'active.ident')
    p_thres(classifier_b)

    data("tirosh_mel80_example")
    selected_marker_genes_B = c("CD19", "MS4A1", "CD79A")
    set.seed(123)
    classifier_b <- train_classifier(train_obj = tirosh_mel80_example,
    assay = 'RNA', slot = 'counts', marker_genes = selected_marker_genes_B,
    cell_type = "B cells", tag_slot = 'active.ident')
    classifier_b_test <- test_classifier(classifier = classifier_b,
    test_obj = tirosh_mel80_example, assay = 'RNA', slot = 'counts',
    tag_slot = 'active.ident')
    # assign a new threhold probability for prediction
    p_thres(classifier_b) <- 0.4

[Package scAnnotatR version 1.0.0 Index]