Skip to content

Can't make sense of sanity checks in 'Density preserving t-SNE and UMAP' section #24

@PeteHaitch

Description

@PeteHaitch

These stopifnot() checks are currently failing for me on macOS (arm64) in BioC 3.221:

```{r, echo=FALSE}
ds <- reducedDim(sce.zeisel, "dens-SNE")
ts <- reducedDim(sce.zeisel, "TSNE")
du <- reducedDim(sce.zeisel, "dens-SNE")
tu <- reducedDim(sce.zeisel, "TSNE")
ds <- scale(ds)
ts <- scale(ts)
du <- scale(du)
tu <- scale(tu)
vars_d <- colVars(ds[sce.zeisel$level1class == "astrocytes_ependymal", ])
vars_t <- colVars(ts[sce.zeisel$level1class == "astrocytes_ependymal", ])
stopifnot(mean(vars_d) > mean(vars_t))
vars_d <- colVars(du[sce.zeisel$level1class == "astrocytes_ependymal", ])
vars_t <- colVars(tu[sce.zeisel$level1class == "astrocytes_ependymal", ])
stopifnot(mean(vars_d) > mean(vars_t))
```

@alanocallaghan I've realised I don't understand what the sanity checks in this section are supposed to be checking
Can you please add some comments explaining what these checks are for?

Moreover:

  • I don't really understand why dt, dm, ds, du are created. AFAICT the dt, ds, du are all identical (at least prior to calling scale()). Also, it seems like du should probably be du <- dm i.e. du <- reducedDim(sce.zeisel, "densMAP"), so it seems like the checks were probably never checking what they were supposed to ... Can this code please be checked and simplified to avoid making redundant objects and avoiding re-using the same name for different objects and vice versa.
  • Should there be some calls to set.seed() to ensure reproducibility? These are used pretty liberally throughout the rest of OSCA, particularly to help with cases of sections getting moved around, or earlier sections being commented out, and where the random seed might therefore be altered by the time the build gets to this section in the book.
  • In this same section, r Biocpkg("densviz") should be r Biocpkg("densvis")

Footnotes

  1. This is when using change proposed in https://github.com/alanocallaghan/densvis/issues/10 so that densvis works on macOS (arm64).

Metadata

Metadata

Assignees

No one assigned

    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