Skip to content

Commit 8897ac6

Browse files
committed
add fraction matching based on only the light / na labels
1 parent 077b51f commit 8897ac6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

R/utils_fractions.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268

269269
if (data.table::uniqueN(input$Fraction) > 1) {
270270
measurement_count = input[
271+
(IsotopeLabelType == "L" | is.na(IsotopeLabelType)) &
271272
!is.na(Intensity) & Intensity > 0,
272273
.(n_obs = uniqueN(Run)),
273274
by = .(feature, Fraction)
@@ -298,7 +299,8 @@
298299
tied_fractions = max_fractions[feature %in% tie_features, .(feature, Fraction)]
299300
avg_abundance = input[
300301
tied_fractions, on = .(feature, Fraction), nomatch = 0
301-
][!is.na(Intensity) & Intensity > 0,
302+
][(IsotopeLabelType == "L" | is.na(IsotopeLabelType)) &
303+
!is.na(Intensity) & Intensity > 0,
302304
.(mean_abundance = mean(Intensity)),
303305
by = .(feature, Fraction)]
304306
best_tied = avg_abundance[, .SD[which.max(mean_abundance)], by = "feature"]

0 commit comments

Comments
 (0)