@@ -14,40 +14,60 @@ out_path <- paste0(args[1], "/")
1414objects <- list ()
1515
1616load(paste0(out_path , " tmp/preamble_image.RData" ))
17+ print(samples )
1718
1819for (i in 1 : nrow(samples )) {
1920 if (dir.exists(samples $ dir [i ])) {
21+ name <- samples $ name [i ]
2022 x <- Read10X( # pulling data with no filter
2123 data.dir = samples $ dir [i ]
2224 )
2325 str_section_head(" Raw Object" ) # logging
26+ message(" check 0" )
2427
2528 x <- CreateSeuratObject( # certain data will gen null matrix sans filters
2629 counts = x ,
2730 project = samples $ project [i ],
2831 min.cells = params [" min.cells" , ],
2932 min.features = params [" min.features" , ]
3033 )
34+ message(" check 1" )
3135
36+ print(samples $ name [i ])
3237 x @ meta.data $ object <- samples $ name [i ]
3338 x @ meta.data $ group <- samples $ group [i ]
39+ print(unique(x $ object ))
40+ message(" check 2" )
3441 } else {
3542 # TODO add compatibility with hdf5 format
3643
3744 # it's assumed preformed objs have group and name metadata vars
3845 x <- readRDS(samples $ dir [i ])
46+ x
47+ message(" check 3" )
3948 }
4049
50+ message(" check 4" )
4151 objects <- c(objects , x )
52+ print(objects )
53+ message(" check 5" )
54+ print(objects )
4255}
4356
44- for (i in lenght(objects )) {
57+ length(objects )
58+
59+ for (i in 1 : length(objects )) {
4560 x <- objects [[i ]]
61+ message(" check 6" )
62+ print(x )
63+ name <- unique(x $ object )
64+ print(name )
4665
4766 x [[" percent.mt" ]] <- PercentageFeatureSet(
4867 x ,
4968 pattern = " (?i)^MT-"
5069 )
70+ message(" check 7" )
5171
5272 p1 <- VlnPlot(
5373 x ,
@@ -61,10 +81,11 @@ for (i in lenght(objects)) {
6181
6282 save_figure(
6383 p1 ,
64- paste0(unique( x [[ i ]] $ object ) , " _unfilt_vln" ),
84+ paste0(name , " _unfilt_vln" ),
6585 width = 12 ,
6686 height = 6
6787 )
88+ message(" check 8" )
6889
6990 p1 <- FeatureScatter(
7091 x ,
@@ -80,10 +101,11 @@ for (i in lenght(objects)) {
80101
81102 save_figure(
82103 (p1 + p2 ),
83- paste0(unique( x [[ i ]] $ object ) , " _unfilt_scatter" ),
104+ paste0(name , " _unfilt_scatter" ),
84105 width = 12 ,
85106 height = 6
86107 )
108+ message(" check 9" )
87109
88110 str_section_head(" Base Seurat Object" ) # logging
89111
@@ -96,6 +118,7 @@ for (i in lenght(objects)) {
96118 percent.mt < params [" max.percent.mt" , ] &
97119 percent.mt > params [" min.percent.mt" , ]
98120 )
121+ message(" check 10" )
99122
100123 # norm, dimred, and clustering
101124
@@ -136,7 +159,7 @@ for (i in lenght(objects)) {
136159
137160 save_figure(
138161 (p1 + p2 ),
139- paste0(unique( x [[ i ]] $ object ) , " _var_features" ),
162+ paste0(name , " _var_features" ),
140163 width = 12 ,
141164 height = 6
142165 )
@@ -155,7 +178,7 @@ for (i in lenght(objects)) {
155178
156179 save_figure(
157180 (p1 + p2 ),
158- paste0(unique( x [[ i ]] $ object ) , " individual_dimplot " ),
181+ paste0(name , " _individual_dimplot " ),
159182 width = 12 ,
160183 height = 6
161184 )
0 commit comments