Skip to content

Instantly share code, notes, and snippets.

@partrita
Last active March 29, 2024 02:50
Show Gist options
  • Select an option

  • Save partrita/4610f755de91e70d293fd5fbef1f3430 to your computer and use it in GitHub Desktop.

Select an option

Save partrita/4610f755de91e70d293fd5fbef1f3430 to your computer and use it in GitHub Desktop.
snippet of scRAN-seq data load

GSE에 저장된 데이터에서 많이 보이는 유형

  1. 다음과 같이 3개의 파일로 구성(10X MEX 데이터 유형)
  • barcodes.tsv.gz, features.tsv.gz, and matrix.mtx.gz
  1. hdf5 포멧의 단일 파일

Seurat을 사용해 불러오기

10X MEX 형태 데이터 불러오기

data_dir <- "path/to/data/directory"
list.files(data_dir
 # Should show barcodes.tsv.gz, features.tsv.gz, and matrix.mtx.gz
data <- Read10X(data.dir = data_dir)
seurat_obj <-t = CreateSeuratObject(counts = data$`Gene Expression`)

hdf5 형태 데이터 불러오기

library(Seurat)

data <- Read10X_h5("../{filtered_feature_bc_matrix}.h5")
seurat_obj <- CreateSeuratObject(counts=data, min.cells=3, min.features=200)

Scanpy으로 불러오기

10X MEX 형태 데이터 불러오기

import scanpy as sc
file_path = "../input/{filtered_feature_bc_matrix}"
adata = sc.read_10x_mtx(file_path, var_names="gene_symbols", cache=True)
adata.var_names_make_unique()
adata

hdf5 형태 데이터 불러오기

import scanpy as sc
adata = sc.read_10x_h5("../input/{filtered_feature_bc_matrix}.h5")
adata.var_names_make_unique()
adata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment