Venkatachalam commited on
Commit
c8821c5
·
1 Parent(s): 63b46b2

Initial commit: Add Human Optic Nerve Fibroblasts snRNA-seq dataset

Browse files
README.md ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - found
4
+ language:
5
+ - en
6
+ license: cc-by-4.0
7
+ multilinguality: monolingual
8
+ pretty_name: Human Optic Nerve Fibroblasts (snRNA-seq)
9
+ size_categories:
10
+ - 10K<n<100K
11
+ source_datasets:
12
+ - original
13
+ tags:
14
+ - single-cell
15
+ - snRNA-seq
16
+ - human
17
+ - optic-nerve
18
+ - fibroblasts
19
+ - aging
20
+ - cellxgene
21
+ - anndata
22
+ - gene-expression
23
+ - pca
24
+ - dimensionality-reduction
25
+ ---
26
+
27
+ # Human Optic Nerve Fibroblasts (snRNA-seq) Dataset
28
+
29
+ ## **1. Data Overview**
30
+
31
+ This dataset comprises single-nucleus RNA sequencing (snRNA-seq) data specifically focusing on fibroblasts from the human optic nerve and optic nerve head. It represents a valuable resource for investigating cell-type specific gene expression profiles within a critical ocular tissue.
32
+
33
+ The data was sourced from the CZ CELLxGENE Discover API, providing access to a deeply characterized single-cell atlas. It has been processed and converted into standardized .h5ad and .parquet formats for ease of use in machine learning and bioinformatics pipelines, enabling high-resolution insights into tissue biology.
34
+
35
+ ### **Relevance to Aging Research**
36
+
37
+ The human optic nerve and optic nerve head are highly susceptible to age-related degeneration, playing a critical role in conditions like glaucoma, a leading cause of irreversible blindness, which is strongly associated with aging. Fibroblasts, as structural and supportive cells, are crucial for maintaining the extracellular matrix and contributing to tissue integrity and repair in the optic nerve.
38
+
39
+ Age-related changes in fibroblast function, extracellular matrix remodeling, and gene expression are known to contribute to tissue stiffening, inflammation, and cellular senescence, all of which are hallmarks of aging. By providing a single-cell resolution view of these specific cells, this dataset offers an unprecedented opportunity to:
40
+
41
+ - Identify age-specific molecular signatures within optic nerve fibroblasts.
42
+ - Uncover how cellular processes like matrix production, inflammation, and stress response change with age at the single-cell level.
43
+ - Discover biomarkers or therapeutic targets related to age-associated optic neuropathies.
44
+ - Investigate the contribution of fibroblast aging to the overall aging process of the visual system.
45
+
46
+ This dataset thus serves as a powerful resource for understanding the intricate molecular mechanisms of aging within a vital human tissue.
47
+
48
+ ## **2. Source**
49
+
50
+ The original data for this processed dataset originates from a single-nucleus RNA sequencing study of the human optic nerve.
51
+
52
+ **Organism:** Homo sapiens (Human)
53
+ **Tissue:** Optic nerve, Optic nerve head, Optic disc, Cranial nerve II
54
+ **Cell Type:** Fibroblasts
55
+ **Technology:** 10x Genomics 3' v3 snRNA-seq
56
+ **Condition:** Normal
57
+ **Number of Cells:** 118,925
58
+ **Original AnnData File Used:** f5b09167-e4b5-4f32-b7b4-f0b7c402a4c4.h5ad (downloaded from CELLxGENE Discover)
59
+
60
+ ## **3. Transformations**
61
+
62
+ The data has undergone the following transformations using the provided Python script:
63
+
64
+ 1. **AnnData Loading:** The original .h5ad file was loaded into an AnnData object, a standard format for single-cell data.
65
+ 2. **Expression Data Extraction and Conversion:** The adata.X matrix (raw or normalized gene expression data) was extracted and converted into a dense Pandas DataFrame, then saved as `expression.parquet`. This step handles both sparse and dense matrix formats.
66
+ 3. **Feature Metadata Extraction and Conversion:** The `adata.var` DataFrame (containing metadata about each gene/feature) was extracted and saved as `feature_metadata.parquet`.
67
+ 4. **Observation Metadata Extraction and Conversion:** The `adata.obs` DataFrame (containing metadata about each cell/observation, such as cell type annotations or sample information) was extracted and saved as `observation_metadata.parquet`. This is crucial for downstream machine learning tasks involving cell annotation or phenotypic analysis.
68
+ 5. **Principal Component Analysis (PCA):**
69
+ * The expression data was optionally scaled (standardized to have a mean of 0 and a standard deviation of 1) to ensure that features with larger values do not dominate the PCA.
70
+ * PCA was performed to reduce the dimensionality of the expression data, projecting it into a lower-dimensional space while retaining most of the variance. The number of principal components generated is configurable (defaulting to 50 in the script).
71
+ * The transformed PCA components were saved as `pca_components.parquet`.
72
+ * The explained variance ratio for each principal component was also saved as `pca_explained_variance.parquet`, indicating how much variance each component captures.
73
+
74
+ ## **4. Contents**
75
+
76
+ The processing script generates an output directory named `snRNA-seq_of_human_optic_nerve_and_optic_nerve_head_endothelial_cells_ml_data` (or your configured `OUTPUT_DIR_NAME`), containing the following Parquet files:
77
+
78
+ - **`expression.parquet`**: Contains the gene expression matrix. Each row represents a cell (observation), and each column represents a gene (feature). This is the primary input for most downstream analyses.
79
+ - **`feature_metadata.parquet`**: Contains metadata about each gene, such as gene symbols, Ensembl IDs, and other relevant annotations.
80
+ - **`observation_metadata.parquet`**: Contains comprehensive metadata for each cell, including (but not limited to) inferred cell types, sample origin, patient information, and experimental conditions. This is often used for labeling and grouping cells in ML tasks.
81
+ - **`pca_components.parquet`**: Contains the data after dimensionality reduction using PCA. Each row corresponds to a cell, and columns represent the principal components (e.g., PC1, PC2, ..., PC50). This reduced-dimension representation is ideal for visualization, clustering, and as input for other machine learning models.
82
+ - **`pca_explained_variance.parquet`**: A table showing the proportion of variance explained by each principal component. Useful for determining the optimal number of components to retain and understanding the information captured by the PCA.
83
+
84
+ ## **5. Usage**
85
+
86
+ This dataset is ideal for a variety of research and machine learning tasks, including:
87
+
88
+ ### **Single-Cell Analysis**
89
+
90
+ Exploring cellular heterogeneity, identifying novel cell states, and characterizing gene expression patterns in the optic nerve's fibroblasts.
91
+
92
+ ### **Aging Research**
93
+
94
+ Investigating age-related changes in fibroblast gene expression and function within the optic nerve, identifying biomarkers or therapeutic targets for age-related ocular diseases.
95
+
96
+ ### **Machine Learning**
97
+
98
+ - **Clustering:** Applying clustering algorithms (e.g., K-Means, Louvain) on `pca_components.parquet` to identify distinct cell populations.
99
+ - **Classification:** Building models to classify cell types or disease states using `pca_components.parquet` as features and `observation_metadata.parquet` for labels.
100
+ - **Dimensionality Reduction & Visualization:** Using the PCA components for generating 2D or 3D plots (e.g., with UMAP or t-SNE) to visualize cell relationships.
101
+ - **Feature Selection:** Identifying key genes or principal components relevant to specific biological questions.
102
+
103
+ ### **Biomarker Discovery**
104
+
105
+ Pinpointing genes or pathways implicated in optic nerve health and age-related visual impairment.
106
+
107
+ ### **Direct Download and Loading from Hugging Face Hub**
108
+
109
+ This dataset is hosted on the Hugging Face Hub, allowing for easy programmatic download and loading of its component Parquet files.
110
+
111
+ ```python
112
+ import pandas as pd
113
+ from huggingface_hub import hf_hub_download
114
+ import os
115
+
116
+ # Define the Hugging Face repository ID and the local directory for downloads
117
+ HF_REPO_ID = "longevity-db/snRNA-seq_of_human_optic_nerve_and_optic_nerve_head_endothelial_cells_ml_data"
118
+ LOCAL_DATA_DIR = "downloaded_optic_nerve_data" # Suggest a distinct name
119
+
120
+ os.makedirs(LOCAL_DATA_DIR, exist_ok=True)
121
+ print(f"Created local download directory: {LOCAL_DATA_DIR}")
122
+
123
+ # List of Parquet files to download
124
+ parquet_files = [
125
+ "expression.parquet",
126
+ "pca_components.parquet",
127
+ "observation_metadata.parquet",
128
+ "feature_metadata.parquet",
129
+ "pca_explained_variance.parquet"
130
+ ]
131
+
132
+ # Download each file
133
+ downloaded_paths = {}
134
+ for file_name in parquet_files:
135
+ path = hf_hub_download(repo_id=HF_REPO_ID, filename=file_name, local_dir=LOCAL_DATA_DIR)
136
+ downloaded_paths[file_name] = path
137
+ print(f"Downloaded {file_name} to: {path}")
138
+
139
+ # Load core data for model training using the downloaded paths
140
+ df_expression = pd.read_parquet(downloaded_paths["expression.parquet"])
141
+ df_pca_components = pd.read_parquet(downloaded_paths["pca_components.parquet"])
142
+ df_obs_metadata = pd.read_parquet(downloaded_paths["observation_metadata.parquet"])
143
+ df_feature_metadata = pd.read_parquet(downloaded_paths["feature_metadata.parquet"])
144
+ df_pca_explained_variance = pd.read_parquet(downloaded_paths["pca_explained_variance.parquet"])
145
+
146
+
147
+ print("\n--- Data Loaded from Hugging Face Hub ---")
148
+ print("Expression data shape:", df_expression.shape)
149
+ print("PCA components shape:", df_pca_components.shape)
150
+ print("Observation metadata shape:", df_obs_metadata.shape)
151
+ print("Feature metadata shape:", df_feature_metadata.shape)
152
+ print("PCA explained variance shape:", df_pca_explained_variance.shape)
153
+
154
+
155
+ # Example: Prepare data for an age prediction model
156
+ # Ensure 'age' column exists in df_obs_metadata for this example.
157
+ # (Note: You might need to inspect 'df_obs_metadata.columns' to find the actual age column name,
158
+ # as it might be 'age_group', 'Age', etc., depending on the original dataset annotations.)
159
+ if 'age' in df_obs_metadata.columns: # Replace 'age' with the actual column name if different
160
+ X = df_pca_components # Features for the model
161
+ y = df_obs_metadata['age'] # Target variable (e.g., age of cell's donor)
162
+ print(f"Prepared X (features) with shape {X.shape} and y (labels) with shape {y.shape}")
163
+ else:
164
+ print("\nNo 'age' column explicitly named 'age' found in observation metadata for age prediction example.")
165
+ print("Please inspect 'df_obs_metadata.columns' to find the relevant age-related column (e.g., 'Age', 'age_group').")
166
+
167
+
168
+ # This data can then be split into train/test sets and used to train a model.
169
+ # The resulting model can then be documented using a Hugging Face Model Card.
170
+ ```
171
+
172
+ ### **Creating a Model Card**
173
+
174
+ The structured Parquet files in this dataset are perfectly suited for generating comprehensive **Hugging Face Model Cards** for models trained using this data. The various components provide crucial information for different sections of a model card:
175
+
176
+ - **`Data Overview`:** Information directly from this README (sections 1 and 2), describing the dataset's origin, scope, and relevance.
177
+ - **`Usage Examples`:** The provided Python code for loading the data demonstrates how a model might consume `expression.parquet` or `pca_components.parquet` (as input features) and `observation_metadata.parquet` (for labels like 'age' or 'cell\_type').
178
+ - **`Limitations and Bias`:** `observation_metadata.parquet` can be analyzed to understand the demographics (e.g., age distribution, sex, ethnicity if available) of the original donors, helping to identify potential biases or limitations in the dataset's representativeness.
179
+ - **`Dataset Transformations`:** Details from section 3 of this README, explaining how the data was preprocessed before model training.
180
+ - **`Metrics and Evaluation Data`:** If a model is trained, `pca_components.parquet` and `observation_metadata.parquet` can be used as inputs for evaluation metrics, and their distributions can be visualized as part of the model card's evaluation section.
181
+ - **`Environmental Impact`:** Details on the computational resources (e.g., CPU/GPU hours) used for data processing or model training, which can be part of a model card.
182
+
183
+ ## **6. Citation**
184
+
185
+ Please ensure you cite the original source of the data from CELLxGENE Discover. The specific publication for this dataset (GSE67547) can be found on its NCBI GEO page:
186
+
187
+ **NCBI GEO Accession:** [GSE67547](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE67547)
188
+
189
+ When using the cellxgene\_census API, you may also consider citing the Census project:
190
+ [CELLxGENE Census](https://www.google.com/search?q=https://cellxgene.cziscience.com/about/citations)
191
+
192
+ ## **7. Contributions**
193
+
194
+ This dataset was processed and prepared by:
195
+
196
+ - Venkatachalam
197
+ - Pooja
198
+ - Albert
199
+
200
+ *Curated on June 15, 2025.*
201
+
202
+ **Hugging Face Repository:** [https://huggingface.co/datasets/longevity-db/snRNA-seq\_of\_human\_optic\_nerve\_and\_optic\_nerve\_head\_endothelial\_cells\_ml\_data](https://huggingface.co/datasets/longevity-db/snRNA-seq_of_human_optic_nerve_and_optic_nerve_head_endothelial_cells_ml_data)
expression.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f73f6dec33aa7c83c5939163bc75f43176616200649d7d0971e1fca69dfd0a5
3
+ size 603792869
feature_metadata.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e174a2f8fb52ea25abd012076a68ef5580a73e608984861a14e8e597af63d324
3
+ size 494010
observation_metadata.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c92ac527d590752d8162f38309af168f6c1e04da041d2202fb1f1a8fa8f8b56b
3
+ size 1899590
pca_components.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9119194b5e5d1bfde817a8ad2ce7b67da32f0b0c8998ffb53bb45baa28c7025
3
+ size 17504566
pca_explained_variance.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:719d2e6e4dfd7640291f25767e7bc2749658f629856ea45d096e0d5c3356aa90
3
+ size 2740