Skip to content

Commit

Permalink
Add summary statistic for the number of detected features
Browse files Browse the repository at this point in the history
  • Loading branch information
csoneson committed May 2, 2024
1 parent 26cd706 commit 3359934
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Add support for importing Spectronaut PG pivot files
* Add initial support for reading Spectronaut setup.txt files
* Add BioGRID column in link table
* Add summary statistic for the number of detected features

# einprot 0.9.3

Expand Down
26 changes: 26 additions & 0 deletions inst/extdata/process_basic_template.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,32 @@ if (length(no_feats) > 0) {
}
```

# Number or detected features

As a summary statistic, we calculate the number of features that are
observed (non-missing) in at least `r minNbrValidValues` samples, or in at
least `r minNbrValidValues` samples from the same group.

```{r}
## Total number of observed features
nbrFeaturesObsTotal <- length(which(
rowSums(!assay(sce, aNames$assayImputIndic)) >= minNbrValidValues))
## Number of features observed in at least one group
nbrObsPerGroup <- rowsum(t((!assay(sce, aNames$assayImputIndic)) + 0),
group = sce$group)
nbrFeaturesObsInGroup <- length(which(
apply(nbrObsPerGroup, 2, max) >= minNbrValidValues))
Lobs <- list(nbrFeaturesObsTotal, nbrFeaturesObsInGroup)
names(Lobs) <- c(paste0("Number of features observed in at least ",
minNbrValidValues, " samples"),
paste0("Number of features observed in at least ",
minNbrValidValues, " samples from the same group"))
makeTableFromList(Lobs)
```


```{r text-norm, results="asis", echo=FALSE}
cat(normText(normMethod = normMethod))
```
Expand Down

0 comments on commit 3359934

Please sign in to comment.