R/getCorrelationTest.R

Defines functions getCorrelationTest

#' Evaluate the correlation between two elements for a combination between biomarkers
#' @description a function that gets the correlation between a combination of biomarkers
#' @param idx: index of the combination from the SetCombination table
#' @param set1: source file 1  
#' @param set2: source file 2
#' @param SetCombination: a table with all combinations of biomarkers from set1 and set2
#' @examples
#' getTimeDuration(sv.list=survey.list,sv='ultrashort')


getCorrelationTest<-function(idx,set1=bileaciddata,set2=mb.path,SetCombination){
  
  x = set1[11:20,SetCombination[idx,1]]-set1[1:10,SetCombination[idx,1]]
  
  y = set2[11:20,SetCombination[idx,2]]-set2[1:10,SetCombination[idx,2]]
  
  
  rs = cor.test(x,y,
           method='spearman',
           use='pairwise.complete.obs')
  
  return(rs)
}
correadarosaj/OWLTools documentation built on May 17, 2019, 12:07 p.m.