Skip to content
Snippets Groups Projects
Unverified Commit c2b8ad69 authored by Todor Kondic's avatar Todor Kondic
Browse files

plotting: data4plot_ms2_cgram: Fix data for plot selection.

parent 9fc012d6
No related branches found
No related tags found
No related merge requests found
Package: shinyscreen
Title: Pre-screening of Mass Spectrometry Data
Version: 1.0.9
Version: 1.0.10
Author: Todor Kondić
Maintainer: Todor Kondić <todor.kondic@uni.lu>
Authors@R:
......
......@@ -64,7 +64,9 @@ data4plot_ms2_cgram <- function(tab,select=dtable(adduct=character(0),ID=charact
res <- tab[select,.(adduct,tag,ID,CE,an,rt,intensity),on=c('ID','adduct'),nomatch=NULL]
if (NROW(res) == 0) return(res)
data.table::setkeyv(res,c('ID','adduct','tag','CE','an'))
res <- res[,.(rt,intensity=max(intensity)),keyby=c('ID','adduct','tag','CE')]
## NOTE: I used to not have 'an' in keyby here, but that obviously
## generates bad MS2 chromatogram. So, why?
res <- res[,.(rt,intensity=max(intensity)),keyby=c('ID','adduct','tag','CE','an')]
res[,`:=`(lab_id=factor(ID),
lab_adduct=factor(adduct),
lab_tag=factor(tag),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment