Skip to content

Commit

Permalink
Update rc.feature.filter.blanks.R
Browse files Browse the repository at this point in the history
  • Loading branch information
cbroeckl committed Dec 10, 2021
1 parent c8aabd0 commit 351243d
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions R/rc.feature.filter.blanks.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,20 @@ rc.feature.filter.blanks <- function(ramclustObj=NULL,

## do the same for MS2
if(msms) {
ms2.qc.mean <- apply(d2[qc,], 2, FUN = "mean", na.rm = TRUE)
ms2.blank.mean <- apply(d2[blank,], 2, FUN = "mean", na.rm = TRUE)
if(length(qc) > 1) {
ms2.qc.mean <- apply(d2[qc,], 2, FUN = "mean", na.rm = TRUE)
} else {
ms1.qc.mean <- d2[qc,]
}
if(length(blank)>1) {
ms2.blank.mean <- apply(d2[blank,], 2, FUN = "mean", na.rm = TRUE)
} else {
ms2.blank.mean <- d2[blank,]
}


# ms2.qc.mean <- apply(d2[qc,], 2, FUN = "mean", na.rm = TRUE)
# ms2.blank.mean <- apply(d2[blank,], 2, FUN = "mean", na.rm = TRUE)
absent.in.blank <- which(is.nan(ms2.blank.mean))

# which signal is at least 3x larger in QC
Expand All @@ -117,7 +129,7 @@ rc.feature.filter.blanks <- function(ramclustObj=NULL,
keep.ms2.b <- which((!is.nan(ms2.qc.mean)) & is.nan(ms2.blank.mean))
# union of these two are keepers
keep.ms2 <- union(keep.ms2.a, keep.ms2.b)
length(keep.ms2)/ncol(d1)
# length(keep.ms2)/ncol(d1)
keep <- union(keep, keep.ms2)
}

Expand Down

0 comments on commit 351243d

Please sign in to comment.