Skip to content

SRS

0.2.3

Scaling with Ranked Subsampling

3packages depend
5.8Kdownloads / year
test coverage
11/13checks pass

Overview

About
Maintained by Lukas BeuleFirst published 2020-08-317 releasesCRAN page ↗

Analysis of species count data in ecology often requires normalization to an identical sample size. Rarefying (random subsampling without replacement), which is a popular method for normalization, has been widely criticized for its poor reproducibility and potential distortion of the community structure. In the context of microbiome count data, researchers explicitly advised against the use of rarefying. An alternative to rarefying is scaling with ranked subsampling (SRS). SRS consists of two steps. In the first step, the total counts for all OTUs (operational taxonomic units) or species in each sample are divided by a scaling factor chosen in such a way that the sum of the scaled counts Cscaled equals Cmin. In the second step, the non-integer Cscaled values are converted into integers by an algorithm that we dub ranked subsampling. The Cscaled value for each OTU or species is split into the integer part Cint (Cint = floor(Cscaled)) and the fractional part Cfrac (Cfrac = Cscaled - Cints). Since the sum of Cint is smaller or equal to Cmin, additional delta C = Cmin - the sum of Cint counts have to be added to the library to reach the total count of Cmin. This is achieved as follows. OTUs are ranked in the descending order of their Cfrac values. Beginning with the OTU of the highest rank, single count per OTU is added to the normalized library until the total number of added counts reaches delta C and the sum of all counts in the normalized library equals Cmin. When the lowest Cfrag involved in picking delta C counts is shared by several OTUs, the OTUs used for adding a single count to the library are selected in the order of their Cint values. This selection minimizes the effect of normalization on the relative frequencies of OTUs. OTUs with identical Cfrag as well as Cint are sampled randomly without replacement. See Beule & Karlovsky (2020) <doi:10.7717/peerj.9593> for details.

Install

Health

CRAN checks
2NOTE11OK
Failing flavors
  • NOTE r-devel-linux-x86_64-debian-clang
  • NOTE r-devel-linux-x86_64-debian-gcc
Code health
None
Tests · ratio 0.00
not tracked
Coverage
None
Vignettes
No
README
5
Dependencies · direct
Check history
  • NOTE2026-03-10
    12 OK · 2 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE

Downloads

5.8K
CRAN downloads in the past year
Rank #8,642 · ~16/day · ~484/mo
44930 days
1.4K90 days
5.8K1 year
Also on97 r2u7 autocran839 conda_forge
Source & community

Repository stars, issues, and contributor activity are not tracked yet.

Dependencies

Declared dependencies
5 external dependencies (excludes base and recommended)
Imports (0)
none
LinkingTo (0)
none
Suggests (0)
none
Enhances (0)
none
Reverse dependencies
3direct
indirect (not tracked)

Code

1,277Lines of code
3Exported functions

Code intelligence has not been computed for this package yet.

People & History

People (3)
Maintainer (1)
Author, Maintainer
Authors (2)
Release timeline

7 releases. Pick two to compare their code metrics; R releases are shown for context.

  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • 0.2.3Latest
    2022-03-27 · current release
  • R
    R 4.1.0 released · 2021-05-18
  • 0.2.2
    2021-02-10 · diff ↗
  • 0.2.1
    2020-11-17 · diff ↗
  • 0.2.0
    2020-11-14 · diff ↗
  • 0.1.2
    2020-10-29 · diff ↗
  • 0.1.1
    2020-10-02 · diff ↗
  • 0.1.0
    2020-08-31

Package metadata

First published
2020-08-31
Total releases
7 / 6 yrs
License
CC BY-SA 4.0
Download size
not tracked yet
Installed size
not tracked yet
With dependencies
not tracked yet