aboutsummaryrefslogtreecommitdiff
path: root/gn3/computations/biweight.R
blob: 8730536c86ad969396a31d5fbf0a8799bdffd623 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
library(WGCNA)

FetchArgs <- function(){
	myArgs <- commandArgs(trailingOnly = TRUE)
	trait_vals <- as.numeric(unlist(strsplit(myArgs[1], split=" ")))
	target_vals <- as.numeric(unlist(strsplit(myArgs[2], split=" ")))

	return(list(trait_vals= c(trait_vals),target_vals = c(target_vals)))

}
BiweightMidCorrelation <- function(trait_val,target_val){

	results <- bicorAndPvalue(c(trait_val),c(target_val))
    return ((c(c(results$bicor)[1],c(results$p)[1])))
}


results <- (BiweightMidCorrelation(FetchArgs()[1],FetchArgs()[2]))

cat(results)