rank_by_NA: Ranks peptides/precursors of a protein by NAs (adds new...

View source: R/tidyMS_R6_TransitionCorrelations.R

rank_by_NAR Documentation

Ranks peptides/precursors of a protein by NAs (adds new column .NARank)

Description

Ranks peptides/precursors of a protein by NAs (adds new column .NARank)

Usage

rank_by_NA(pdata, config)

Arguments

pdata

data.frame

config

AnalysisConfiguration

Value

data.frame

Examples


bb <- prolfqua::prolfqua_data('data_spectronautDIA250_A')
config <- bb$config_f()
analysis <- bb$analysis(bb$data, bb$config_f())
res <- remove_large_QValues(analysis, config)
res <- rank_by_NA(res,config)
colnames(res)
x <- res |>
  dplyr::select(config$table$hierarchy_keys()[1], config$table$hierarchy_keys(TRUE)[1], "srm_NrNotNAs") |>
  dplyr::distinct() |> dplyr::summarize(sum(srm_NrNotNAs)) |> dplyr::pull()
stopifnot(sum(!is.na(res[[config$table$get_response()[1]]])) == x)
res |> dplyr::select(c(config$table$hierarchy_keys(),"srm_NrNotNAs"  ,"srm_NrNotNARank")) |>
 dplyr::distinct() |>
 dplyr::arrange(!!!rlang::syms(c(config$table$hierarchy_keys()[1],"srm_NrNotNARank")))

wolski/prolfqua documentation built on Dec. 4, 2024, 11:18 p.m.