Skip to content

Commit

Permalink
Restored the Leng assay names to normcounts, which is accurate.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Apr 19, 2024
1 parent aa9bfc6 commit 4fc723c
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
2 changes: 1 addition & 1 deletion R/LengESCData.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#' @export
LengESCData <- function(ensembl=FALSE, location=TRUE, legacy=FALSE) {
if (!legacy) {
sce <- fetchDataset("leng-esc-2015", "2023-12-18", realize.assays=TRUE)
sce <- fetchDataset("leng-esc-2015", "2024-04-18", realize.assays=TRUE)
} else {
version <- "2.0.0"
sce <- .create_sce(file.path("leng-esc", version), assays="normcounts", has.rowdata=FALSE)
Expand Down
55 changes: 55 additions & 0 deletions scripts/leng-esc-2015/2024-04-18.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: Update to the assay names
author: Aaron Lun
---

```{r style, echo=FALSE, results='hide', message=FALSE}
library(BiocStyle)
knitr::opts_chunk$set(error=FALSE, message=FALSE, warning=FALSE)
```

# Obtaining the old version

For reasons I don't understand, the ETL from ExperimentHub to **gypsum** changed the assay name from `normcounts` to `normalized`,
even though the [GEO entry](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE64016) clearly states that:

> Normalized expected counts are provided in GSE64016\_H1andFUCCI\_normalized\_EC.csv.gz
So, okay, we'll change it back.
First we clone the old version.

```{r}
tmp <- "update_20240418"
unlink(tmp, recursive=TRUE) # get rid of any previous directory.
gypsum::cloneVersion("scRNAseq", "leng-esc-2015", "2023-12-18", destination=tmp)
```

Now we go in and edit the names.

```{r}
assay.name.path <- file.path(tmp, "assays", "names.json")
assay.names <- jsonlite::fromJSON(assay.name.path, simplifyVector=FALSE)
assay.names
# Replacing the link with the new content; it's important to delete the link
# before doing so, otherwise we would accidentally modify the cache!
unlink(assay.name.path)
assay.names[[1]][1] <- "normcounts"
write(jsonlite::toJSON(assay.names, auto_unbox=TRUE, pretty=4), file=assay.name.path)
```

We run some validation to ensure that our modified files are still valid.

```{r}
library(alabaster.base)
validateObject(tmp)
# Confirming that the assay names changed.
readObject(tmp)
```

# Session information {-}

```{r}
sessionInfo()
```

0 comments on commit 4fc723c

Please sign in to comment.