Skip to content

addMDS drops smallest sample when sample = min(colSums(assay(tse, "counts"))) #824

@0xMuluh

Description

@0xMuluh

Reported by Anna Kaisanlahti:

  • addAlpha(sample = min(colSums(assay(tse, "counts"))) keeps the smallest-depth sample.
  • addMDS(sample = min(colSums(assay(tse, "counts"))) drops that sample unless sample is set noticeably lower.

Example: smallest sample depth = 5887 reads; addMDS(sample = 5887) drops it, but sample = 5390 keeps it. This suggests inconsistent subsampling logic between addAlpha() and addMDS() (or their underlying helpers).

Steps to reproduce

min_reads <- min(colSums(assay(tse, "counts")))

# 1) Alpha: smallest sample retained
tse_alpha <- addAlpha(tse, sample = min_reads, niter = 100)

# 2) Beta: check if smallest sample still present
tse_mds <- addMDS(tse, sample = min_reads, niter = 100)

Expected behavior

addMDS() should treat sample consistently with addAlpha() / rarefyAssay(): using the true minimum depth should not drop that smallest sample.

Actual behavior

addMDS() excludes the smallest sample when sample = min_reads; only lower values keep it.

Request

  • Confirm if this behavior is intentional.
  • If not, align addMDS() with addAlpha() and/or add a clear warning when sample will cause sample exclusion.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions