-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsct_v2.R
58 lines (41 loc) · 2.25 KB
/
sct_v2.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# ____________________________________________________________________________
# Script information ####
# title: Process data with SCTransform V2
# author: Jose Alquicira Hernandez
# date: 2021-11-30
# description: Applies V2 SCTransform to OneK1K data
# ____________________________________________________________________________
# HPC details ####
# screen -S sct_v2
# qrsh -N sct_v2 -l mem_requested=700G
# conda activate sct2
# ____________________________________________________________________________
# Import libraries ####
library("dsLib")
library("Seurat")
library("SeuratDisk")
# ____________________________________________________________________________
# Set output ####
output <- here("results", "2021-11-30_SCT_v2")
dir.create(output)
# ____________________________________________________________________________
# Import data ####
inicio("Read data")
data <- LoadH5Seurat(here( "results", "2021-11-10_add_metadata", "onek1k.h5seurat"),
assays = list(RNA = "counts"))
Idents(data) <- "predicted.celltype.l2"
fin()
# ____________________________________________________________________________
# Remove outliers ####
data <- data[, !data$ethnic_outlier]
# ____________________________________________________________________________
# Apply SCTransform ####
inicio("Applying SCT")
data <- SCTransform(data, variable.features.n = 5000, vst.flavor = "v2", conserve.memory = TRUE)
fin()
# ____________________________________________________________________________
# Export data ####
SaveH5Seurat(data, filename = here(output, "onek1k.h5seurat"), overwrite = TRUE)
# ____________________________________________________________________________
# Session info ####
print_session(here(output))