Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Specific issue when compare to DB and stay only 1 unkn #42

Open
jsaintvanne opened this issue Sep 9, 2019 · 3 comments
Open

Specific issue when compare to DB and stay only 1 unkn #42

jsaintvanne opened this issue Sep 9, 2019 · 3 comments
Labels

Comments

@jsaintvanne
Copy link
Member

When you want to run metaMS_runGC against a DB but you search also unknowns and that only 1 unknown was found you obtain an error :

Error in x[, settings$timeComparison] : incorrect number of dimensions
Calls: runGC ... match.unannot.patterns -> sapply -> sapply -> lapply -> FUN -> mean

This time this is not due to a variable which is a matrix whereas it should be a list but it apparently due to a list with only 1 thing in it... So like this, we have something like :

$`./0205065.CDF`
        mz      maxo      rt
CP0113  84 0.2200641 26.6531
CP0742 267 0.2948930 26.6531
CP0760 282 0.2927542 26.6656
CP0761 285 0.4139154 26.6656
CP0776 300 0.7185312 26.6656
CP0803 342 0.3021456 26.6656

$`./0205065_1.CDF`
        mz      maxo      rt
CP0920  84 0.2200641 26.6531
CP1549 267 0.2948930 26.6531
CP1567 282 0.2927542 26.6656
CP1568 285 0.4139154 26.6656
CP1583 300 0.7185312 26.6656
CP1610 342 0.3021456 26.6656

whereas we should have something like :

$`./0205004.CDF`
$`./0205004.CDF`[[1]]
        mz       maxo       rt
CP0004  51 0.01793574 24.51583
CP0012  52 0.01412946 24.51583
CP0016  53 0.04252074 24.51583
CP0024  54 0.01917578 24.52208
CP0031  55 0.07008467 24.50958
CP0035  56 0.01895593 24.50958
CP0044  57 0.02532629 24.50958

$`./0205004.CDF`[[2]]
        mz      maxo       rt
CP0365 121 0.9064138 24.74080
CP0933 236 0.1357717 24.74080
CP1076 286 0.2732609 24.74080
CP1233 359 0.1131362 24.74080
CP1350 415 0.1342479 24.74703
CP1461 470 0.1736152 24.74080
CP1479 478 0.1189479 24.74703
CP1504 496 0.1009723 24.74703

$`./0205004.CDF`[[3]]
        mz      maxo       rt
CP0300 109 0.4692890 24.49708
CP0427 133 0.6552011 24.49083
CP0702 183 0.4586975 24.49708
CP0714 184 0.2844711 24.49708
CP0766 194 0.1315781 24.49708
CP0979 249 0.1245335 24.49708
CP1179 329 0.1040561 24.49083
CP1285 385 0.1245118 24.48458

With the name of file first, then the different pseudospectra.

@jsaintvanne jsaintvanne added the bug label Sep 9, 2019
@jsaintvanne
Copy link
Member Author

jsaintvanne commented Sep 9, 2019

This is probably due only when noannot.idx has a length of 1 for each file
https://github.com/yguitton/metaMS/blob/master/R/matchSamples2Samples.R#L38

@jsaintvanne
Copy link
Member Author

To correct it I add something to make a list of list when you have only 1 id in each files :

#To correct issue when 1 unkn only in noannot.idx (make a list and not a list of list)
    if(unique(lengths(noannot.idx)) == 1){
      xset.work <- lapply(xset.work, function(x) list(x))
    }

@jsaintvanne
Copy link
Member Author

Should be merge here yguitton/metaMS#14

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant