FeatSeekR user guide
Date: 2026-05-18

# `FeatSeekR` user guide

Tuemay Capraz1*

1European Molecular Biology Laboratory, Heidelberg

*tuemay.capraz@embl.de

#### 2026-05-18

#### Package

FeatSeekR 1.13.0

    library(FeatSeekR)
    library(pheatmap)
    library(SummarizedExperiment)

# 1 Introduction

A fundamental step in many analyses of high-dimensional data is dimension reduction. Feature selection is one approach to dimension reduction whose strengths include interpretability, conceptual simplicity, transferability and modularity. Here, we introduce the `FeatSeekR` algorithm, which selects features based on the consistency of their signal across replicates and their non-redundancy. It takes a 2 dimensional array (features x samples) of replicated measurements and returns a SummarizedExperiment object storing the selected features ranked by reproducibility.

# 2 Installation

    if (!requireNamespace("BiocManager", quietly = TRUE))
        install.packages("BiocManager")

    BiocManager::install("FeatSeekR")

# 3 Feature selection on simulated data

Here we simulate a data set with features generated by orthogonal latent factors. Features derived from the same latent factor are highly redundant and form distinct clusters. The function simulates 10 redundant features per latent factor. Replicates are generated by adding independent Gaussian noise.

    set.seed(111)
    # simulate data with 500 conditions, 3 replicates and 5 latent factors
    conditions <- 500
    latent_factors <- 5
    replicates <- 3

    # simData generates 10 features per latent_factor, so choosing latent_factors=5
    # will generate 50 features.
    # we simulate samples from 500 independent conditions per replicate. setting
    # conditions=500 and replicates=3 will generate 1500 samples, leading to
    # final data dimensions of 50 features x 1500 samples
    sim <- simData(conditions=conditions, n_latent_factors=latent_factors,
                    replicates=replicates)

    # show that simulated data dimensions are indeed 50 x 1500
    dim(assay(sim, "data"))

    ## [1]   50 1500

    # calculate the feature correlation for first replicate
    data <- t(assay(sim, "data"))
    cor <- cor(data, use = "pairwise.complete.obs")

    # plot a heatmap of the features and color features according to their
    # generating latent factors
    anno <- data.frame(Latent_factor = as.factor(rep(1:5, each=10)))
    rownames(anno) <- dimnames(sim)[[1]]
    colors        <- c("red", "blue", "darkorange", "darkgreen", "black")
    names(colors) <- c("1", "2", "3", "4", "5")
    anno_colors <- list(Latent_factor = colors)
    range <- max(abs(cor))
    pheatmap(cor, treeheight_row = 0 , treeheight_col = 0,
            show_rownames = FALSE, show_colnames = FALSE,
            breaks = seq(-range, range, length.out = 100), cellwidth = 6,
            cellheight = 6, annotation_col = anno, annotation_colors = anno_colors,
            fontsize = 8)

We first plot the correlation matrix of the data to visualize feature redundancy. As intended by the simulation, the features derived from the same latent factor cluster together. This suggests that the true dimension is indeed lower than the number of features. We now run `FeatSeekR` to rank the features based on their uniqueness and reproducibility.

    # select the top 5 features
    res <- FeatSeek(sim, max_features=5)

    ## Input data has:
    ## 1500 samples
    ## 500 conditions
    ## 50 features
    ## 3 replicates

    ## Starting feature ranking!

    ## Iteration: 1 selected = Latent_factor2_Feature3, replicate F-statistic = 10873.002331671

    ## Iteration: 2 selected = Latent_factor5_Feature6, replicate F-statistic = 9364.10884704127

    ## Iteration: 3 selected = Latent_factor3_Feature6, replicate F-statistic = 6048.5339756004

    ## Iteration: 4 selected = Latent_factor4_Feature1, replicate F-statistic = 1777.09431418772

    ## Iteration: 5 selected = Latent_factor1_Feature5, replicate F-statistic = 60.3857000568632

    ## Finished feature ranking procedure!

    ## Calculating explained variance of selected feature sets!

    # plot a heatmap of the top 5 selected features
    plotSelectedFeatures(res)

We again visualize the selected features by plotting their correlation matrix. As expected, the top 5 selected features are each from a different latent factor and low correlated. This suggests that we were able to obtain a compressed version of the data, while keeping most of the contained information.

# 4 Session Info

    sessionInfo()

    ## R version 4.6.0 Patched (2026-05-01 r89994)
    ## Platform: aarch64-apple-darwin23
    ## Running under: macOS Tahoe 26.3.1
    ##
    ## Matrix products: default
    ## BLAS:   /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRblas.0.dylib
    ## LAPACK: /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.1
    ##
    ## locale:
    ## [1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
    ##
    ## time zone: America/New_York
    ## tzcode source: internal
    ##
    ## attached base packages:
    ## [1] stats4    stats     graphics  grDevices utils     datasets  methods
    ## [8] base
    ##
    ## other attached packages:
    ##  [1] SummarizedExperiment_1.43.0 Biobase_2.73.1
    ##  [3] GenomicRanges_1.65.0        Seqinfo_1.3.0
    ##  [5] IRanges_2.47.1              S4Vectors_0.51.2
    ##  [7] BiocGenerics_0.59.2         generics_0.1.4
    ##  [9] MatrixGenerics_1.25.0       matrixStats_1.5.0
    ## [11] pheatmap_1.0.13             FeatSeekR_1.13.0
    ## [13] BiocStyle_2.41.0
    ##
    ## loaded via a namespace (and not attached):
    ##  [1] sass_0.4.10         SparseArray_1.13.2  lattice_0.22-9
    ##  [4] magrittr_2.0.5      pracma_2.4.6        digest_0.6.39
    ##  [7] evaluate_1.0.5      grid_4.6.0          RColorBrewer_1.1-3
    ## [10] bookdown_0.46       fastmap_1.2.0       jsonlite_2.0.0
    ## [13] Matrix_1.7-5        tinytex_0.59        BiocManager_1.30.27
    ## [16] scales_1.4.0        jquerylib_0.1.4     abind_1.4-8
    ## [19] cli_3.6.6           rlang_1.2.0         XVector_0.53.0
    ## [22] cachem_1.1.0        DelayedArray_0.39.2 yaml_2.3.12
    ## [25] otel_0.2.0          S4Arrays_1.13.0     tools_4.6.0
    ## [28] R6_2.6.1            lifecycle_1.0.5     magick_2.9.1
    ## [31] MASS_7.3-65         bslib_0.11.0        gtable_0.3.6
    ## [34] glue_1.8.1          Rcpp_1.1.1-1.1      xfun_0.57
    ## [37] knitr_1.51          dichromat_2.0-0.1   farver_2.1.2
    ## [40] htmltools_0.5.9     rmarkdown_2.31      compiler_4.6.0