diff options
author | Alexander Kabui | 2021-10-29 09:49:28 +0300 |
---|---|---|
committer | GitHub | 2021-10-29 09:49:28 +0300 |
commit | 8f036415975d6e224e5e94277997329c0f1fa159 (patch) | |
tree | abc1e4b8578fad0cc934b334edc5c573a4bd6d20 /scripts | |
parent | 0cfff99e22155b6b15e23cbeff596f5f8f08709c (diff) | |
download | genenetwork3-8f036415975d6e224e5e94277997329c0f1fa159.tar.gz |
Feature/biweight reimplementation (#47)
* add biweight reimplementation with pingouin
* delete biweight scripts and tests
* add python-pingouin to guix file
* delete biweight paths
* mypy fix:pingouin mising imports
* pep8 formatting && pylint fixes
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/calculate_biweight.R | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/scripts/calculate_biweight.R b/scripts/calculate_biweight.R deleted file mode 100644 index 8d8366e..0000000 --- a/scripts/calculate_biweight.R +++ /dev/null @@ -1,43 +0,0 @@ - -library(testthat) -library(WGCNA) - -arg_values <- commandArgs(trailingOnly = TRUE) -ParseArgs <- function(args){ - - trait_vals <- as.numeric(unlist(strsplit(args[1], split=" "))) - target_vals <- as.numeric(unlist(strsplit(args[2], split=" "))) - - return(list(trait_vals= c(trait_vals),target_vals = c(target_vals))) - -} -BiweightMidCorrelation <- function(trait_val,target_val){ - - results <-bicorAndPvalue(as.numeric(unlist(trait_val)),as.numeric(unlist(target_val))) - return ((c(c(results$bicor)[1],c(results$p)[1]))) - -} - - - -test_that("biweight results"),{ - vec_1 <- c(1,2,3,4) - vec_2 <- c(1,2,3,4) - - results <- BiweightMidCorrelation(vec_1,vec_2) - expect_equal(c(1.0,0.0),results) -} - - -test_that("parsing args "),{ - my_args <- c("1 2 3 4","5 6 7 8") - results <- ParseArgs(my_args) - - expect_equal(results[1],c(1,2,3,4)) - expect_equal(results[2],c(5,6,7,8)) -} - -parsed_values <- ParseArgs(arg_values) - - -cat(BiweightMidCorrelation(parsed_values[1],parsed_values[2]))
\ No newline at end of file |