8686Luciernaga_Plots <- function (data , RetainedType , CellPopRatio , outfolder , filename ,
8787 LinePlots = TRUE , CosinePlots = TRUE ,
8888 StackedBarPlots = TRUE , HeatmapPlots = TRUE ,
89- returntype = " patchwork" , reference ,
89+ returntype = " patchwork" , reference = NULL ,
9090 thecolumns = 2 , therows = 2 , width = 9 , height = 7 ){
9191
92- if (! is.data.frame (reference )){reference <- read.csv( reference , check.names = FALSE )}
92+ if (! is.null (reference )){
9393
94+ if (! is.data.frame(reference )){reference <- read.csv(reference , check.names = FALSE )}
95+
9496 PreferredOrder <- reference %> % pull(Fluorophore )
9597 PreferredOrder <- gsub(" -A" , " " , PreferredOrder )
98+ } else {PreferredOrder <- NULL }
9699
97100 # ################################################
98101 # Filtered by CellPopRatio, and creating other #
@@ -132,14 +135,16 @@ Luciernaga_Plots <- function(data, RetainedType, CellPopRatio, outfolder, filena
132135
133136 Items <- data.frame (table(data $ Sample )) %> % pull(Var1 ) %> % as.character(. )
134137
138+ if (! is.null(PreferredOrder )){
135139 if (all(Items %in% PreferredOrder )){
136140 Items <- PreferredOrder
137141 } else {message(" names not matching, no reorderring according to panel order" )}
142+ }
138143
139144 # x <- Items[1]
140145 # data <- Replaced
141146
142- ThePlots <- map(.x = Items , .f = InternalReport , data = Replaced ,
147+ ThePlots <- map(.x = Items , .f = Luciernaga ::: InternalReport , data = Replaced ,
143148 FirstDetectorColumn = FirstDetectorColumn ,
144149 LastDetectorColumn = LastDetectorColumn ,
145150 RetainedType = RetainedType , CellPopRatio = CellPopRatio ,
@@ -164,7 +169,7 @@ Luciernaga_Plots <- function(data, RetainedType, CellPopRatio, outfolder, filena
164169 return (ThePlots )
165170 }
166171
167- }
172+ }
168173
169174
170175
0 commit comments