flag_hits: flag hits

Description Usage Arguments Details Value Methods (by class) Grouping Grouped data frames (dplyr package)

View source: R/fun-flag_hits.R

Description

Flag well as hit, depending on stringency.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
flag_hits(x, ...)

## S3 method for class 'numeric'
flag_hits(x, stringency, ...)

## S3 method for class 'data.frame'
flag_hits(x, stringency, vars, ...)

## S3 method for class 'grouped_df'
flag_hits(x, stringency, vars, ...)

Arguments

x

numeric vector or data frame

...

arguments passed to methods

stringency

numeric vector of length 1 or the same as vars; if 1 or larger, the summary criterion will be used; if lower that 1, the fractional criterion will be used,

vars

variables to flag

Details

If the screen involves multiple replicates, hitscores should be aggregated and compared to a stringency threshold to determine whether a well is a hit. Stringency can be applied summarily (add all hit scores) or fractionally (divide the absolute sum of hit scores by the number of replicates). Each well receives a logical flag, marking the plate/well as a hit or not.

Thus, samples that receive positive as well as negative hitscores may not be flagged during aggregation.

Note that for the fractional method missing values are not counted towards the number of replicates.

Value

For vector method, a named list containing the aggregated hitscore and the hit status. For data frame method, a copy of x with added columns.

Methods (by class)

Grouping

This function should be run on subsets of the screen object, i.e. either on a grouped data frame or on a data table with the by argument, such that replicates are aggregated over plate/well combinations.

Grouped data frames (dplyr package)

The method for class grouped_df is home made because the native behavior of grouped data frames does not readily support functions that return data frames.


olobiolo/siscreenr documentation built on Nov. 26, 2021, 3:08 p.m.