R/ttestup.R

Defines functions ttestup

Documented in ttestup

#' Returns upregulated proteins from ttest dataframe
#'
#' @param data data frame
#' @param fc minimum log2 fold-change
#' @param p.value p-value threshold
#' @param return should proteins be returned
#' @param save should vector of proteins be saved
#' @param name name
#' @param destination where to save
#'
#' @return
#' @export
#'
#'
ttestup <- function(data, fc = 0, p.value = 0.05, return = T, save = F, name, destination = "dat") {

  proteins <- extractRownames2(data,
                               column1 = "log2.fc",
                               lower1 = T,
                               threshold1 = fc,
                               column2 = "p.value",
                               lower2 = F,
                               threshold2 = p.value)

  if(save) {
    saveThis(data = proteins, name = name, destination = destination)
  }

  if(return) {
    proteins
  }

}
nicohuttmann/htmnanalysis documentation built on Dec. 6, 2020, 3:02 a.m.