-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnorm.R
56 lines (39 loc) · 2.14 KB
/
norm.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
# ____________________________________________________________________________
# Script information ####
# title: Seurat normalization
# author: Jose Alquicira Hernandez
# date: 2021-12-02
# description: Performs scale factor normalization
# ____________________________________________________________________________
# HPC details ####
# screen -S norm
# qrsh -N norm -l mem_requested=100G
# conda activate r-4.1.1
# ____________________________________________________________________________
# Import libraries ####
library("dsLib")
library("Seurat")
library("SeuratDisk")
# ____________________________________________________________________________
# Set output ####
output <- here("results", "2021-12-02_norm")
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]
# ____________________________________________________________________________
# Normalize data ####
data <- NormalizeData(data)
# ____________________________________________________________________________
# Export data ####
SaveH5Seurat(data, filename = here(output, "onek1k.h5seurat"), overwrite = TRUE)
# ____________________________________________________________________________
# Session info ####
print_session(here(output))