-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merging Dev into Main. #4
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!
…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
@@ -1,7 +1,7 @@ | |||
# Generated by using Rcpp::compileAttributes() -> do not edit by hand | |||
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 | |||
|
|||
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. Note
@@ -1,7 +1,7 @@ | |||
# Generated by using Rcpp::compileAttributes() -> do not edit by hand | |||
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 | |||
|
|||
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. Note
@@ -1,7 +1,7 @@ | |||
# Generated by using Rcpp::compileAttributes() -> do not edit by hand | |||
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 | |||
|
|||
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. Note
@@ -1,7 +1,7 @@ | |||
# Generated by using Rcpp::compileAttributes() -> do not edit by hand | |||
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 | |||
|
|||
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. Note
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. Note
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' Warning
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. Note
@@ -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. Note test
* 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.
#' @param sparse_matrix A Sparse Matrix. | ||
#' @param cutoff A cutoff value | ||
#' @param iterations The number of iterations | ||
#' @param shuffle a boolean to determine whether or not you want to shuffle the data before you cluster |
Check notice
Code scanning / lintr
Lines should not be more than 80 characters. This line is 103 characters. Note
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 warning
Code scanning / lintr
no visible global function definition for 'MatrixToOpiMatrixCluster' Warning
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
Lines should not be more than 80 characters. This line is 111 characters. Note
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, | ||
iterations, shuffle) |
Check notice
Code scanning / lintr
Hanging indent should be 60 spaces but is 55 spaces. Note
clustering_metric <- clustering_output_string_list[2] | ||
clustering_metric_2 <- clustering_output_string_list[3] | ||
df_cluster_metrics <- (read.table(text = clustering_metric, | ||
sep = "\t", header = TRUE)) |
Check notice
Code scanning / lintr
Hanging indent should be 36 spaces but is 21 spaces. Note
df_cluster_metrics <- (read.table(text = clustering_metric, | ||
sep = "\t", header = TRUE)) | ||
df_other_cluster_metrics <- (read.table(text = clustering_metric_2, | ||
sep = "\t", header = TRUE)) |
Check notice
Code scanning / lintr
Hanging indent should be 43 spaces but is 21 spaces. Note
sep = "\t", header = TRUE)) | ||
|
||
df_cluster <- t(read.table(text = clustering_output_string, | ||
sep = "\t", header = TRUE)) |
Check notice
Code scanning / lintr
Hanging indent should be 29 spaces but is 21 spaces. Note
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. Note test
Stable build in main! |
After the creation of the unit test and stability checks, we should be able to merge this back into main.