get LCMS masses with more significant figures
1
0
Entering edit mode
@juniormbarga-11807
Last seen 8.1 years ago

How to get mz with more than one decimal point precision in the peak intensity matrix ?

source code xcms m/z groupval xcmsSet • 1.3k views
ADD COMMENT
0
Entering edit mode
Johannes Rainer ★ 2.1k
@johannes-rainer-6987
Last seen 4 weeks ago
Italy

It would be nice if you could provide some actual code and example (ideally with the test files from the package's vignette) and the output from sessionInfo(). Without that I can only guess what you mean and how that could be solved.

Guessing you did already peak detection on your samples, followed by retention time correction and grouping and now you want to extract the matrix with intensity values per aligned peaks across samples (xset3 below is from the xcmsPreprocess vignette):

> head(groupval(xset3, value = "into"))

                ko15       ko16       ko18       ko19       ko21      ko22
200.1/2927  147887.5  103613.01   65290.38   59814.72   85143.78  162012.4
205/2791   1778568.9 1567038.14 1482796.38 1039129.82 1223132.35 1072037.7
206/2791    237993.6  269713.98  201393.42  150107.31  176989.65  156797.0
207.1/2719  380873.0  460629.74  351750.14  219287.97  286848.56  235022.6
219.1/2524  235544.9  173623.38   82364.59   76204.81  185792.43  174458.8
231/2516         0.0   70796.21  222609.07  286232.15  435094.49  100076.2
                wt15       wt16       wt18       wt19      wt21       wt22
200.1/2927  175177.1   82619.48   55998.02   69198.22  153273.5   98144.28
205/2791   1950287.5 1466780.60 1572679.16 1275312.76 1356014.3 1231442.16
206/2791    276541.8  222366.15  211717.71  186850.88  188285.9  172348.76
207.1/2719  417169.6  324892.46  277990.70  220972.35  252874.0  236728.16
219.1/2524  244584.5  161184.05   72029.38   75464.75  238194.4  173829.95
231/2516         0.0   73142.05  165382.60  240261.21  201316.2  179437.72

I guess with more than one decimal point precision you refer here to the rownames. You can extract the mz values corresponding to each peak group (i.e. row) with the groups method:

> head(groups(xset3))
        mzmed    mzmin    mzmax    rtmed    rtmin    rtmax npeaks KO WT
[1,] 200.1000 200.1000 200.1000 2926.690 2920.826 2934.291      8  3  5
[2,] 205.0000 205.0000 205.0000 2790.679 2789.888 2791.307     12  6  6
[3,] 205.9927 205.9786 206.0023 2790.581 2789.225 2792.438     12  6  6
[4,] 207.0850 207.0440 207.1000 2718.704 2718.126 2721.004     12  6  6
[5,] 219.0848 219.0488 219.1000 2523.849 2520.942 2525.309      9  4  5
[6,] 231.0236 231.0000 231.0812 2516.415 2505.292 2541.045      6  3  3

Here you have all the precision that is available - and the ordering of the rows in this matrix matches the ordering in the matrix returned by groupval.

I hope this helps. If not, please provide an example/code with more details.

cheers, jo

 

ADD COMMENT

Login before adding your answer.

Traffic: 843 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6