Skip to content

Commit 0deef91

Browse files
committed
Made reference optional and default NULL
1 parent 29ad764 commit 0deef91

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

R/Luciernaga_Plots.R

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,16 @@
8686
Luciernaga_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

man/Luciernaga_Plots.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)