-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
lalo-caballero
committed
Feb 21, 2024
1 parent
cccb778
commit 2ab27b4
Showing
5 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
methods::setMethod( | ||
"get_inv_k0", | ||
"GCIMSDataset", | ||
function(object){ | ||
delayed_op <- DelayedOperation( | ||
name = "get_inverse_reduced_mobility", | ||
fun = get_inv_k0 | ||
) | ||
object$appendDelayedOp(delayed_op) | ||
invisible(object) | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
methods::setMethod( | ||
"get_inv_k0", | ||
"GCIMSSample", | ||
function(object) { | ||
if (is.null(object@params$`nom Drift Potential Difference`$value) | | ||
is.null(object@params$`Temp 1 setpoint`$value)| | ||
is.null(object@params$`Pressure Ambient`$value) | | ||
length(object@drift_tube_length) == 0 | ||
){ | ||
stop("IMS Voltage, IMS Tube length, IMS Tempreature and pressure are | ||
needed to calculate the inverse reduced mobility ") | ||
} | ||
drift_time <- object@drift_time / 1000 # in ms to s | ||
Voltage_ims <- object@params$`nom Drift Potential Difference`$value # in V | ||
tube_length_cm <- object@drift_tube_length / 10 # in mm to cm | ||
ims_temp_k <- object@params$`Temp 1 setpoint`$value + 273.15 # in °C | ||
pressure_ims <- mean(as.numeric(strsplit( | ||
object@params$`Pressure Ambient`$value, " ")[[1]]), na.rm = TRUE) #in Pa | ||
K0 <- (0.0027315 * (tube_length_cm ^ 2) * pressure_ims) / | ||
(Voltage_ims* drift_time * ims_temp_k) | ||
inv_k0 <- 1 / K0 | ||
object@inverse_reduced_mobility <- inv_k0 | ||
invisible(object) | ||
} | ||
) |