Skip to content

Commit

Permalink
v1.28.0+galaxy0 (#55)
Browse files Browse the repository at this point in the history
* version bump

* removed slash github yaml
  • Loading branch information
Tomnl authored Jun 13, 2024
1 parent 7e17486 commit 20a48a1
Show file tree
Hide file tree
Showing 25 changed files with 740 additions and 774 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/slash.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

14 changes: 9 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ msPurity for Galaxy
|Git| |Bioconda| |License|


Version v1.16.2+galaxy2
Version v1.28.0+galaxy0
------------------------

- msPurity
- bioconductor-mspurity v1.16.2
- bioconductor-mspurity v1.28.0
- Galaxy tools
- v2
- v0

About
------
Expand All @@ -26,10 +26,8 @@ Use the following links for more details of the msPurity R package:
* Bioconductor: http://bioconductor.org/packages/msPurity/
* Vignette: https://bioconductor.org/packages/devel/bioc/vignettes/msPurity/inst/doc/msPurity-vignette.html
* Manual: http://bioconductor.org/packages/devel/bioc/manuals/msPurity/man/msPurity.pdf
* Bioconductor mirror code: https://github.com/Bioconductor-mirror/msPurity
* Github code: https://github.com/computational-metabolomics/mspurity
* Bioconda (stable): https://anaconda.org/bioconda/bioconductor-mspurity
* Conda (dev and testing): https://anaconda.org/tomnl/bioconductor-mspurity


Dependencies
Expand All @@ -54,6 +52,12 @@ Authors, contributors & contacts

Changes
-------------------------
v1.28.0-galaxy0
- Version bump to v1.28.0
- createMSP now uses the median precursor MZ and precursor RT in the MSP files
- flagRemove updated to handle different xcms version objects internally within msPurity R function
- Relevant unit tests updated and further tidying up of repo

v1.16.2-galaxy2
- Fix for purityX galaxy tool (https://github.com/computational-metabolomics/mspurity-galaxy/issues/53)
- Cleanup of xml based on updated lint requirements
Expand Down
50 changes: 25 additions & 25 deletions tools/msPurity/flagRemove.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
library(msPurity)
library(xcms)
library(optparse)
print(sessionInfo())
option_list <- list(
Expand Down Expand Up @@ -117,19 +118,25 @@ if (is.null(opt$remove_spectra)) {

print(opt)

getxcmsSetObject <- function(xobject) {
# XCMS 1.x
if (class(xobject) == "xcmsSet") {
return(xobject)
}
# XCMS 3.x
if (class(xobject) == "XCMSnExp") {
# Get the legacy xcmsSet object
suppressWarnings(xset <- as(xobject, "xcmsSet"))
xcms::sampclass(xset) <- xset@phenoData$sample_group
return(xset)
}
}
# This R function can handle both XCMS object versions (so following code
# no longer required - kept here for reference)
# getxcmsSetObject <- function(xobject) {
# # XCMS 1.x
# if (class(xobject) == "xcmsSet"){
# return(xobject)
# }
# # XCMS 3.x
# if (class(xobject) == "XCMSnExp") {
# # Get the legacy xcmsSet object
# suppressWarnings(xset <- as(xobject, "xcmsSet"))
# if (!is.null(xset@phenoData$sample_group)){
# xcms::sampclass(xset) <- xset@phenoData$sample_group
# }else{
# xcms::sampclass(xset) <- "."
# }
# return(xset)
# }
# }


loadRData <- function(rdata_path, name) {
Expand All @@ -138,9 +145,9 @@ loadRData <- function(rdata_path, name) {
return(get(ls()[ls() %in% name]))
}

xset <- getxcmsSetObject(loadRData(opt$xset_path, c("xset", "xdata")))
xset <- loadRData(opt$xset_path, c("xset", "xdata"))


print(xset)
if (is.null(opt$samplelist)) {
blank_class <- opt$blank_class
} else {
Expand All @@ -157,6 +164,8 @@ if (is.null(opt$samplelist)) {
}




if (is.null(opt$multilist)) {
ffrm_out <- flag_remove(xset,
pol = opt$polarity,
Expand Down Expand Up @@ -201,15 +210,6 @@ if (is.null(opt$multilist)) {
)
} else {
# nolint start
# TODO
# xsets <- split(xset, multilist_df$multlist)
#
# mult_grps <- unique(multilist_df$multlist)
#
# for (mgrp in mult_grps){
# xset_i <- xsets[mgrp]
# xcms::group(xset_i,
#
# }
# TODO - potential for multilist analysis (e)
# nolint end
}
7 changes: 6 additions & 1 deletion tools/msPurity/frag4feature.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ getxcmsSetObject <- function(xobject) {
if (class(xobject) == "XCMSnExp") {
# Get the legacy xcmsSet object
suppressWarnings(xset <- as(xobject, "xcmsSet"))
sampclass(xset) <- xset@phenoData$sample_group
if (!is.null(xset@phenoData$sample_group)) {
xcms::sampclass(xset) <- xset@phenoData$sample_group
} else {
xcms::sampclass(xset) <- "."
}
return(xset)
}
}
Expand All @@ -96,6 +100,7 @@ pa@cores <- opt$cores
print(pa@fileList)
print(xset@filepaths)


if (is.null(opt$intense)) {
intense <- FALSE
} else {
Expand Down
16 changes: 8 additions & 8 deletions tools/msPurity/macros.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0"?>
<macros>
<token name="@TOOL_VERSION@">1.16.2</token>
<token name="@GALAXY_TOOL_VERSION@">2</token>
<token name="@TOOL_VERSION@">1.28.0</token>
<token name="@GALAXY_TOOL_VERSION@">0</token>

<xml name="requirements">
<requirements>
<requirement type="package" version="@TOOL_VERSION@" >bioconductor-mspurity</requirement>
<requirement type="package" version="1.46.0" >bioconductor-camera</requirement>
<requirement type="package" version="3.12.0" >bioconductor-xcms</requirement>
<requirement type="package" version="1.18.0" >bioconductor-mspuritydata</requirement>
<requirement type="package" version="1.6.6">r-optparse</requirement>
<requirement type="package" version="1.3.1">r-rpostgres</requirement>
<requirement type="package" version="0.10.21">r-rmysql</requirement>
<requirement type="package" version="1.58.0" >bioconductor-camera</requirement>
<requirement type="package" version="4.0.0" >bioconductor-xcms</requirement>
<requirement type="package" version="1.30.0" >bioconductor-mspuritydata</requirement>
<requirement type="package" version="1.7.5">r-optparse</requirement>
<requirement type="package" version="1.4.7">r-rpostgres</requirement>
<requirement type="package" version="0.10.27">r-rmysql</requirement>
<yield />
</requirements>
</xml>
Expand Down
8 changes: 6 additions & 2 deletions tools/msPurity/purityX.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,18 @@ loadRData <- function(rdata_path, xset_name) {

getxcmsSetObject <- function(xobject) {
# XCMS 1.x
if (class(xobject) == "xcmsSet") {
if (class(xobject) == "xcmsSet"){
return(xobject)
}
# XCMS 3.x
if (class(xobject) == "XCMSnExp") {
# Get the legacy xcmsSet object
suppressWarnings(xset <- as(xobject, "xcmsSet"))
sampclass(xset) <- xset@phenoData$sample_group
if (!is.null(xset@phenoData$sample_group)){
xcms::sampclass(xset) <- xset@phenoData$sample_group
}else{
xcms::sampclass(xset) <- "."
}
return(xset)
}
}
Expand Down
Binary file modified tools/msPurity/test-data/averageFragSpectra_output_all.RData
Binary file not shown.
Binary file not shown.
Binary file modified tools/msPurity/test-data/averageFragSpectra_output_inter.RData
Binary file not shown.
Binary file modified tools/msPurity/test-data/averageFragSpectra_output_intra.RData
Binary file not shown.
Binary file not shown.
Binary file modified tools/msPurity/test-data/createDatabase_output.sqlite
Binary file not shown.
Binary file modified tools/msPurity/test-data/createDatabase_output_eic.sqlite
Binary file not shown.
16 changes: 8 additions & 8 deletions tools/msPurity/test-data/createMSP_output_av_all_metadata.msp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RECORD_TITLE: MZ:112.0508 | RT:67.5 | grpid:12 | file:NA | adduct:[M+NH4]+
MS$FOCUSED_ION: PRECURSOR_M/Z 112.050766766484
AC$CHROMATOGRAPHY: RETENTION_TIME 67.47903
RECORD_TITLE: MZ:112.0508 | RT:67.6 | grpid:12 | file:NA | adduct:[M+NH4]+
MS$FOCUSED_ION: PRECURSOR_M/Z 112.050811228882
AC$CHROMATOGRAPHY: RETENTION_TIME 67.556532
isotope [4][M]+
MS$FOCUSED_ION: PRECURSOR_TYPE [M+NH4]+
AC$CHROMATOGRAPHY: COLUMN_NAME Acclaim RSLC C18 2.2um 2.1x100mm Thermo
Expand All @@ -10,15 +10,15 @@ CH$LINK: INCHIKEY VACCAVUAMIDAGB-UHFFFAOYSA-N
CH$LINK: PUBCHEM CID:5328
CH$NAME Unknown
XCMS groupid (grpid): 12
COMMENT: Exported from msPurity purityA object using function createMSP, using method 'av_all' msPurity version:1.16.2
COMMENT: Exported from msPurity purityA object using function createMSP, using method 'av_all' msPurity version:1.28.0
PK$NUM_PEAK: 2
PK$PEAK: m/z int. rel.int.
112.050884246826 502873.46875 100
126.53768157959 2499.31469726562 0.5

RECORD_TITLE: MZ:112.0508 | RT:67.5 | grpid:12 | file:NA | adduct:[M+H+NH3]+
MS$FOCUSED_ION: PRECURSOR_M/Z 112.050766766484
AC$CHROMATOGRAPHY: RETENTION_TIME 67.47903
RECORD_TITLE: MZ:112.0508 | RT:67.6 | grpid:12 | file:NA | adduct:[M+H+NH3]+
MS$FOCUSED_ION: PRECURSOR_M/Z 112.050811228882
AC$CHROMATOGRAPHY: RETENTION_TIME 67.556532
isotope [4][M]+
MS$FOCUSED_ION: PRECURSOR_TYPE [M+H+NH3]+
AC$CHROMATOGRAPHY: COLUMN_NAME Acclaim RSLC C18 2.2um 2.1x100mm Thermo
Expand All @@ -28,7 +28,7 @@ CH$LINK: INCHIKEY VACCAVUAMIDAGB-UHFFFAOYSA-N
CH$LINK: PUBCHEM CID:5328
CH$NAME Unknown
XCMS groupid (grpid): 12
COMMENT: Exported from msPurity purityA object using function createMSP, using method 'av_all' msPurity version:1.16.2
COMMENT: Exported from msPurity purityA object using function createMSP, using method 'av_all' msPurity version:1.28.0
PK$NUM_PEAK: 2
PK$PEAK: m/z int. rel.int.
112.050884246826 502873.46875 100
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RECORD_TITLE: MZ:112.0508 | RT:67.5 | grpid:12 | file:NA | adduct:[M+NH4]+
MS$FOCUSED_ION: PRECURSOR_M/Z 112.050766766484
AC$CHROMATOGRAPHY: RETENTION_TIME 67.47903
RECORD_TITLE: MZ:112.0508 | RT:67.6 | grpid:12 | file:NA | adduct:[M+NH4]+
MS$FOCUSED_ION: PRECURSOR_M/Z 112.050811228882
AC$CHROMATOGRAPHY: RETENTION_TIME 67.556532
isotope [4][M]+
MS$FOCUSED_ION: PRECURSOR_TYPE [M+NH4]+
AC$CHROMATOGRAPHY: COLUMN_NAME Acclaim RSLC C18 2.2um 2.1x100mm Thermo
Expand All @@ -10,15 +10,15 @@ CH$LINK: INCHIKEY VACCAVUAMIDAGB-UHFFFAOYSA-N
CH$LINK: PUBCHEM CID:5328
CH$NAME Unknown
XCMS groupid (grpid): 12
COMMENT: Exported from msPurity purityA object using function createMSP, using method 'av_all' msPurity version:1.16.2
COMMENT: Exported from msPurity purityA object using function createMSP, using method 'av_all' msPurity version:1.28.0
PK$NUM_PEAK: 2
PK$PEAK: m/z int. rel.int.
112.050884246826 502873.46875 100
126.53768157959 2499.31469726562 0.5

RECORD_TITLE: MZ:112.0508 | RT:67.5 | grpid:12 | file:NA | adduct:[M+H+NH3]+
MS$FOCUSED_ION: PRECURSOR_M/Z 112.050766766484
AC$CHROMATOGRAPHY: RETENTION_TIME 67.47903
RECORD_TITLE: MZ:112.0508 | RT:67.6 | grpid:12 | file:NA | adduct:[M+H+NH3]+
MS$FOCUSED_ION: PRECURSOR_M/Z 112.050811228882
AC$CHROMATOGRAPHY: RETENTION_TIME 67.556532
isotope [4][M]+
MS$FOCUSED_ION: PRECURSOR_TYPE [M+H+NH3]+
AC$CHROMATOGRAPHY: COLUMN_NAME Acclaim RSLC C18 2.2um 2.1x100mm Thermo
Expand All @@ -28,15 +28,15 @@ CH$LINK: INCHIKEY VACCAVUAMIDAGB-UHFFFAOYSA-N
CH$LINK: PUBCHEM CID:5328
CH$NAME Unknown
XCMS groupid (grpid): 12
COMMENT: Exported from msPurity purityA object using function createMSP, using method 'av_all' msPurity version:1.16.2
COMMENT: Exported from msPurity purityA object using function createMSP, using method 'av_all' msPurity version:1.28.0
PK$NUM_PEAK: 2
PK$PEAK: m/z int. rel.int.
112.050884246826 502873.46875 100
126.53768157959 2499.31469726562 0.5

RECORD_TITLE: MZ:112.0508 | RT:67.5 | grpid:12 | file:NA | adduct:[M+]+
MS$FOCUSED_ION: PRECURSOR_M/Z 112.050766766484
AC$CHROMATOGRAPHY: RETENTION_TIME 67.47903
RECORD_TITLE: MZ:112.0508 | RT:67.6 | grpid:12 | file:NA | adduct:[M+]+
MS$FOCUSED_ION: PRECURSOR_M/Z 112.050811228882
AC$CHROMATOGRAPHY: RETENTION_TIME 67.556532
isotope [4][M]+
MS$FOCUSED_ION: PRECURSOR_TYPE [M+]+
AC$CHROMATOGRAPHY: COLUMN_NAME Acclaim RSLC C18 2.2um 2.1x100mm Thermo
Expand All @@ -46,15 +46,15 @@ CH$LINK: INCHIKEY VACCAVUAMIDAGB-UHFFFAOYSA-N
CH$LINK: PUBCHEM CID:5328
CH$NAME Unknown
XCMS groupid (grpid): 12
COMMENT: Exported from msPurity purityA object using function createMSP, using method 'av_all' msPurity version:1.16.2
COMMENT: Exported from msPurity purityA object using function createMSP, using method 'av_all' msPurity version:1.28.0
PK$NUM_PEAK: 2
PK$PEAK: m/z int. rel.int.
112.050884246826 502873.46875 100
126.53768157959 2499.31469726562 0.5

RECORD_TITLE: MZ:112.0508 | RT:67.5 | grpid:12 | file:NA | adduct:[M-H]-
MS$FOCUSED_ION: PRECURSOR_M/Z 112.050766766484
AC$CHROMATOGRAPHY: RETENTION_TIME 67.47903
RECORD_TITLE: MZ:112.0508 | RT:67.6 | grpid:12 | file:NA | adduct:[M-H]-
MS$FOCUSED_ION: PRECURSOR_M/Z 112.050811228882
AC$CHROMATOGRAPHY: RETENTION_TIME 67.556532
isotope [4][M]+
MS$FOCUSED_ION: PRECURSOR_TYPE [M-H]-
AC$CHROMATOGRAPHY: COLUMN_NAME Acclaim RSLC C18 2.2um 2.1x100mm Thermo
Expand All @@ -64,15 +64,15 @@ CH$LINK: INCHIKEY VACCAVUAMIDAGB-UHFFFAOYSA-N
CH$LINK: PUBCHEM CID:5328
CH$NAME Unknown
XCMS groupid (grpid): 12
COMMENT: Exported from msPurity purityA object using function createMSP, using method 'av_all' msPurity version:1.16.2
COMMENT: Exported from msPurity purityA object using function createMSP, using method 'av_all' msPurity version:1.28.0
PK$NUM_PEAK: 2
PK$PEAK: m/z int. rel.int.
112.050884246826 502873.46875 100
126.53768157959 2499.31469726562 0.5

RECORD_TITLE: MZ:112.0508 | RT:67.5 | grpid:12 | file:NA | adduct:[M+TEST
MS$FOCUSED_ION: PRECURSOR_M/Z 112.050766766484
AC$CHROMATOGRAPHY: RETENTION_TIME 67.47903
RECORD_TITLE: MZ:112.0508 | RT:67.6 | grpid:12 | file:NA | adduct:[M+TEST
MS$FOCUSED_ION: PRECURSOR_M/Z 112.050811228882
AC$CHROMATOGRAPHY: RETENTION_TIME 67.556532
isotope [4][M]+
MS$FOCUSED_ION: PRECURSOR_TYPE [M+TEST
AC$CHROMATOGRAPHY: COLUMN_NAME Acclaim RSLC C18 2.2um 2.1x100mm Thermo
Expand All @@ -82,15 +82,15 @@ CH$LINK: INCHIKEY VACCAVUAMIDAGB-UHFFFAOYSA-N
CH$LINK: PUBCHEM CID:5328
CH$NAME Unknown
XCMS groupid (grpid): 12
COMMENT: Exported from msPurity purityA object using function createMSP, using method 'av_all' msPurity version:1.16.2
COMMENT: Exported from msPurity purityA object using function createMSP, using method 'av_all' msPurity version:1.28.0
PK$NUM_PEAK: 2
PK$PEAK: m/z int. rel.int.
112.050884246826 502873.46875 100
126.53768157959 2499.31469726562 0.5

RECORD_TITLE: MZ:112.0508 | RT:67.5 | grpid:12 | file:NA | adduct:SPACE+]+
MS$FOCUSED_ION: PRECURSOR_M/Z 112.050766766484
AC$CHROMATOGRAPHY: RETENTION_TIME 67.47903
RECORD_TITLE: MZ:112.0508 | RT:67.6 | grpid:12 | file:NA | adduct:SPACE+]+
MS$FOCUSED_ION: PRECURSOR_M/Z 112.050811228882
AC$CHROMATOGRAPHY: RETENTION_TIME 67.556532
isotope [4][M]+
MS$FOCUSED_ION: PRECURSOR_TYPE SPACE+]+
AC$CHROMATOGRAPHY: COLUMN_NAME Acclaim RSLC C18 2.2um 2.1x100mm Thermo
Expand All @@ -100,7 +100,7 @@ CH$LINK: INCHIKEY VACCAVUAMIDAGB-UHFFFAOYSA-N
CH$LINK: PUBCHEM CID:5328
CH$NAME Unknown
XCMS groupid (grpid): 12
COMMENT: Exported from msPurity purityA object using function createMSP, using method 'av_all' msPurity version:1.16.2
COMMENT: Exported from msPurity purityA object using function createMSP, using method 'av_all' msPurity version:1.28.0
PK$NUM_PEAK: 2
PK$PEAK: m/z int. rel.int.
112.050884246826 502873.46875 100
Expand Down
Binary file modified tools/msPurity/test-data/filterFragSpectra_output.RData
Binary file not shown.
Loading

0 comments on commit 20a48a1

Please sign in to comment.