Skip to content

Commit

Permalink
Merging staging branch into prod branch
Browse files Browse the repository at this point in the history
  • Loading branch information
kaloster committed Oct 28, 2024
2 parents 537dacf + 2624b13 commit 3bea10a
Show file tree
Hide file tree
Showing 28 changed files with 48 additions and 128 deletions.
12 changes: 12 additions & 0 deletions frontend/doc-site/032__Contribute and Publish Data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ Each dataset needs the following information added to a single h5ad (AnnData 0.1
- **Features in var & raw.var (if present)**:
- index is Ensembl ID
- preference is that gene have not been filtered in order to maximize future data integration efforts
- **Additional standards for single-capture area Visium datasets** (largely aligns with [scanpy’s model](https://scanpy.readthedocs.io/en/stable/generated/scanpy.read_visium.html), [this notebook](https://github.com/Lattice-Data/lattice-tools/blob/main/cellxgene_resources/curation_visium.ipynb) may be helpful to curate from Space Ranger outputs):
- Empty spots must be included (should be 4992 observations)
- obsm['spatial']
- obs['array_row']
- obs['array_col']
- obs['in_tissue']
- uns['spatial'][library_id]['images']['fullres'] fullres image (preferred)
- uns['spatial'][library_id]['images']['hires'] hires image
- uns['spatial'][library_id]['scalefactors']['spot_diameter_fullres']
- uns['spatial'][library_id]['scalefactors']['tissue_hires_scalef']
- **Additional standards for single-puck Slide-seq datasets**:
- obsm['spatial']

## Data Submission Policy

Expand Down
13 changes: 13 additions & 0 deletions frontend/doc-site/03__Download Published Data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,16 @@ Click the white Download button for the dataset that you wish to download.
<Image src={"/doc-site/downloadDialog.png"} />

Select either the h5ad (AnnData v0.10) or rds (Seurat v5) download format. Click the blue Download button to download the dataset via the browser. The permanent download link can also be copied, shared, and pasted into a browser address bar.

<a name="seurat-deprecated"></a>
## Deprecation of Seurat Downloads on CELLxGENE Discover

We are deprecating Seurat downloads on the CELLxGENE Discover platform, effective late 2024. While Seurat support has served many of our users, ongoing support has become unsustainable due to limitations in conversion tools and cross-ecosystem interoperability.This decision aligns with our shift towards a Python-based ecosystem, consistent with our Virtual Cell Platform (VCP) and Census strategies. As our platform increasingly supports new types of spatial and multimodal assays, focusing on Python will enable us to deliver a more consistent and scalable user experience.

### Availability of Earlier Seurat Downloads

Please note that earlier Seurat downloads will continue to be available. Previous versions of datasets will not be removed, and any Seurat RDS files that were previously downloaded will remain accessible. These can still be accessed via their URL ([encoded](https://github.com/chanzuckerberg/single-cell-curation/blob/main/schema/5.2.0/seurat_encoding.md) as a [citation](https://github.com/chanzuckerberg/single-cell-curation/blob/main/schema/5.2.0/schema.md#citation) in the dataset's @misc slot) or through the [Discover API](https://api.cellxgene.cziscience.com/curation/ui/#/) (`GET dataset versions`). This ensures that any ongoing research is not disrupted.

### Seurat Support

If you need to convert h5ad files to Seurat, there are some community-supported tools that can assist with this task, though we caution that these tools may be less stable. Please reach out to the [Seurat community](https://github.com/satijalab/seurat) for supported methods of conversion from AnnData to Seurat formats. We appreciate your understanding as we continue to refine our platform for reliability and future growth.
Original file line number Diff line number Diff line change
Expand Up @@ -112,110 +112,3 @@ _For the most up-to-date and comprehensive list of options, run `cellxgene prepa
`--set-var-names` controls which field in `anndata.var` (gene metadata) is used as the index for genes. Default is `anndata.var.names`

`--output` and `--overwrite` control where the processed data is saved.

<a name="seurat-deprecated"></a>
## Deprecation of Seurat Downloads on CELLxGENE Discover

We are deprecating Seurat downloads on the CELLxGENE Discover platform, effective late 2024. While Seurat support has served many of our users, ongoing support has become unsustainable due to limitations in conversion tools and cross-ecosystem interoperability.This decision aligns with our shift towards a Python-based ecosystem, consistent with our Virtual Cell Platform (VCP) and Census strategies. As our platform increasingly supports new types of spatial and multimodal assays, focusing on Python will enable us to deliver a more consistent and scalable user experience.

### Availability of Earlier Seurat Downloads

Please note that earlier Seurat downloads will continue to be available. Previous versions of datasets will not be removed, and any Seurat RDS files that were previously downloaded will remain accessible. These can still be accessed via their URL (encoded as a citation in the dataset's @misc slot) or through the Discover API (`GET dataset versions`). This ensures that any ongoing research is not disrupted.

### Recommended Alternatives

For users seeking alternatives, we recommend leveraging the AnnData format, which integrates well with the Python-based scverse toolchain (including scanpy and squidpy). For R users, the preferred approach is to utilize the CELLxGENE Census R API or tools such as the cellxgenedp package, which can convert AnnData datasets into formats compatible with R toolchains like Bioconductor. This solution allows continued access to high-quality data and analytical capabilities without the challenges associated with Seurat conversions.

If you need to convert h5ad files to Seurat, there are some community-supported tools that can assist with this task, though we caution that these tools may be less stable. Please reach out to the Seurat community for supported methods of conversion from AnnData to Seurat formats. We appreciate your understanding as we continue to refine our platform for reliability and future growth.

### Converting `h5ad` Files to Seurat `RDS` Files

To convert an `h5ad` file (used by Scanpy) to a Seurat `RDS` file (for use in R), you can follow a few key steps that involve using intermediate conversions and specific R packages.

### Option 1 - Using `zellkonverter` and `SingleCellExperiment`

**1. You will need `zellkonverter` and `SingleCellExperiment` installed. Run the following in R:**

```R
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")

BiocManager::install("zellkonverter")
BiocManager::install("SingleCellExperiment")
```

**2. Load the .h5ad file and convert it**

```R
library(zellkonverter)
library(SingleCellExperiment)

# Specify the path to your .h5ad file
h5ad_file <- "path/to/your/file.h5ad"

# Read the .h5ad file into a SingleCellExperiment object
sce <- readH5AD(h5ad_file)

# Save the object as an .rds file
saveRDS(sce, file = "output_file.rds")
```

**3. Verify and Load the RDS file**

```R
sce_loaded <- readRDS("output_file.rds")
```

### Option 2 - Using `SeuratDisk`

**1. Convert the `h5ad` file into an `h5Seurat` file using the `Convert` function:**

```R
library(SeuratDisk)
Convert("path_to_file.h5ad", dest = "h5seurat", overwrite = TRUE)
```

**2. Load the `h5Seurat` file into a Seurat object:**

```R
seurat_object <- LoadH5Seurat("path_to_file.h5seurat")
```

**3. Save the Seurat object as an `RDS` file:**

```R
saveRDS(seurat_object, file = "output_file.rds")
```

**4. Verify and Load the `RDS` file**

```R
seurat_loaded <- readRDS("output_file.rds")
```

### Option 3 - Using `reticulate` with Python's Scanpy

If you encounter issues or need to customize the conversion, you can read the `h5ad` file in Python using the reticulate package and extract the necessary data into R:

**1. Import the scanpy package and read the h5ad file:**

```R
library(reticulate)
scanpy <- import("scanpy")
adata <- scanpy$read_h5ad("path/to/your/file.h5ad")
```

**2. Extract the count data and convert it into a Seurat object:**

```R
counts <- t(adata$layers["counts"])
colnames(counts) <- adata$obs_names$to_list()
rownames(counts) <- adata$var_names$to_list()
counts <- Matrix::Matrix(as.matrix(counts), sparse = TRUE)

seurat_obj <- CreateSeuratObject(counts)
saveRDS(seurat_obj, "output_file.rds")

```

These methods provide flexibility for handling different versions or data structures in your h5ad files. For more detailed guidance, you can refer to the documentation on [SeuratDisk's GitHub](https://mojaveazure.github.io/seurat-disk/articles/convert-anndata.html) and [discussions on GitHub](https://github.com/satijalab/seurat/issues).
2 changes: 1 addition & 1 deletion frontend/src/components/BottomBanner/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const FORM_CONTAINER_ID_QUERY = `#${FORM_CONTAINER_ID}`;
export const BOTTOM_BANNER_EXPIRATION_TIME_MS = 30 * 24 * 60 * 60 * 1000; // 30 days
export const BOTTOM_BANNER_LAST_CLOSED_TIME_KEY = "bottomBannerLastClosedTime";
export const BOTTOM_BANNER_SURVEY_LINK_TEXT = "quick survey.";
export const BOTTOM_BANNER_SURVEY_TEXT = "Send us feedback with this";
export const BOTTOM_BANNER_SURVEY_TEXT = " Send us feedback with this";

export const NEWSLETTER_SIGNUP_TITLE = "Join Our Newsletter";
export const NEWSLETTER_SIGNUP_MESSAGE = "Thanks for subscribing!";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ interface Props {

const MEGA_BYTES = 2 ** 20;

const DOC_SITE_URL =
"/docs/05__Annotate%20and%20Analyze%20Your%20Data/5_3__Preparing%20Data#seurat-deprecated";
const DOC_SITE_URL = "/docs/03__Download%20Published%20Data#seurat-deprecated";

const Details: FC<Props> = ({
downloadPreview,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import Header from "../Header";
import LandingFooter from "../LandingFooter";
import LandingHeader from "../MobileFriendlyHeader";
import { Wrapper } from "./style";
import BottomBanner from "../BottomBanner";
import { BANNER_FEEDBACK_SURVEY_LINK } from "src/common/constants/airtableLinks";

interface Props {
children: ReactNode;
Expand Down Expand Up @@ -34,6 +36,7 @@ const Layout = ({ children }: Props) => {
/>
{children}
<LandingFooter />
<BottomBanner surveyLink={BANNER_FEEDBACK_SURVEY_LINK} />
</>
);
} else if (pathname === ROUTES.CELL_GUIDE) {
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 3bea10a

Please sign in to comment.