Skip to content

Commit

Permalink
#28 catch an exception with the borderquant argument in rectangleGate…
Browse files Browse the repository at this point in the history
… for pregating compensation controls.
  • Loading branch information
gfinak committed Jul 24, 2019
1 parent 68db2c4 commit c933300
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions R/spillover.R
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,14 @@ setMethod("spillover_ng",
channel_name <- cols[which(channel_order == channel_i)]

# Applies rangeGate to select positive population
gate_filter <- rangeGate(flow_frame, stain = channel_name,
gate_filter <- try(rangeGate(flow_frame, stain = channel_name,
inBetween = TRUE, borderQuant = 0,
absolute = FALSE, peakNr = 2)
absolute = FALSE, peakNr = 2), silent = TRUE)
if(inherits(gate_filter,"try-error")){
gate_filter <- try(rangeGate(flow_frame, stain = channel_name,
inBetween = TRUE, borderQuant = 1,
absolute = FALSE, peakNr = 2), silent = TRUE)
}
if (plot) {
# Plots a kernel density for the current channel
plot(density(exprs(flow_frame)[, channel_name]),
Expand Down

0 comments on commit c933300

Please sign in to comment.