Removes top features from a pangenome given previous ML results.

removeTopFeats(ml_input_tibble, top_feat_tibble)

Arguments

ml_input_tibble

An ML-ready tibble generated by loadMLInputTibble()

top_feat_tibble

Second element of the list output of runMLPipeline(), containing all features to be removed from the ml_input_tibble

Value

An amR pangenome with top features removed

Examples

ml <- tibble::tibble(
  genome_id = paste0("g", 1:6),
  genome_drug.resistant_phenotype = rep(c("Resistant", "Susceptible"), each = 3),
  feat_a = c(1L, 0L, 1L, 0L, 1L, 0L),
  feat_b = c(0L, 1L, 0L, 1L, 0L, 1L),
  feat_c = c(1L, 1L, 0L, 0L, 1L, 0L)
)
top <- tibble::tibble(Variable = c("feat_a", "feat_c"))
removeTopFeats(ml, top)
#> # A tibble: 6 × 3
#>   genome_id genome_drug.resistant_phenotype feat_b
#>   <chr>     <chr>                            <int>
#> 1 g1        Resistant                            0
#> 2 g2        Resistant                            1
#> 3 g3        Resistant                            0
#> 4 g4        Susceptible                          1
#> 5 g5        Susceptible                          0
#> 6 g6        Susceptible                          1