-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from aifimmunology/adt-matrix
Adds automatic ADT data detection for both 10x and AIFI injected ADT matrices to `read_h5_seurat()` and `read_h5_sce()`. To avoid confusion with previous versions that don't do this automatically, version is updated from 1.2.0 to 1.3.0.
- Loading branch information
Showing
4 changed files
with
84 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: H5weaver | ||
Type: Package | ||
Title: Read, Rearrange, and Write HDF5 files | ||
Version: 1.2.0 | ||
Version: 1.3.0 | ||
Author: Lucas Graybuck <[email protected]> | ||
Maintainer: Lucas Graybuck <[email protected]> | ||
Description: This package provides functions for reading, writing, combining, and rearranging HDF5 files with conventions from 10x Genomics. | ||
|
@@ -21,5 +21,7 @@ Suggests: | |
testthat (>= 2.1.0), | ||
Seurat (>= 3.1.0), | ||
SingleCellExperiment (>= 1.8.0), | ||
SummarizedExperiment (>= 1.16.1) | ||
SummarizedExperiment (>= 1.16.1), | ||
assertthat, | ||
R.utils | ||
RoxygenNote: 7.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
library(rhdf5) | ||
library(H5weaver) | ||
library(hise) | ||
|
||
chrM_genes <- fread(system.file("reference/GRCh38_10x_chrM_gene_metadata.csv.gz", | ||
package = "H5weaver")) | ||
h5_fid <- '1be65739-445a-41fe-89a4-52fbbba2000d' | ||
hise::cacheFiles(list(h5_fid)) | ||
sample_cite_h5 <- list.files("cache/1be65739-445a-41fe-89a4-52fbbba2000d", full.names = T) | ||
|
||
## Well 1 .h5 file | ||
sample_list <- h5dump(sample_cite_h5) | ||
sample_list <- h5_list_convert_to_dgCMatrix(sample_list) | ||
|
||
set.seed(3) | ||
keep_genes <- c(sample(sample_list$matrix$features$name, 1000), chrM_genes$name) | ||
sample_keep <- match(keep_genes, sample_list$matrix$features$name) | ||
|
||
sample_list$matrix_dgCMatrix <- sample_list$matrix_dgCMatrix[sample_keep,] | ||
|
||
sample_list$matrix$features$name <- sample_list$matrix$features$name[sample_keep] | ||
sample_list$matrix$features$genome <- sample_list$matrix$features$genome[sample_keep] | ||
sample_list$matrix$features$feature_type <- sample_list$matrix$features$feature_type[sample_keep] | ||
sample_list$matrix$features$interval <- sample_list$matrix$features$interval[sample_keep] | ||
|
||
sample_list <- h5_list_convert_from_dgCMatrix(sample_list) | ||
|
||
write_h5_list(sample_list, | ||
"cite_sample1.h5", | ||
overwrite = TRUE) | ||
h5closeAll() | ||
|