Skip to content

Commit b305d58

Browse files
committed
update with new paper
1 parent e0fd026 commit b305d58

File tree

108 files changed

+690
-571
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+690
-571
lines changed

NEWS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# pmd 0.2.0
22

3-
- add option to skip sda in GlobalStd algorithm
3+
- add option to skip sda in GlobalStd algorithm and set default to F
44
- organize the R files
55
- add vignette for reactomics analysis
66
- add correlation directed analysis function
77
- modified getcorcluster function to find independent peaks
88
- add vignette section for reduced independent peaks selection in GlobalStd algorithm
99
- fix the issue for getchain with multiple masses
10+
- fix the correlation issue in pos/neg linkage function
11+
- Output within RT clusters high frequencies PMD(s) as message for user to check
12+
- Change default ng to NULL in getpared function for automately generate parameter based on data
13+
- update with citation of cc paper
1014

1115
# pmd 0.1.9
1216

R/globalstd.R

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' Filter ions/peaks based on retention time hierarchical clustering, paired mass distances(PMD) and PMD frequency analysis.
22
#' @param list a list with mzrt profile
33
#' @param rtcutoff cutoff of the distances in retention time hierarchical clustering analysis, default 10
4-
#' @param ng cutoff of global PMD's retention time group numbers, default 10. If ng = NULL, 20 percent of RT cluster will be used as ng.
4+
#' @param ng cutoff of global PMD's retention time group numbers, If ng = NULL, 20 percent of RT cluster will be used as ng, default NULL.
55
#' @param digits mass or mass to charge ratio accuracy for pmd, default 2
66
#' @param accuracy measured mass or mass to charge ratio in digits, default 4
77
#' @return list with tentative isotope, multi-chargers, adducts, and neutral loss peaks' index, retention time clusters.
@@ -13,7 +13,7 @@
1313
getpaired <-
1414
function(list,
1515
rtcutoff = 10,
16-
ng = 10,
16+
ng = NULL,
1717
digits = 2,
1818
accuracy = 4) {
1919
# paired mass diff analysis
@@ -235,7 +235,7 @@ getpaired <-
235235
),
236236
c(list$paired$rtg, list$paired$rtg))
237237
}
238-
# get the data index by rt groups with high frequences
238+
# get the data index by rt groups with high frequencies
239239
# PMD
240240
list$diffindex <-
241241
paste(round(list$mz, accuracy), list$rtcluster) %in%
@@ -287,6 +287,7 @@ getpaired <-
287287
"unique within RT clusters high frequency PMD(s) used for further investigation."
288288
)
289289
)
290+
message(paste(c("The unique within RT clusters high frequency PMD(s) is(are) ", unique(list$paired$diff2)), collapse=" "), '.')
290291
message(paste(
291292
sum(list$isoindex),
292293
"isotopologue(s) related paired mass found."
@@ -650,12 +651,12 @@ getstd <-
650651
#' GlobalStd algorithm with structure/reaction directed analysis
651652
#' @param list a peaks list with mass to charge, retention time and intensity data
652653
#' @param rtcutoff cutoff of the distances in cluster, default 10
653-
#' @param ng cutoff of global PMD's retention time group numbers, default 10. If ng = NULL, 20 percent of RT cluster will be used as ng.
654+
#' @param ng cutoff of global PMD's retention time group numbers, If ng = NULL, 20 percent of RT cluster will be used as ng, default NULL.
654655
#' @param corcutoff cutoff of the correlation coefficient, default NULL
655656
#' @param digits mass or mass to charge ratio accuracy for pmd, default 2
656657
#' @param accuracy measured mass or mass to charge ratio in digits, default 4
657658
#' @param freqcutoff pmd freqency cutoff for structures or reactions, default NULL. This cutoff will be found by PMD network analysis when it is NULL.
658-
#' @param sda logical, option to perform structure/reaction directed analysis, default T.
659+
#' @param sda logical, option to perform structure/reaction directed analysis, default FALSE.
659660
#' @return list with GlobalStd algorithm processed data.
660661
#' @examples
661662
#' data(spmeinvivo)
@@ -664,12 +665,12 @@ getstd <-
664665
#' @export
665666
globalstd <- function(list,
666667
rtcutoff = 10,
667-
ng = 10,
668+
ng = NULL,
668669
corcutoff = NULL,
669670
digits = 2,
670671
accuracy = 4,
671672
freqcutoff = NULL,
672-
sda = T) {
673+
sda = FALSE) {
673674
list <-
674675
getpaired(
675676
list,
@@ -840,7 +841,7 @@ getcluster <- function(list,
840841
msdata <- NULL
841842
} else{
842843
data <- list$data
843-
if (is.matrix(data)) {
844+
if (is.matrix(data)|is.data.frame(data)) {
844845
msdata <- apply(data, 1, sum)
845846
} else {
846847
msdata <-sum(data)

R/pmdda.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ getposneg <- function(pos,neg, pmd = 2.02, digits = 2){
5151
if(sum(round((pos$mz[i]-neg$mz),digits) %in% pmd) != 0){
5252
index <- round((pos$mz[i]-neg$mz),digits) %in% pmd
5353
if(sum(index)>1){
54-
cor <- apply(neg$data[index,],1,function(x) suppressWarnings(cor(x,pos$data[i,])))
54+
cor <- apply(neg$data[index,],1,function(x) suppressWarnings(cor(as.numeric(x),as.numeric(pos$data[i,]))))
5555
}else{
56-
cor <- suppressWarnings(cor(pos$data[i,],neg$data[index,]))
56+
cor <- suppressWarnings(cor(as.numeric(pos$data[i,]),as.numeric(neg$data[index,])))
5757
}
5858

5959
t <- cbind.data.frame(pos=pos$mz[i],rt = pos$rt[i],neg=neg$mz[index],rt=neg$rt[index],diffmz=pos$mz[i]-neg$mz[index],diffrt=pos$rt[i]-neg$rt[index],cor=cor)

R/pmdvis.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ plotstdrt <- function(list, rtcluster, ...) {
202202
#' @seealso \code{\link{getstd}}, \code{\link{globalstd}},\code{\link{plotstd}},\code{\link{plotpaired}},\code{\link{plotstdrt}}
203203
#' @examples
204204
#' data(spmeinvivo)
205-
#' re <- globalstd(spmeinvivo)
205+
#' re <- globalstd(spmeinvivo, sda=TRUE)
206206
#' plotstdsda(re)
207207
#' @export
208208
plotstdsda <- function(list, index = NULL, ...) {

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pmd: Paired Mass Distance Analysis for GC/LC-MS Based Non-Targeted Analysis and
33

44
[![CRAN status](http://www.r-pkg.org/badges/version/pmd)](https://cran.r-project.org/package=pmd) [![Download counter](http://cranlogs.r-pkg.org/badges/pmd)](https://cran.r-project.org/package=pmd) [![](https://cranlogs.r-pkg.org/badges/grand-total/pmd)](https://cran.r-project.org/package=pmd) [![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) [![Build status](https://api.travis-ci.org/yufree/pmd.svg?branch=master)](https://travis-ci.org/yufree/pmd)
55

6-
Paired mass distance (PMD) analysis proposed in Yu, Olkowicz and Pawliszyn (2018) for gas/liquid chromatography–mass spectrometry (GC/LC-MS) based non-targeted analysis. PMD analysis including GlobalStd algorithm and structure/reaction directed analysis. GlobalStd algorithm could found independent peaks in m/z-retention time profiles based on retention time hierarchical cluster analysis and frequency analysis of paired mass distances within retention time groups. Structure directed analysis could be used to find potential relationship among those independent peaks in different retention time groups based on frequency of paired mass distances. Reactomics analysis could also be performed to build PMD network, assign sources and make biomarker reaction discovery. GUIs for PMD analysis is also included as 'shiny' applications.
6+
Paired mass distance (PMD) analysis proposed in Yu, Olkowicz and Pawliszyn (2018) and PMD based reactomics proposed in Yu and Petrick (2020) for gas/liquid chromatography–mass spectrometry (GC/LC-MS) based non-targeted analysis. PMD analysis including GlobalStd algorithm and structure/reaction directed analysis. GlobalStd algorithm could found independent peaks in m/z-retention time profiles based on retention time hierarchical cluster analysis and frequency analysis of paired mass distances within retention time groups. Structure directed analysis could be used to find potential relationship among those independent peaks in different retention time groups based on frequency of paired mass distances. Reactomics analysis could also be performed to build PMD network, assign sources and make biomarker reaction discovery. GUIs for PMD analysis is also included as 'shiny' applications.
77

88

99
Installation
@@ -28,17 +28,19 @@ Usage
2828

2929
- [Reactomics Analysis Tutorial](https://yufree.github.io/pmd/articles/reactomics.html)
3030

31-
- [Slides](http://yufree.github.io/presentation/reactomics/pres-asms.html). This is the slides for ASMS 2020 Reboot and here is the [video](https://youtu.be/-mT3HcVygHE) of presentation. Press "P" and you will see the notes for each slide with details. Another full version of reactomics presentation for one hour presentation could be found [here](http://yufree.github.io/presentation/reactomics/pres). I will not update the conference presentation while I will add new contents for the full version of reactomics presentation whenever I have new results.
31+
- [PMD analysis paper](https://www.sciencedirect.com/science/article/abs/pii/S0003267018313047). This paper proposed structure/reaction directed analysis with PMD.
32+
33+
- [Reactomics paper](https://www.nature.com/articles/s42004-020-00403-z). This paper contained the concepts of PMD based reactomics, applications and data mining of reaction database and compounds database.
3234

33-
- [Reactomics Preprint on BioRxiv](https://www.biorxiv.org/content/10.1101/855148v3). This preprint contain the same contents as shown in the presentation. I will update the manuscript later in this week for some changes.
35+
- [Slides](http://yufree.github.io/presentation/reactomics/pres-asms.html). This is the slides for ASMS 2020 Reboot and here is the [video](https://youtu.be/-mT3HcVygHE) of presentation. Press "P" and you will see the notes for each slide with details. Another full version of reactomics presentation for one hour presentation could be found [here](http://yufree.github.io/presentation/reactomics/pres). I will not update the conference presentation while I will add new contents for the full version of reactomics presentation whenever I have new results.
3436

3537

3638
To perform GlobalStd algorithem, use the following code:
3739

3840
``` {r}
3941
library(pmd)
4042
data("spmeinvivo")
41-
pmd <- getpaired(spmeinvivo, rtcutoff = 10, ng = 10)
43+
pmd <- getpaired(spmeinvivo)
4244
std <- getstd(pmd)
4345
```
4446
To perform structure/reaction directed analysis, use the following code:
@@ -79,3 +81,9 @@ To check the HMDB pmd database:
7981
data("hmdb")
8082
View(hmdb)
8183
```
84+
85+
To cite related papers:
86+
87+
```{r}
88+
citation('pmd')
89+
```

docs/404.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)