Skip to content

Commit

Permalink
Add lifting accessor function for Lin's CCC
Browse files Browse the repository at this point in the history
- new function getLiftCCC()
- accesses the lifting correlations between
  SomaScan versions for each analyte
- fixed small bug with SomaReadr reference
  in params.R
- closes SomaLogic#88
  • Loading branch information
stufield committed Mar 5, 2024
1 parent 6f6dce0 commit d76adc0
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 19 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export(getMeta)
export(getSeqId)
export(getSeqIdMatches)
export(getSignalSpace)
export(getSomaScanLiftCCC)
export(getSomaScanVersion)
export(getSomamerData)
export(getSomamers)
Expand Down
14 changes: 7 additions & 7 deletions R/adat-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
#' [checkSomaScanVersion()] determines if the version of
#' is a recognized version of SomaScan.\cr
#' \cr
#' Table of current SomaScan Assay versions:
#' Table of SomaScan Assay versions:
#' \tabular{lll}{
#' **Version** \tab **Name** \tab **Size** \cr
#' `V4` \tab 5k \tab 5284 \cr
#' `v4.1` \tab 7k \tab 7596 \cr
#' `v5.0` \tab 11k \tab 11083 \cr
#' **Version** \tab **Commercial Name** \tab **Size** \cr
#' `V4` \tab 5k \tab 5284 \cr
#' `v4.1` \tab 7k \tab 7596 \cr
#' `v5.0` \tab 11k \tab 11083 \cr
#' }
#'
#' @name adat-helpers
#' @param atts The *attributes* of a `soma_adat` object.
#' @return Either a character string of length 1, or `NULL`.
#' @return
#' \item{[getAdatVersion()]}{The key-value of the `Version` as a string.}
#' \item{[getSomaScanVersion()]}{The key-value of the `AssayVersion` as a string.}
#' \item{[checkSomaScanVersion()]}{Returns `NULL` (invisibly) if checks pass.}
Expand Down Expand Up @@ -94,7 +94,7 @@ getSignalSpace <- function(adat) {
#'
#' @rdname adat-helpers
#' @param ver `character(1)`. The SomaScan version as a string.
#' @note The `"v"` is case insensitive.
#' @note The `"v"`-prefix is case insensitive.
#' @examples
#'
#' is.null(checkSomaScanVersion(ver))
Expand Down
25 changes: 25 additions & 0 deletions R/getSomaScanLiftCCC.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#' @rdname adat-helpers
#'
#' @description
#' [getSomaScanLiftCCC()] accesses the lifting Concordance Correlation
#' Coefficients between various SomaScan versions.
#'
#' @inheritParams params
#' @references Lin, Lawrence I-Kuei. 1989. A Concordance Correlation
#' Coefficient to Evaluate Reproducibility. __Biometrics__. 45:255-268.
#' @return
#' \item{[getSomaScanLiftCCC()]}{Returns a tibble of either the
#' `serum` or `plasma` CCC between various versions of the SomaScan assay.}
#' @examples
#'
#' # plasma (default)
#' getSomaScanLiftCCC()
#'
#' # serum
#' getSomaScanLiftCCC("serum")
#' @export
getSomaScanLiftCCC <- function(matrix = c("plasma", "serum")) {
matrix <- match.arg(matrix)
dplyr::select(lift_master, SeqId,
dplyr::starts_with(matrix) & dplyr::ends_with("ccc"))
}
7 changes: 5 additions & 2 deletions R/params.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Common Parameters in \pkg{SomaReadr}
#' Common Parameters in \pkg{SomaDataIO}
#'
#' The parameters below are commonly used throughout
#' the \pkg{SomaReadr} package.
#' the \pkg{SomaDataIO} package.
#'
#' @name params
#'
Expand All @@ -11,5 +11,8 @@
#' @param x A `soma_adat` object (with intact attributes),
#' typically created using [read_adat()].
#'
#' @param matrix Character. A string of (usually) either
#' `"serum"` or `"plasma"`.
#'
#' @return A `soma_adat` class object.
NULL
37 changes: 29 additions & 8 deletions man/adat-helpers.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions man/params.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d76adc0

Please sign in to comment.