Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.

Commit 643fa77

Browse files
committed
add saving to README and vignette
1 parent d481ade commit 643fa77

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed

README.Rmd

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,30 @@ single_cell_counts =
141141
single_cell_counts
142142
```
143143

144+
## Save your `SingleCellExperiment`
145+
146+
The returned `SingleCellExperiment` can be saved with two modalities, as `.rds` or as `HDF5`.
147+
148+
### Saving as RDS (fast saving, slow reading)
149+
150+
Saving as `.rds` has the advantage that is very fast, the `.rds` file occupies very little disk space as it only stored the links for the files in your ache.
151+
152+
However it has the disadvantage that for big `SingleCellExperiment` objects, which merge a lot of HDF5 from your `get_SingleCellExperiment` the display and manipulation is going to be slow.
153+
154+
```{r, eval=FALSE}
155+
single_cell_counts |> saveRDS("single_cell_counts.rds")
156+
```
157+
158+
### Saving as HDF5 (slow saving, fast reading)
159+
160+
Saving as `.rds` has the advantage that rewrites on disk a monolithic `HDF5` and so displaying and manipulating large `SingleCellExperiment` objects, which merge a lot of HDF5 from your `get_SingleCellExperiment`, is going to be fast.
161+
162+
However it has the disadvantage that the files are going to be larger as they include the count information, and the saving process is going to be slow for large objects.
163+
164+
```{r, eval=FALSE}
165+
single_cell_counts |> saveHDF5SummarizedExperiment("single_cell_counts")
166+
```
167+
144168
## Visualise gene transcription
145169

146170
We can gather all CD14 monocytes cells and plot the distribution of HLA-A across all tissues
@@ -322,3 +346,4 @@ This project has been funded by
322346
- *Bioconductor core funding* NIH NHGRI 5U24HG004059-18
323347
- *Victoria Cancer Agency* ECRF21036
324348
- *Australian National Health and Medical Research Council* 1116955
349+
- *The Lorenzo and Pamela Galli Medical Research Trust*

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,40 @@ single_cell_counts
216216
#> Active assay: originalexp (35615 features, 0 variable features)
217217
```
218218

219+
## Save your `SingleCellExperiment`
220+
221+
The returned `SingleCellExperiment` can be saved with two modalities, as
222+
`.rds` or as `HDF5`.
223+
224+
### Saving as RDS (fast saving, slow reading)
225+
226+
Saving as `.rds` has the advantage that is very fast, the `.rds` file
227+
occupies very little disk space as it only stored the links for the
228+
files in your ache.
229+
230+
However it has the disadvantage that for big `SingleCellExperiment`
231+
objects, which merge a lot of HDF5 from your `get_SingleCellExperiment`
232+
the display and manipulation is going to be slow.
233+
234+
``` r
235+
single_cell_counts |> saveRDS("single_cell_counts.rds")
236+
```
237+
238+
### Saving as HDF5 (slow saving, fast reading)
239+
240+
Saving as `.rds` has the advantage that rewrites on disk a monolithic
241+
`HDF5` and so displaying and manipulating large `SingleCellExperiment`
242+
objects, which merge a lot of HDF5 from your `get_SingleCellExperiment`,
243+
is going to be fast.
244+
245+
However it has the disadvantage that the files are going to be larger as
246+
they include the count information, and the saving process is going to
247+
be slow for large objects.
248+
249+
``` r
250+
single_cell_counts |> saveHDF5SummarizedExperiment("single_cell_counts")
251+
```
252+
219253
## Visualise gene transcription
220254

221255
We can gather all CD14 monocytes cells and plot the distribution of
@@ -356,3 +390,4 @@ This project has been funded by
356390
- *Bioconductor core funding* NIH NHGRI 5U24HG004059-18
357391
- *Victoria Cancer Agency* ECRF21036
358392
- *Australian National Health and Medical Research Council* 1116955
393+
- *The Lorenzo and Pamela Galli Medical Research Trust*

vignettes/Introduction.Rmd

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,30 @@ single_cell_counts =
159159
single_cell_counts
160160
```
161161

162+
## Save your `SingleCellExperiment`
163+
164+
The returned `SingleCellExperiment` can be saved with two modalities, as `.rds` or as `HDF5`.
165+
166+
### Saving as RDS (fast saving, slow reading)
167+
168+
Saving as `.rds` has the advantage that is very fast, the `.rds` file occupies very little disk space as it only stored the links for the files in your ache.
169+
170+
However it has the disadvantage that for big `SingleCellExperiment` objects, which merge a lot of HDF5 from your `get_SingleCellExperiment` the display and manipulation is going to be slow.
171+
172+
```{r, eval=FALSE}
173+
single_cell_counts |> saveRDS("single_cell_counts.rds")
174+
```
175+
176+
### Saving as HDF5 (slow saving, fast reading)
177+
178+
Saving as `.rds` has the advantage that rewrites on disk a monolithic `HDF5` and so displaying and manipulating large `SingleCellExperiment` objects, which merge a lot of HDF5 from your `get_SingleCellExperiment`, is going to be fast.
179+
180+
However it has the disadvantage that the files are going to be larger as they include the count information, and the saving process is going to be slow for large objects.
181+
182+
```{r, eval=FALSE}
183+
single_cell_counts |> saveHDF5SummarizedExperiment("single_cell_counts")
184+
```
185+
162186
## Visualise gene transcription
163187

164188
We can gather all CD14 monocytes cells and plot the distribution of HLA-A across all tissues

0 commit comments

Comments
 (0)