Skip to content

Commit

Permalink
Cleaned up the README and related docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Oct 13, 2024
1 parent c5e9158 commit f2f387d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ let qc_thresholds = scran.suggestRnaQcFilters(qc_metrics);
let filtered = scran.filterCells(mat, qc_thresholds.filter(qc_metrics));

// Log-normalizing.
let normalized = scran.logNormCounts(filtered);
let normalized = scran.normalizeCounts(filtered);

// Modelling per-gene variance and selecting top HVGs.
let varmodel = scran.modelGeneVariances(normalized);
Expand All @@ -90,7 +90,7 @@ let index = scran.buildNeighborSearchIndex(pcs);

// Performing the clustering.
let cluster_graph = scran.buildSnnGraph(index, { neighbors: 10 });
let clustering = scran.clusterSnnGraph(cluster_graph);
let clustering = scran.clusterGraph(cluster_graph);

// Performing the t-SNE and UMAP.
let tsne_res = scran.runTsne(index);
Expand All @@ -114,7 +114,7 @@ Developer notes are also available [here](docs/related/developer_notes.md).

## Links

Check out [kana](https://github.com/jkanche/kana) to see how **scran.js** is used in an interactive scRNA-seq analysis application.
Check out [kana](https://github.com/kanaverse/kana) to see how **scran.js** is used in an interactive scRNA-seq analysis application.

The [**scran.chan**](https://github.com/LTLA/scran.chan) R package and [**scran**](https://github.com/LTLA/scran-cli) executable
The [**scrapper**](https://github.com/libscran/scrapper) R package and [**scran**](https://github.com/LTLA/scran-cli) executable
are based on the same C++ libraries and allow the same analysis to be performed in different environments.
17 changes: 9 additions & 8 deletions docs/related/cell_type_annotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ Several datasets have been processed and made available [here](https://github.co
Assuming the files have been downloaded and are available as `ArrayBuffer`s, we load the reference:

```js
let loaded = scran.loadLabelledReferenceFromBuffers(rankbuf, markbuf, labbuf); // files 1, 2 and 3, respectively.
let loaded = scran.loadLabelCellsReferenceFromBuffers(rankbuf, markbuf, labbuf); // files 1, 2 and 3, respectively.
```

We then build the reference given `testfeatures`, an array with the names of the features in our test dataset;
and `reffeatures`, an array with the names of the features in our reference (extracted from file **4**).

```js
let built = scran.buildLabelledReference(testfeatures, loaded, reffeatures);
let built = scran.trainLabelCellsReference(testfeatures, loaded, reffeatures);
```

Finally, we can generate labels from our input matrix.
Expand All @@ -44,24 +44,25 @@ Advanced users can integrate cell labels from multiple references with the `inte
Firstly, we classify our test dataset against each of the references individually:

```js
let loaded_A = scran.loadLabelledReferenceFromBuffers(rankbuf_A, markbuf_A, labbuf_A);
let built_A = scran.buildLabelledReference(testfeatures, loaded_A, reffeatures_A);
let loaded_A = scran.loadLabelCellsReferenceFromBuffers(rankbuf_A, markbuf_A, labbuf_A);
let built_A = scran.trainLabelCellsReference(testfeatures, loaded_A, reffeatures_A);
let labels_A = scran.labelCells(mat, built_A);

let loaded_B = scran.loadLabelledReferenceFromBuffers(rankbuf_B, markbuf_B, labbuf_B);
let built_B = scran.buildLabelledReference(testfeatures, loaded_B, reffeatures_B);
let loaded_B = scran.loadLabelCellsReferenceFromBuffers(rankbuf_B, markbuf_B, labbuf_B);
let built_B = scran.trainLabelCellsReference(testfeatures, loaded_B, reffeatures_B);
let labels_B = scran.labelCells(mat, built_B);
```

We then integrate the references and the associated labels to obtain a single set of cell type calls across all references.
More specifically, this chooses the best reference for each cell, based on each reference's best cell type call for that cell.

```js
let interbuilt = scran.integrateLabelledReferences(testfeatures,
let interbuilt = scran.integrateLabelCellsReferences(
testfeatures,
[loaded_A, loaded_B],
[reffeatures_A, reffeatures_B],
[built_A, built_B]
);

let interlabels = scran.integrateCellLabels(mat, [labels_A, labels_B], inter);
let interlabels = scran.integrateLabelCells(mat, [labels_A, labels_B], inter);
```
1 change: 0 additions & 1 deletion js/modelGeneVariances.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export class ModelGeneVariancesResults {
* @return {Float64Array|Float64WasmArray} Array of length equal to the number of genes,
* containing the fitted value of the mean-variance trend for the specified `block`
* (or the average across all blocks, if `block = null`).
* Alternatively `null`, if `fillable = false` and the array was not already filled.
*/
fitted(options = {}) {
const { block = null, copy = true, ...others } = options;
Expand Down
1 change: 0 additions & 1 deletion js/suggestRnaQcFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ export function suggestRnaQcFilters(metrics, options = {}) {

/**
* Create an empty {@linkplain SuggestRnaQcFiltersResults} object, to be filled with custom results.
* Note that filling requires use of `fillable: true` in the various getters to obtain a writeable memory view.
*
* @param {number} numberOfSubsets Number of feature subsets.
* @param {number} numberOfBlocks Number of blocks in the dataset.
Expand Down

0 comments on commit f2f387d

Please sign in to comment.