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 Feb 16, 2024
1 parent 6fdb9b4 commit 2f6f71b
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 4 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export(getAnalyteInfo)
export(getAnalytes)
export(getFeatureData)
export(getFeatures)
export(getLiftCCC)
export(getMeta)
export(getSeqId)
export(getSeqIdMatches)
Expand Down
27 changes: 27 additions & 0 deletions R/getLiftCCC.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#' Access Lin's Concordance Correlation Coefficient for SomaScan
#'
#' Access the CCC between various SomaScan versions.\cr
#' \cr
#' Table of SomaScan Assay versions:
#' \tabular{lll}{
#' **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
#' }
#'
#' @inheritParams params
#' @return A tibble of either the `serum` or `plasma` CCC
#' between various versions of the SomaScan assay.
#' @author Stu Field
#' @examples
#' # plasma (default)
#' getLiftCCC()
#'
#' # serum
#' getLiftCCC("serum")
#' @export
getLiftCCC <- function(matrix = c("plasma", "serum")) {
matrix <- match.arg(matrix)
dplyr::select(lift_master, SeqId, starts_with(matrix) & 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: 37 additions & 0 deletions man/getLiftCCC.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 2f6f71b

Please sign in to comment.