Skip to content

Commit

Permalink
Style code (GHA)
Browse files Browse the repository at this point in the history
  • Loading branch information
elena-krismer committed Oct 10, 2024
1 parent cce817c commit 2feb1a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
5 changes: 2 additions & 3 deletions R/impute_randomforest.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ impute_randomforest <- function(
grouping,
intensity_log2,
retain_columns = NULL,
...
) {
...) {
# Convert inputs to symbols
sample_sym <- rlang::ensym(sample)
grouping_sym <- rlang::ensym(grouping)
Expand All @@ -90,7 +89,7 @@ impute_randomforest <- function(
names_from = !!grouping_sym,
values_from = !!intensity_sym
) %>%
dplyr::select(-!!sample_sym) # Exclude the sample column for imputation
dplyr::select(-!!sample_sym) # Exclude the sample column for imputation

# Convert to numeric and suppress warnings for coercion
data_wide <- suppressWarnings(data.frame(lapply(data_wide, function(x) as.numeric(as.character(x)))))
Expand Down
16 changes: 8 additions & 8 deletions tests/testthat/test-workflow.R
Original file line number Diff line number Diff line change
Expand Up @@ -795,17 +795,17 @@ test_that("calculate_aa_scores works", {

# Test for random forest imputation
test_that("Random Forest imputation works correctly", {
set.seed(123) # Set seed for reproducibility
set.seed(123) # Set seed for reproducibility

# Create synthetic test data
test_data <- create_synthetic_data(
n_proteins = 10,
frac_change = 0.5,
n_replicates = 4,
n_conditions = 2,
method = "effect_random",
additional_metadata = FALSE
)
n_proteins = 10,
frac_change = 0.5,
n_replicates = 4,
n_conditions = 2,
method = "effect_random",
additional_metadata = FALSE
)

# Perform imputation using the random forest method
imputed_data <- impute_randomforest(
Expand Down

0 comments on commit 2feb1a4

Please sign in to comment.