Skip to content

Improve rarefaction docs: move explanation earlier & show niter usage for alpha/beta diversity #823

@0xMuluh

Description

@0xMuluh

Rarefaction is briefly mentioned in Chapter 12.3, but the clearer, practical explanation is only later in Chapter 15. This makes it hard for new users to understand how to use rarefyAssay() (and niter) with addAlpha() and addMDS().

Proposed changes

  • Move or duplicate the detailed rarefaction explanation from Chapter 15 into Chapter 12.3 (with cross-refs if duplicated).
  • Expand/rename Chapter 12.3 (“Rarefaction” → “Rarefying”?) to include:
    • Short rationale for rarefaction vs alternatives.
    • How to use rarefyAssay() with niter for iterative rarefaction.
    • Examples using niter in:
      • addAlpha() (alpha diversity).
      • runMDS() / addMDS() (beta diversity).
  • Briefly clarify:
    • addAlpha() vs getAlpha()
    • runMDS() vs addMDS()
      (what they do and when to use which).

Example to add (alpha diversity)

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

tse <- rarefyAssay(
  tse,
  method = "subsample",
  sample = min_reads,
  niter = 100
)

tse <- addAlpha(
  tse,
  assay_name = "counts_rarefied",
  sample = min_reads,
  niter = 100
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions