vanmooylipidomics / LOBSTAHS

Git repository for the R package "LOBSTAHS" (Lipid and Oxylipin Biomarker Screening Through Adduct Hierarchy Sequences)
Other
8 stars 12 forks source link

Problem with 'num.treatments' in XCMS3 generated #34

Closed hholm closed 3 years ago

hholm commented 3 years ago

Documenting bug that has now been patched for users not using patched version that may want too search for this:

In XCMS3 the 'class' slot of xset objects is not created in phenodata resulting in the following error:

Error in `[.data.frame`(pgdata, , (8 + num.treatments):(7 + num.treatments +  : 
  undefined columns selected

This is because the number of treatments is incorrectly assessed when calculating num.treatments using: num.treatments = length(levels(xsA@xcmsSet@phenoData$class))

Instead I changed this too calculate number of treatments from the group info using the following. num.treatments = ncol(xsA@xcmsSet@groups)-7

This works with XCMS3 generated objects and is backwards compatible as well.