Skip to content

Commit 4c36723

Browse files
committed
fix(diann): Update DIANN cleaning to be more memory and speed efficient (#115)
1 parent 904fd0e commit 4c36723

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

R/clean_DIANN.R

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,9 @@
149149
#' @return cleaned data.table
150150
#' @noRd
151151
.cleanDIANNCleanAndFilterData <- function(dn_input, quantificationColumn) {
152-
# Remove NH3 and H2O loss fragments
153-
dn_input <- dn_input[!grepl("NH3", FragmentIon)]
154-
dn_input <- dn_input[!grepl("H2O", FragmentIon)]
155-
156-
# Remove rows with NA in quantification column
157-
dn_input <- na.omit(dn_input, cols = quantificationColumn)
152+
# Remove NH3 and H2O loss fragments & remove rows with NA in quant column
153+
dn_input <- dn_input[!grepl("NH3|H2O", FragmentIon) &
154+
!is.na(get(quantificationColumn))]
158155

159156
return(dn_input)
160157
}

0 commit comments

Comments
 (0)