Skip to contents

The feature_visualDiagnostic_all() calculates the six visual diagnostic-based features in one call. Calculate each feature individually with feature_visualDiagnostic_neighborhoodSizeSummary() and feature_visualDiagnostic_scanDifferenceCor().

Usage

feature_visualDiagnostic_all(comparisonData, threshold = 1, id_cols = NULL)

feature_visualDiagnostic_filteredRatio(
  cellHeightValues,
  alignedTargetCell,
  threshold = 1
)

feature_visualDiagnostic_neighborhoodSizeSummary(
  cellHeightValues,
  alignedTargetCell,
  summaryFun = mean,
  threshold = 1,
  imputeVal = NA
)

feature_visualDiagnostic_scanDifferenceCor(
  cellHeightValues,
  alignedTargetCell,
  threshold = 1,
  imputeVal = NA
)

Arguments

comparisonData

tibble such as one returned by the comparison_cellBased() or comparison_fullScan() functions that contains results from the cell-based or full scan comparison procedure

threshold

the default filtering threshold. Defaults to a scalar (1 micron = 1e-6 meters), but can also be set to a scalar-valued function that takes x3p1 and x3p2 as arguments. For example, threshold = impressions::x3p_sd will use the joint standard deviation of x3p1 and x3p2 as the threshold.

id_cols

column names in the comparisonData tibble that uniquely identify each observation. These are returned along with the computed features

cellHeightValues

list/tibble column of x3p objects containing a reference scan's cells (as returned by comparison_cellBased() or comparison_fullScan())

alignedTargetCell

list/tibble column of x3p objects containing a target scan's aligned cells (as returned by comparison_cellBased() or comparison_fullScan())

summaryFun

function that will be used to summarize the neighborhood sizes

imputeVal

value to return if the feature calculation results in a non-numeric (i.e., NA, NULL) value

Note

The feature_visualDiagnostic_all function can be used on comparison data from a full-scan or cell-based comparison. For a full-scan comparison, note that the standard deviation features will always be NA.

Examples

data("K013sA1","K013sA2")

compData_cellBased <- comparison_cellBased(reference = K013sA1,
                                           target = K013sA2,
                                           thetas = c(-3,0,3))
#> Error in mutate(., direction = "reference_vs_target"): could not find function "mutate"

compData_cellBased %>%
  dplyr::group_by(cellIndex,direction) %>%
  feature_visualDiagnostic_all()
#> Error in dplyr::group_by(., cellIndex, direction): object 'compData_cellBased' not found

compData_fullScan <- comparison_fullScan(reference = K013sA1,
                                         target = K013sA2,
                                         thetas = c(-3,0,3))

compData_fullScan %>%
  dplyr::group_by(direction) %>%
  feature_visualDiagnostic_all() %>%
  dplyr::select(-c(neighborhoodSizeAve_sd,
            neighborhoodSizeSD_sd,
            differenceCor_sd))
#> Error in dplyr::mutate(., neighborhoodSizeAve = feature_visualDiagnostic_neighborhoodSizeSummary(cellHeightValues = cellHeightValues,     alignedTargetCell = alignedTargetCell, summaryFun = mean,     threshold = threshold), neighborhoodSizeSD = feature_visualDiagnostic_neighborhoodSizeSummary(cellHeightValues = cellHeightValues,     alignedTargetCell = alignedTargetCell, summaryFun = sd, threshold = threshold),     differenceCor = feature_visualDiagnostic_scanDifferenceCor(cellHeightValues = cellHeightValues,         alignedTargetCell = alignedTargetCell, threshold = threshold),     filteredRatio = feature_visualDiagnostic_filteredRatio(cellHeightValues = cellHeightValues,         alignedTargetCell = alignedTargetCell, threshold = threshold)): Problem while computing `filteredRatio =
#> feature_visualDiagnostic_filteredRatio(...)`.
#>  The error occurred in group 1: direction = "reference_vs_target".
#> Caused by error in `purrr::map2_dbl()`:
#>  In index: 1.
#>  With name: y = 1 - 416.
#> Caused by error in `pull()`:
#> ! could not find function "pull"