Skip to content

Commit 121faa3

Browse files
committed
2 parents 9c3ef1b + 2a77600 commit 121faa3

File tree

10 files changed

+894
-43
lines changed

10 files changed

+894
-43
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Encoding: UTF-8
1919
LazyData: FALSE
2020
URL: https://davidrach.github.io/Luciernaga/
2121
BugReports: https://github.com/DavidRach/Luciernaga/issues
22-
RoxygenNote: 7.3.2
22+
RoxygenNote: 7.3.3
2323
Imports:
2424
Biobase,
2525
BiocGenerics,

NAMESPACE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ export(Luciernaga_Unmix)
2828
export(MarginClean)
2929
export(NameCleanUp)
3030
export(QC_Amalgamate)
31+
export(QC_ChorusPDF)
3132
export(QC_FilePrep_DailyQC)
3233
export(QC_FilePrep_LJTracking)
34+
export(QC_FlowSightPDF)
3335
export(QC_GainMonitoring)
3436
export(QC_LibraryParse)
3537
export(QC_Plots)
@@ -209,6 +211,7 @@ importFrom(lubridate,hour)
209211
importFrom(lubridate,mdy)
210212
importFrom(lubridate,mdy_hm)
211213
importFrom(lubridate,mdy_hms)
214+
importFrom(lubridate,parse_date_time)
212215
importFrom(lubridate,wday)
213216
importFrom(lubridate,weeks)
214217
importFrom(lubridate,ymd)
@@ -218,6 +221,7 @@ importFrom(openCyto,gatingTemplate)
218221
importFrom(openCyto,gt_gating)
219222
importFrom(patchwork,plot_spacer)
220223
importFrom(patchwork,wrap_plots)
224+
importFrom(pdftools,pdf_text)
221225
importFrom(plotly,ggplotly)
222226
importFrom(progressr,progressor)
223227
importFrom(progressr,with_progress)

R/MagesCauldron.R

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#' @param device Desired storage format, default is "png"
1313
#' @param width Desired height for saved plot, default is 15
1414
#' @param height Desired height for saved plot, default is 15
15+
#' @param NumberDetectors Default NULL, used when unstained is NULL
1516
#'
1617
#' @importFrom dplyr mutate
1718
#' @importFrom dplyr relocate
@@ -43,27 +44,39 @@
4344
#' @noRd
4445
MagesCauldron <- function(panelfluors, unstained, returnType="plot", savePlot=FALSE,
4546
outpath=NULL, filename=NULL, device="png", width=15, height=15, swapname=NULL,
46-
swapvalue=NULL){
47+
swapvalue=NULL, NumberDetectors=NULL){
4748

49+
if (!is.null(unstained)){
4850
DetectorLength <- ncol(unstained)
4951

5052
if (any(unstained > 1)){
5153
unstained[unstained < 0] <- 0
5254
A <- do.call(pmax, unstained)
5355
unstained <- unstained/A
5456
}
57+
58+
TheUnstained <- unstained |> mutate(Fluorophore="Unstained") |>
59+
relocate(Fluorophore, .before=1)
60+
} else {
61+
if (is.null(NumberDetectors)){
62+
stop("When not providing unstained, provide NumberDetectors argument")
63+
}
64+
DetectorLength <- NumberDetectors
65+
}
5566

5667
Vaiya <- InstrumentReferences(NumberDetectors = DetectorLength)
57-
TheUnstained <- unstained |> mutate(Fluorophore="Unstained") |>
58-
relocate(Fluorophore, .before=1)
5968
TheseFluorophores <- panelfluors
6069
Data <- Vaiya |> filter(Fluorophore %in% TheseFluorophores)
6170
Data <- Data |> select(-Instrument)
6271
Data <- Data |> pivot_wider(names_from="Detector",
6372
values_from="AdjustedY")
73+
74+
if (!is.null(unstained)){
6475
colnames(TheUnstained) <- gsub("-A", "", gsub("-H", "", colnames(TheUnstained)))
6576
Data <- bind_rows(Data, TheUnstained)
6677
TheseFluorophores <- c(TheseFluorophores, paste0("Unstained", seq_len(nrow(unstained))))
78+
}
79+
6780
Data$Fluorophore <- factor(Data$Fluorophore, levels=TheseFluorophores)
6881
Data <- Data |> arrange(desc(Fluorophore))
6982
Data <- Data |> arrange(Fluorophore)

0 commit comments

Comments
 (0)