Skip to content

Commit e0b112d

Browse files
Merge pull request #279 from USEPA/278-require-nhit-=-2-for-tcplcytopt-calculations
New logic stipulates that if either of those conditions is not met, we would report the default tcplCytoPt. This has been updated in invitrodb and v4.2.
2 parents cc4c0fd + e203b42 commit e0b112d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/tcplCytoPt.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ tcplCytoPt <- function(chid = NULL, aeid = NULL, flag = TRUE,
188188
total_chem <- tcplLoadChem() |> select(chid,code,chnm,casn) |> as.data.table() |> unique()
189189
total_chem <- total_chem[!chid %in% zdst$chid,][,`:=`(ntst = 0, nhit = 0, burstpct = 0)]
190190
zdst <- rbindlist(list(zdst,total_chem), fill = TRUE)
191-
191+
192192
zdst[, `:=`(used_in_global_mad_calc, burstpct > 0.05 & ntst>=60)]
193193
gb_mad <- median(zdst[used_in_global_mad_calc=='TRUE', mad]) #calculate global mad
194194
zdst[,global_mad := gb_mad] # add column for global mad
195195
zdst[, cyto_pt := med]
196-
zdst[burstpct < 0.05, `:=`(cyto_pt, default.pt)] # if the burst percent is less than .05 use the default pt instead
196+
zdst[burstpct < 0.05 | nhit < 2, `:=`(cyto_pt, default.pt)] # if the burst percent is less than .05 and at least 2 hits use the default pt instead
197197
zdst[, `:=`(cyto_pt_um, 10^cyto_pt)]
198198
zdst[, `:=`(lower_bnd_um, 10^(cyto_pt - 3 * global_mad))]
199199
zdst[,burstpct:=NULL] # remove burstpct from final results to match previous iterations of tcplCytopt

0 commit comments

Comments
 (0)