Conversation
* Fixed the wrapper for Calling Opticluster! * Fixing the .RD file * Fixed issue where opticluster was returning a matrix array and not a data.frame. * Changing documentation * Fixing the warnings from building the code. * Update to the test * Updating the gitignore
* Added Cpp testing structure! * Added Test Fixture Class * Forced the cluster to only return OTU data, and created the fix test fixture with test! * Created all of the test for the optimatrix adapter and removed the .dll from being tracked! * Created all the test in the testfixture for listvectors and now I am adding them to the test files. * Created base test for listVector * Basic test for listVector are completed! * Created the basic structure and test fixture for cluster commands * Cluster Testing suite being pushed up! * Fix cluster algorithm (#2) * Fixed a slew of issues by adding bidirection distances. * Fixed the clustering issue, clustering should be working correctly now! * Generated Definitions for OptiCluster Test * Finished creating unit test of the cluster command and opticluster * Added OptiData test fixture * Started creating the unit test for utils * Utils command cluster and test work as expected!! * Removed old code from one of the testing suites. * Added another test in utils. * Clustor has a 89% test coverage! Everything should be tested and ready to merge back!
| @@ -0,0 +1,7 @@ | |||
| test_that("Clustering returns proper results", { | |||
| expected_df <- readRDS(test_path("extdata","df_test_file.RDS")) | |||
Check notice
Code scanning / lintr
Commas should always have a space after.
…roper stats". I appears it is returning incorrect data on different computer architectures. It is also not needed in the code.
* This should be the fix for the failing cluster test. * Changed the test to look for equivalence rows instead of equal dataframes. Gives the same results, the only differences is that the cluster have different numbers.
…/false condition for shuffling
|
|
||
| MatrixToOpiMatrixCluster <- function(xPosition, yPosition, data, cutoff, rowSize, colSize, iterations = 2L) { | ||
| .Call(`_Opticluster_MatrixToOpiMatrixCluster`, xPosition, yPosition, data, cutoff, rowSize, colSize, iterations) | ||
| MatrixToOpiMatrixCluster <- function(xPosition, yPosition, data, cutoff, iterations = 2L, shuffle = TRUE) { |
Check notice
Code scanning / lintr
Variable and function name style should match snake_case or symbols.
|
|
||
| MatrixToOpiMatrixCluster <- function(xPosition, yPosition, data, cutoff, rowSize, colSize, iterations = 2L) { | ||
| .Call(`_Opticluster_MatrixToOpiMatrixCluster`, xPosition, yPosition, data, cutoff, rowSize, colSize, iterations) | ||
| MatrixToOpiMatrixCluster <- function(xPosition, yPosition, data, cutoff, iterations = 2L, shuffle = TRUE) { |
Check notice
Code scanning / lintr
Variable and function name style should match snake_case or symbols.
|
|
||
| MatrixToOpiMatrixCluster <- function(xPosition, yPosition, data, cutoff, rowSize, colSize, iterations = 2L) { | ||
| .Call(`_Opticluster_MatrixToOpiMatrixCluster`, xPosition, yPosition, data, cutoff, rowSize, colSize, iterations) | ||
| MatrixToOpiMatrixCluster <- function(xPosition, yPosition, data, cutoff, iterations = 2L, shuffle = TRUE) { |
Check notice
Code scanning / lintr
Variable and function name style should match snake_case or symbols.
|
|
||
| MatrixToOpiMatrixCluster <- function(xPosition, yPosition, data, cutoff, rowSize, colSize, iterations = 2L) { | ||
| .Call(`_Opticluster_MatrixToOpiMatrixCluster`, xPosition, yPosition, data, cutoff, rowSize, colSize, iterations) | ||
| MatrixToOpiMatrixCluster <- function(xPosition, yPosition, data, cutoff, iterations = 2L, shuffle = TRUE) { |
Check notice
Code scanning / lintr
Lines should not be more than 80 characters. This line is 107 characters.
| MatrixToOpiMatrixCluster <- function(xPosition, yPosition, data, cutoff, rowSize, colSize, iterations = 2L) { | ||
| .Call(`_Opticluster_MatrixToOpiMatrixCluster`, xPosition, yPosition, data, cutoff, rowSize, colSize, iterations) | ||
| MatrixToOpiMatrixCluster <- function(xPosition, yPosition, data, cutoff, iterations = 2L, shuffle = TRUE) { | ||
| .Call(`_Opticluster_MatrixToOpiMatrixCluster`, xPosition, yPosition, data, cutoff, iterations, shuffle) |
Check notice
Code scanning / lintr
Indentation should be 2 spaces but is 4 spaces.
| MatrixToOpiMatrixCluster <- function(xPosition, yPosition, data, cutoff, rowSize, colSize, iterations = 2L) { | ||
| .Call(`_Opticluster_MatrixToOpiMatrixCluster`, xPosition, yPosition, data, cutoff, rowSize, colSize, iterations) | ||
| MatrixToOpiMatrixCluster <- function(xPosition, yPosition, data, cutoff, iterations = 2L, shuffle = TRUE) { | ||
| .Call(`_Opticluster_MatrixToOpiMatrixCluster`, xPosition, yPosition, data, cutoff, iterations, shuffle) |
Check warning
Code scanning / lintr
no visible binding for global variable '_Opticluster_MatrixToOpiMatrixCluster'
| MatrixToOpiMatrixCluster <- function(xPosition, yPosition, data, cutoff, rowSize, colSize, iterations = 2L) { | ||
| .Call(`_Opticluster_MatrixToOpiMatrixCluster`, xPosition, yPosition, data, cutoff, rowSize, colSize, iterations) | ||
| MatrixToOpiMatrixCluster <- function(xPosition, yPosition, data, cutoff, iterations = 2L, shuffle = TRUE) { | ||
| .Call(`_Opticluster_MatrixToOpiMatrixCluster`, xPosition, yPosition, data, cutoff, iterations, shuffle) |
Check notice
Code scanning / lintr
Lines should not be more than 80 characters. This line is 107 characters.
| @@ -0,0 +1,8 @@ | |||
| test_that("Clustering returns proper results", { | |||
| expected_df <- readRDS(test_path("extdata","df_test_file.RDS")) | |||
| matrix <- readRDS(test_path("extdata","matrix_data.RDS")) | |||
Check notice
Code scanning / lintr
Commas should always have a space after.
* Added to build ignore and properly documented the new R code. * Unstable, have to fix the mismatch header situation, but was able to return a vector with all the metrics! * Cluster now returns test metrics and added test to support it.
| #' @export | ||
| #' @param sparse_matrix A Sparse Matrix. | ||
| #' @param cutoff A cutoff value | ||
| #' @param iterations The number of iterations |
Check notice
Code scanning / lintr
Lines should not be more than 80 characters. This line is 103 characters.
| opti_cluster <- function(sparse_matrix, cutoff, iterations, shuffle = TRUE) { | ||
| index_one_list <- sparse_matrix@i | ||
| index_two_list <- sparse_matrix@j | ||
| value_list <- sparse_matrix@x |
Check warning
Code scanning / lintr
no visible global function definition for 'MatrixToOpiMatrixCluster'
| opti_cluster <- function(sparse_matrix, cutoff, iterations, shuffle = TRUE) { | ||
| index_one_list <- sparse_matrix@i | ||
| index_two_list <- sparse_matrix@j | ||
| value_list <- sparse_matrix@x |
Check notice
Code scanning / lintr
Lines should not be more than 80 characters. This line is 111 characters.
| index_one_list <- sparse_matrix@i | ||
| index_two_list <- sparse_matrix@j | ||
| value_list <- sparse_matrix@x | ||
| clustering_output_string_list <- MatrixToOpiMatrixCluster(index_one_list, index_two_list, value_list, cutoff, |
Check notice
Code scanning / lintr
Hanging indent should be 60 spaces but is 55 spaces.
| clustering_output_string <- clustering_output_string_list[1] | ||
| clustering_metric <- clustering_output_string_list[2] | ||
| clustering_metric_2 <- clustering_output_string_list[3] | ||
| df_cluster_metrics <- (read.table(text = clustering_metric, |
Check notice
Code scanning / lintr
Hanging indent should be 36 spaces but is 21 spaces.
| clustering_metric_2 <- clustering_output_string_list[3] | ||
| df_cluster_metrics <- (read.table(text = clustering_metric, | ||
| sep = "\t", header = TRUE)) | ||
| df_other_cluster_metrics <- (read.table(text = clustering_metric_2, |
Check notice
Code scanning / lintr
Hanging indent should be 43 spaces but is 21 spaces.
| df_other_cluster_metrics <- (read.table(text = clustering_metric_2, | ||
| sep = "\t", header = TRUE)) | ||
|
|
||
| df_cluster <- t(read.table(text = clustering_output_string, |
Check notice
Code scanning / lintr
Hanging indent should be 29 spaces but is 21 spaces.
| expected_df <- readRDS(test_path("extdata","df_test_file.RDS")) | ||
| matrix <- readRDS(test_path("extdata","matrix_data.RDS")) | ||
| df <- Opticluster::opti_cluster(matrix, 0.2, 2, FALSE) | ||
| df$cluster$exists <- do.call(paste0, df$cluster) %in% do.call(paste0, expected_df) |
Check notice
Code scanning / lintr
Lines should not be more than 80 characters. This line is 84 characters.
|
Stable build in main! |
After the creation of the unit test and stability checks, we should be able to merge this back into main.