Skip to contents

This function will change your ms1 peak table rt time to rt time in seconds or minutes. This modification happens in place (or by reference), so the mpactr_object will be updated.

Usage

change_rt_to_seconds_or_minute(mpactr_object, rt_type = "seconds")

Arguments

mpactr_object

The object created from import_all_data() file.

rt_type

how you want to convert your retention time, your options are minutes, or seconds. defaults to seconds.

Value

a modified mpactr object.

Examples

data <-
   import_all_data(peak_table =
                   mums2::mums2_example("botryllus_pt_small.csv"),
                   meta_data =
                   mums2::mums2_example("meta_data_boryillus.csv"),
                   format = "None")
#> If peak table has corrupted compound names they will be converted to
#>       utf-8 and if there are any commas, they will be converted to periods(.).
change_rt_to_seconds_or_minute(data, "minutes")
#> [1] "Changing rt values to minutes"
#>                    Compound       mz RTINMINUTES 221012_DGM_Blank1_1_1_390
#>                      <char>    <num>       <num>                     <num>
#>    1: 413.12834 Da 319.32 s 414.1356  0.08866667                  1643.672
#>    2: 655.22101 Da 481.62 s 656.2283  0.13383333                     0.000
#>    3: 904.69182 Da 604.24 s 905.6991  0.16783333                     0.000
#>    4: 798.49680 Da 604.00 s 799.5041  0.16783333                  6537.559
#>    5: 641.41035 Da 429.52 s 642.4176  0.11933333                     0.000
#>   ---                                                                     
#> 1496: 575.41282 Da 489.35 s 576.4201  0.13600000                 29761.977
#> 1497: 338.24828 Da 464.42 s 339.2556  0.12900000                     0.000
#> 1498: 620.35620 Da 402.49 s 621.3635  0.11183333                     0.000
#> 1499: 329.31242 Da 367.23 s 330.3197  0.10200000                 27427.938
#> 1500: 922.75982 Da 516.14 s 905.7584  0.14333333                 10774.994
#>       221012_DGM_Blank1_1_2_391 221012_DGM_Blank1_1_3_392
#>                           <num>                     <num>
#>    1:                  1683.589                  1581.715
#>    2:                     0.000                     0.000
#>    3:                     0.000                  4459.532
#>    4:                     0.000                     0.000
#>    5:                     0.000                     0.000
#>   ---                                                    
#> 1496:                 25043.342                 29393.545
#> 1497:                     0.000                     0.000
#> 1498:                     0.000                     0.000
#> 1499:                     0.000                 27899.057
#> 1500:                  9953.737                     0.000
#>       221012_DGM_MB1588_3_1_395 221012_DGM_MB1588_3_2_396
#>                           <num>                     <num>
#>    1:                     0.000                  1842.961
#>    2:                     0.000                     0.000
#>    3:                     0.000                     0.000
#>    4:                     0.000                     0.000
#>    5:                     0.000                     0.000
#>   ---                                                    
#> 1496:                 21414.033                 16893.291
#> 1497:                     0.000                     0.000
#> 1498:                     0.000                     0.000
#> 1499:                  8513.641                  9216.000
#> 1500:                 20867.770                 22925.033
#>       221012_DGM_MB1588_3_3_397 221012_DGM_MB1589_4_1_398
#>                           <num>                     <num>
#>    1:                     0.000                  1540.177
#>    2:                  8839.863                     0.000
#>    3:                  4535.730                     0.000
#>    4:                     0.000                  8426.455
#>    5:                     0.000                     0.000
#>   ---                                                    
#> 1496:                  9563.822                 19355.344
#> 1497:                  2631.964                 24679.939
#> 1498:                     0.000                     0.000
#> 1499:                  8127.656                     0.000
#> 1500:                  8899.025                     0.000
#>       221012_DGM_MB1589_4_2_399 221012_DGM_MB1589_4_3_400
#>                           <num>                     <num>
#>    1:                  1379.541                  1349.259
#>    2:                     0.000                  8058.202
#>    3:                     0.000                  4271.522
#>    4:                 11090.130                  7521.545
#>    5:                     0.000                 15678.532
#>   ---                                                    
#> 1496:                 23032.473                 17940.416
#> 1497:                 30655.693                 26387.342
#> 1498:                     0.000                     0.000
#> 1499:                  6196.938                 10507.124
#> 1500:                  8226.452                     0.000
#>       221012_DGM_MB1590_5_1_401 221012_DGM_MB1590_5_2_402
#>                           <num>                     <num>
#>    1:                  1736.740                  1674.615
#>    2:                     0.000                     0.000
#>    3:                     0.000                     0.000
#>    4:                 13776.298                  8939.586
#>    5:                 15058.773                 16887.570
#>   ---                                                    
#> 1496:                 21241.809                 19027.691
#> 1497:                  4935.798                     0.000
#> 1498:                     0.000                     0.000
#> 1499:                  8340.333                  8436.562
#> 1500:                 12247.824                 13145.450
#>       221012_DGM_MB1590_5_3_403 221012_DGM_Blank2_1_1_404
#>                           <num>                     <num>
#>    1:                     0.000                  1661.673
#>    2:                     0.000                 16815.256
#>    3:                     0.000                     0.000
#>    4:                     0.000                  5920.994
#>    5:                 15524.373                     0.000
#>   ---                                                    
#> 1496:                 25560.471                 18392.838
#> 1497:                  3977.483                  1765.111
#> 1498:                     0.000                     0.000
#> 1499:                  9480.690                     0.000
#> 1500:                 23735.074                 15348.451
#>       221012_DGM_Blank2_1_2_405 221012_DGM_Blank2_1_3_406
#>                           <num>                     <num>
#>    1:                   2047.95                  1189.160
#>    2:                  17501.14                  5604.232
#>    3:                      0.00                     0.000
#>    4:                      0.00                  3559.699
#>    5:                      0.00                     0.000
#>   ---                                                    
#> 1496:                  25072.64                 20801.066
#> 1497:                      0.00                     0.000
#> 1498:                      0.00                     0.000
#> 1499:                      0.00                     0.000
#> 1500:                  14027.31                  6547.833
#>       221012_DGM_MB1591_6_1_407 221012_DGM_MB1591_6_2_408
#>                           <num>                     <num>
#>    1:                  1573.228                     0.000
#>    2:                     0.000                     0.000
#>    3:                  2709.508                  2182.018
#>    4:                  5700.309                  2390.115
#>    5:                     0.000                     0.000
#>   ---                                                    
#> 1496:                 17008.381                 21820.496
#> 1497:                  1779.258                  3069.007
#> 1498:                     0.000                  3495.131
#> 1499:                  8185.514                  8341.350
#> 1500:                     0.000                     0.000
#>       221012_DGM_MB1591_6_3_409 221012_DGM_MB1592_7_1_410
#>                           <num>                     <num>
#>    1:                  1092.180                  1813.853
#>    2:                  6107.080                  2540.801
#>    3:                     0.000                     0.000
#>    4:                  5241.544                     0.000
#>    5:                 13128.431                     0.000
#>   ---                                                    
#> 1496:                 11963.309                  3578.613
#> 1497:                     0.000                 62719.613
#> 1498:                     0.000                     0.000
#> 1499:                 10087.337                 31680.289
#> 1500:                     0.000                     0.000
#>       221012_DGM_MB1592_7_2_411 221012_DGM_MB1592_7_3_412
#>                           <num>                     <num>
#>    1:                  1505.633                  1203.859
#>    2:                  2162.738                 11592.640
#>    3:                  2738.020                     0.000
#>    4:                     0.000                  3995.891
#>    5:                     0.000                     0.000
#>   ---                                                    
#> 1496:                  4033.957                  8272.763
#> 1497:                 57441.410                 54402.375
#> 1498:                  9849.991                 10114.544
#> 1499:                 46649.805                 39742.734
#> 1500:                     0.000                     0.000
#>       221012_DGM_MB1593_8_1_413 221012_DGM_MB1593_8_2_414
#>                           <num>                     <num>
#>    1:                  1327.427                  1740.172
#>    2:                     0.000                  4208.383
#>    3:                     0.000                     0.000
#>    4:                  5239.572                  7006.156
#>    5:                 16500.930                     0.000
#>   ---                                                    
#> 1496:                 11067.920                 13218.476
#> 1497:                  8315.789                  6651.864
#> 1498:                     0.000                     0.000
#> 1499:                     0.000                 20481.836
#> 1500:                     0.000                     0.000
#>       221012_DGM_MB1593_8_3_415 221012_DGM_MB1594_9_1_416
#>                           <num>                     <num>
#>    1:                  1380.644                  1635.196
#>    2:                  7293.763                     0.000
#>    3:                     0.000                  3350.652
#>    4:                  8872.400                  3247.472
#>    5:                     0.000                     0.000
#>   ---                                                    
#> 1496:                 21657.127                 16811.928
#> 1497:                  8297.395                 48881.785
#> 1498:                     0.000                  6538.799
#> 1499:                 24633.131                 29117.193
#> 1500:                     0.000                     0.000
#>       221012_DGM_MB1594_9_2_417 221012_DGM_MB1594_9_3_418
#>                           <num>                     <num>
#>    1:                  1337.972                 1377.6218
#>    2:                     0.000                 7568.2002
#>    3:                     0.000                    0.0000
#>    4:                  7382.616                    0.0000
#>    5:                     0.000                    0.0000
#>   ---                                                    
#> 1496:                 16662.057                 8798.4893
#> 1497:                 53517.762                51970.5234
#> 1498:                  9830.620                    0.0000
#> 1499:                     0.000                37141.7617
#> 1500:                     0.000                  519.6837
#>       221012_DGM_Blank3_1_1_419 221012_DGM_Blank3_1_2_420
#>                           <num>                     <num>
#>    1:                 1256.6434                  1920.330
#>    2:                10593.5996                     0.000
#>    3:                    0.0000                  5863.393
#>    4:                    0.0000                     0.000
#>    5:                    0.0000                     0.000
#>   ---                                                    
#> 1496:                 9507.4121                     0.000
#> 1497:                    0.0000                     0.000
#> 1498:                    0.0000                     0.000
#> 1499:                    0.0000                     0.000
#> 1500:                  465.6117                     0.000
#>       221012_DGM_Blank3_1_3_421 221012_DGM_MB1595_10_1_422
#>                           <num>                      <num>
#>    1:                  1438.921                   1270.993
#>    2:                  8887.850                   3453.785
#>    3:                     0.000                   3040.876
#>    4:                  3100.021                      0.000
#>    5:                     0.000                      0.000
#>   ---                                                     
#> 1496:                  8573.043                      0.000
#> 1497:                     0.000                 115468.789
#> 1498:                     0.000                      0.000
#> 1499:                     0.000                  15698.000
#> 1500:                     0.000                      0.000
#>       221012_DGM_MB1595_10_2_423 221012_DGM_MB1595_10_3_424
#>                            <num>                      <num>
#>    1:                   1232.581                   1769.550
#>    2:                   2805.313                   3917.201
#>    3:                      0.000                   3773.011
#>    4:                   3969.096                   3393.127
#>    5:                      0.000                      0.000
#>   ---                                                      
#> 1496:                   5298.672                   5166.771
#> 1497:                 116873.945                 113807.047
#> 1498:                      0.000                      0.000
#> 1499:                  13476.294                      0.000
#> 1500:                      0.000                      0.000
#>       221012_DGM_MB1597_11_1_425 221012_DGM_MB1597_11_2_426
#>                            <num>                      <num>
#>    1:                   1469.424                   1916.736
#>    2:                      0.000                   5492.965
#>    3:                   1994.700                      0.000
#>    4:                      0.000                   7475.469
#>    5:                      0.000                      0.000
#>   ---                                                      
#> 1496:                   8280.562                  11125.481
#> 1497:                   1513.106                      0.000
#> 1498:                      0.000                      0.000
#> 1499:                   7428.072                   8648.967
#> 1500:                      0.000                      0.000
#>       221012_DGM_MB1597_11_3_427 221012_DGM_MB1598_12_1_428
#>                            <num>                      <num>
#>    1:                   2275.196                     0.0000
#>    2:                   3876.187                     0.0000
#>    3:                      0.000                     0.0000
#>    4:                   8617.719                     0.0000
#>    5:                      0.000                     0.0000
#>   ---                                                      
#> 1496:                   9527.089                  8534.1504
#> 1497:                   3575.851                 84401.3516
#> 1498:                      0.000                 16802.7012
#> 1499:                   9848.295                 13961.7207
#> 1500:                      0.000                   712.7478
#>       221012_DGM_MB1598_12_2_429 221012_DGM_MB1598_12_3_430
#>                            <num>                      <num>
#>    1:                  1318.5538                      0.000
#>    2:                     0.0000                   6346.356
#>    3:                     0.0000                   5324.371
#>    4:                     0.0000                   3165.401
#>    5:                     0.0000                      0.000
#>   ---                                                      
#> 1496:                  8152.6548                      0.000
#> 1497:                     0.0000                      0.000
#> 1498:                 10476.6221                  11861.588
#> 1499:                     0.0000                      0.000
#> 1500:                   437.0028                      0.000
#>       221012_DGM_MB1599_13_1_431 221012_DGM_MB1599_13_2_432
#>                            <num>                      <num>
#>    1:                   1066.136                      0.000
#>    2:                   6197.055                  13562.388
#>    3:                   6451.301                   4927.146
#>    4:                   2199.003                      0.000
#>    5:                      0.000                      0.000
#>   ---                                                      
#> 1496:                  11158.275                  15178.959
#> 1497:                   2599.609                   2878.922
#> 1498:                   7530.887                      0.000
#> 1499:                  11578.348                  11530.500
#> 1500:                      0.000                      0.000
#>       221012_DGM_MB1599_13_3_433 221012_DGM_Blank4_1_1_434
#>                            <num>                     <num>
#>    1:                   966.0234                  1861.986
#>    2:                 32407.8379                 15096.834
#>    3:                  5301.7993                     0.000
#>    4:                  2455.8958                  2673.542
#>    5:                     0.0000                 13200.256
#>   ---                                                     
#> 1496:                 13624.2832                 14405.179
#> 1497:                     0.0000                     0.000
#> 1498:                     0.0000                     0.000
#> 1499:                  9885.8184                     0.000
#> 1500:                     0.0000                     0.000
#>       221012_DGM_Blank4_1_2_435 221012_DGM_Blank4_1_3_436     kmd
#>                           <num>                     <num>   <num>
#>    1:                  1202.606                  1478.475 0.13562
#>    2:                 24745.084                 15284.740 0.22829
#>    3:                   508.500                     0.000 0.69910
#>    4:                  4999.417                  3814.854 0.50408
#>    5:                     0.000                     0.000 0.41763
#>   ---                                                            
#> 1496:                 13660.577                 13074.628 0.42010
#> 1497:                     0.000                     0.000 0.25556
#> 1498:                     0.000                     0.000 0.36347
#> 1499:                 20086.701                     0.000 0.31970
#> 1500:                     0.000                     0.000 0.75836