Skip to content

Commit 9bb7bd5

Browse files
committed
fix: plot,LamaParama method
- Fix `plot,LamaParama`: x and y coordinates were switched. - Small changes in the vignette. - Ensure .R files are loaded in the correct order.
1 parent ab847b0 commit 9bb7bd5

File tree

5 files changed

+77
-57
lines changed

5 files changed

+77
-57
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ Collate:
104104
'MPI.R'
105105
'MsExperiment-functions.R'
106106
'MsExperiment.R'
107+
'XcmsExperiment.R'
107108
'PlainTextParam.R'
108109
'RDataParam.R'
109110
'XcmsExperiment-functions.R'
110111
'XcmsExperiment-plotting.R'
111-
'XcmsExperiment.R'
112112
'c.R'
113113
'cwTools.R'
114114
'databases.R'

R/PlainTextParam.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#' @include XcmsExperiment.R
2+
13
#' @title Store contents of `MsExperiment` and `XcmsExperiment` objects as
24
#' plain text files
35
#'

R/methods-Params.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,8 @@ setMethod("plot", signature(x = "LamaParama"),
12651265
zero_weight = x@zeroWeight,
12661266
bs = x@bs)
12671267
datap <- x@rtMap[[index]]
1268-
plot(datap, type = "p", xlab = xlab, ylab = ylab, col = colPoints, ...)
1268+
plot(datap[, 2L], datap[, 1L], type = "p", xlab = xlab, ylab = ylab,
1269+
col = colPoints, ...)
12691270
points(model, type = "l", col = colFit)
12701271
})
12711272

man/XcmsExperiment.Rd

Lines changed: 46 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/xcms.Rmd

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,6 +1323,7 @@ f[f != "QC"] <- NA
13231323
ref <- filterFeatures(ref, PercentMissingFilter(threshold = 0, f = f))
13241324
ref_mz_rt <- featureDefinitions(ref)[, c("mzmed","rtmed")]
13251325
head(ref_mz_rt)
1326+
nrow(ref_mz_rt)
13261327
```
13271328

13281329
This is what the `lamas` input should look like for alignment. In terms of
@@ -1396,29 +1397,45 @@ abline(v = mtch[[1]]$obs)
13961397
```
13971398

13981399
The overlay of BPC above provides insight into the correlation between accurate
1399-
alignment and the presence of peaks matching with `lamas.` Furthermore, a more
1400-
detailed examination of the matching and the model used for fitting each file
1401-
is possible. Numerical information can be obtained using the
1400+
alignment and the presence of peaks matching with `lamas`. For this particular
1401+
sample no chromatographic peaks were matched to the `lamas` between 2500 and
1402+
3000 seconds and hence the alignment in that region was not good. For the second
1403+
file, chrom peaks could also be matched in that region resulting in a better
1404+
alignment.
1405+
1406+
```{r}
1407+
par(mfrow = c(1, 1))
1408+
plot(bpc[1, 2], col = "#00000080", main = "Distribution CP matched to Lamas")
1409+
points(rtime(bpc_tst_adj[1, 2]), intensity(bpc_tst_adj[1, 2]), type = "l",
1410+
col = "#0000ff80")
1411+
grid()
1412+
abline(v = mtch[[2]]$obs)
1413+
```
1414+
1415+
Furthermore, a more detailed examination of the matching and the model used for
1416+
fitting each file is possible. Numerical information can be obtained using the
14021417
`summarizeLamaMatch()` function. From this, the percentage of chromatographic
14031418
peaks utilized for alignment can be computed relative to the total number of
1404-
peaks in the file. Additionally, it is feasible to directly `plot()` the
1405-
`param` object for the file of interest, showcasing the distribution of these
1419+
peaks in the file. Additionally, it is feasible to directly `plot()` the `param`
1420+
object for the file of interest, showcasing the distribution of these
14061421
chromatographic peaks along with the fitted model line.
14071422

14081423
```{r}
1409-
#access summary of matches and model information
1424+
#' access summary of matches and model information
14101425
summary <- summarizeLamaMatch(param)
14111426
summary
14121427
1413-
# coverage for each file
1428+
#' coverage for each file
14141429
summary$Matched_peaks / summary$Total_peaks * 100
14151430
1416-
#access the information on the model of for the first file
1431+
#' access the information on the model of for the first file
14171432
summary$Model_summary[[1]]
14181433
1419-
# Plot obs vs. ref with fitting line
1434+
#' Plot obs vs. ref with fitting line
14201435
plot(param, index = 1L, main = "ChromPeaks versus Lamas for the first file",
14211436
colPoint = "red")
1437+
abline(0, 1, lty = 3, col = "grey")
1438+
grid()
14221439
```
14231440

14241441

0 commit comments

Comments
 (0)