Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish the get-started guide #97

Merged
merged 3 commits into from
Nov 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions vignettes/laminr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Get started"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Getting started}
%\VignetteIndexEntry{Get started}
%\VignetteEncoding{UTF-8}
%\VignetteEngine{knitr::rmarkdown}
---
Expand All @@ -18,7 +18,7 @@ knitr::opts_chunk$set(
submit_eval <- laminr:::.get_user_settings()$handle != "testuser1"
```

This vignettes introduce the basic workflow.
This vignette introduces the basic **{laminr}** workflow.

# Setup

Expand All @@ -41,8 +41,9 @@ lamin connect <owner>/<name>
```

This instance acts as the default instance for everything that follows.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope this is clear enough. If another sentence is needed please add.

Any new records or other changes will be added here.

# Start an R session
# Connect to the default instance
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it problematic to say "connect to the default instance" in this heading, @lazappi, because that just happened 3 lines above on the command line. Don't you agree?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how it reads now:

image

I felt that if one calls it "Start an R session" and then people see that they create an instance object by calling connect() in R one avoids calling two different things (CLI connect vs R connect()) with the same name "connect to the default instance".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in new PR.


Load **{laminr}** to get started.

Expand All @@ -57,7 +58,7 @@ db <- connect()
db
```

It allows you to manage all datasets & metadata entities with auto-complete.
It is used to manage all datasets and metadata entities.

# Track data lineage
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

People should get used to calling track() first thing.


Expand Down Expand Up @@ -86,7 +87,8 @@ cellxgene

# Download a dataset

Artifacts are objects that bundle data and associated metadata. An artifact can be any file or folder but is typically a dataset.
Artifacts are objects that bundle data and associated metadata.
An artifact can be any file or folder but is typically a dataset.

```{r get-artifact}
artifact <- cellxgene$Artifact$get("7dVluLROpalzEh8mNyxk")
Expand All @@ -98,7 +100,7 @@ artifact

You can view detailed information about this dataset on LaminHub: https://lamin.ai/laminlabs/cellxgene/artifact/7dVluLROpalzEh8mNyxk.

You can search & query more datasets here: https://lamin.ai/laminlabs/cellxgene/artifacts.
You can search and query more CELLxGENE datasets here: https://lamin.ai/laminlabs/cellxgene/artifacts.
</div>

To download the dataset and load it into memory, run:
Expand All @@ -114,7 +116,6 @@ This artifact contains an [`AnnData`](https://anndata.readthedocs.io) object.
**Tip**

If you prefer a path to a local file or folder, call `path <- artifact$cache()`.

</div>

# Work with the data
Expand All @@ -126,10 +127,12 @@ Here, marker genes are calculated for each of the provided cell type labels usin
# Create a Seurat object
seurat <- SeuratObject::CreateSeuratObject(
counts = as(Matrix::t(adata$X), "CsparseMatrix"),
meta.data = adata$obs,
meta.data = adata$obs
)
# Set cell identities to the provided cell type annotation
SeuratObject::Idents(seurat) <- "cell_type"
# Normalise the data
seurat <- Seurat::NormalizeData(seurat)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that this let's peoples memory and storage explode; that's why I removed it. It'd be a bad experience if upload or compute etc. took long -- so keeping data small would be good.

If it's not actually an issue anymore, it's all good!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignored in new PR.

# Test for marker genes (the output is a data.frame)
markers <- Seurat::FindAllMarkers(
seurat,
Expand Down
Loading