Skip to content

Commit add7e6c

Browse files
committed
added some documentation
1 parent 1935dfa commit add7e6c

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

scripts/create_object.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ library(dplyr)
66
load("./tmp/base_image.RData")
77

88
for (i in 1:nrow(samples)) {
9-
x <- Read10X(
9+
x <- Read10X( # pulling data with no filter
1010
data.dir = samples$dir[i]
1111
)
12-
str_section_head("Raw Object")
13-
x <- CreateSeuratObject(
12+
str_section_head("Raw Object") # logging
13+
x <- CreateSeuratObject( # certain data will gen null matrix sans filters
1414
counts = x,
1515
project = samples$project[i],
1616
min.cells = params["min.cells", ],
@@ -20,15 +20,15 @@ for (i in 1:nrow(samples)) {
2020
x,
2121
pattern = "(?i)^MT-"
2222
)
23-
str_section_head("Base Seurat Object")
23+
str_section_head("Base Seurat Object") # logging
2424
x <- subset(
2525
x,
2626
nCount_RNA > params["min.count", ] &
2727
nCount_RNA < params["max.count", ] &
2828
percent.mt < params["percent.mt", ]
2929
)
3030
x <- NormalizeData(x)
31-
str_section_head("Subset, Normalized")
31+
str_section_head("Subset, Normalized") # logging
3232
genes <- rownames(x)
3333
x <- ScaleData(
3434
x,
@@ -46,15 +46,15 @@ for (i in 1:nrow(samples)) {
4646
samples$name[i],
4747
x
4848
)
49-
str_section_head("Scaled")
49+
str_section_head("Scaled") # logging
5050
}
5151

5252
# create and save list of seurat objects
5353
objects <- list()
5454
for (i in samples$name) {
5555
objects <- c(
5656
objects,
57-
get(i)
57+
get(i) # need get() to call object instead of string
5858
)
5959
}
6060

scripts/integrate.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ for (i in 1:nrow(samples)) {
1717
dims = 1:d
1818
)
1919
DefaultAssay(x) <- "integrated"
20-
str_section_head("Integrated")
20+
str_section_head("Integrated") # logging
2121
all.genes <- rownames(x)
2222
x <- ScaleData(
2323
x,
@@ -34,7 +34,7 @@ for (i in 1:nrow(samples)) {
3434
reduction = "pca",
3535
dims = 1:d
3636
)
37-
str_section_head("Reduced")
37+
str_section_head("Reduced") # logging
3838
x <- FindNeighbors(
3939
x,
4040
reduction = "pca",
@@ -44,7 +44,7 @@ for (i in 1:nrow(samples)) {
4444
x,
4545
resolution = 0.6
4646
)
47-
str_section_head("Clustered")
47+
str_section_head("Clustered") # logging
4848
}
4949

5050
save_object(x, "combined_integrated")

0 commit comments

Comments
 (0)