Skip to content

Commit

Permalink
v1.12.0+galaxy0 (#29)
Browse files Browse the repository at this point in the history
* version bump and readme update

* bug fix for combineAnnotations

* update error detection cmd in xml

* Tool review (#28)

* initial commit

* some changes

* fix some things

* fix some other things

* add combine_annotations to travis

* combine annotation cli argument fix

* Update email for simon

* update file input processing dimsPredictPuritySingle and purityA

* addressing issue #22

* Update dependency

* Removed tomnl channel from travis

* update packages and spectral matching

* updated msp files with new msPurity version tag

* adding use-galaxy style travis testing and auto toolshed uploader

* Revert "adding use-galaxy style travis testing and auto toolshed uploader"

This reverts commit f021b2f.

* update travis

* travis troubleshoot

* travis updates

* pinned versions of packages

* update readme

* updated readme

* update for 'argument' name
  • Loading branch information
Tomnl committed Nov 25, 2019
1 parent 1d6d23b commit cb903cd
Show file tree
Hide file tree
Showing 42 changed files with 3,309 additions and 3,328 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ cache:

env:
- TEST=tools/msPurity/purityA.xml
- TEST=tools/msPurity/combineAnnotations.xml
- TEST=tools/msPurity/spectralMatching.xml
- TEST=tools/msPurity/dimsPredictPuritySingle.xml
- TEST=tools/msPurity/filterFragSpectra.xml
Expand All @@ -27,5 +28,5 @@ before_install:

script:
- planemo lint ${TRAVIS_BUILD_DIR}/${TEST}
- travis_wait 30 planemo test --conda_debug --conda_ensure_channels tomnl,iuc,bioconda,conda-forge,defaults ${TRAVIS_BUILD_DIR}/${TEST}
- planemo test --conda_debug ${TRAVIS_BUILD_DIR}/${TEST}

20 changes: 13 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@ msPurity for Galaxy
========================
|Build Status (Travis)| |Git| |Bioconda| |License|

Warning
------
Proceed with caution these tools are in active development so tools may change! Stable release to Galaxy toolshed coming soon. Currently these tools will only work when the 'tomnl' conda channel is being used with Galaxy.

Version v1.11.4+galaxy0.2.7
Version v1.12.0+galaxy0
------
NOTE: bioconductor-mspurity v1.11.4 only available on 'tomnl' conda channel - to be updated to bioconda soon.

- msPurity
- bioconductor-mspurity v1.11.4
- bioconductor-mspurity v1.12.0
- Galaxy tools
- v0.2.7
- v0

About
------
Expand Down Expand Up @@ -55,9 +51,19 @@ Authors, contributors & contacts
- Ralf J. M. Weber ([email protected]) - `University of Birmingham (UK) <http://www.birmingham.ac.uk/index.aspx>`_
- Jordi Capellades ([email protected]) - `Universitat Rovira i Virgili (SP) <http://www.urv.cat/en/>`_
- Julien Saint-Vanne (jsaintvanne) - `ABiMS (France) <http://abims.sb-roscoff.fr/>`_
- Simon Bray ([email protected]) - `University of Freiburg (Germany) <https://www.uni-freiburg.de/>`_

Changes
-------------------------
v1.12.0-galaxy0
- Updates for Bioconductor stable msPurity v1.12.0 release
- Additional columns added for spectral matching (for msnpy use case)
- Merge of v1.11.4-galaxy1

v1.11.4-galaxy1
- Not submitted to toolshed
- Update to follow IUC guidelines for Galaxy tool development

v1.11.4-galaxy0.2.7
- submitted to test toolshed (20190927)
- Bug fix for spectralMatching choice of instrument types
Expand Down
18 changes: 11 additions & 7 deletions tools/msPurity/averageFragSpectra.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,18 @@ if (length(pa)>0){
} else{
colnames(av_spectra)[1] <- 'grpid'
av_spectra$grpid <- names(pa@av_spectra)[av_spectra$grpid]

if((length(pa@av_intra_params)>0) || (length(pa@av_inter_params)>0) ){
# Add some extra info (only required if av_intra or av_inter performed)
colnames(av_spectra)[2] <- 'fileid'
av_spectra$avid <- 1:nrow(av_spectra)

filenames <- sapply(av_spectra$fileid, function(x) names(pa@fileList)[as.integer(x)])
# filenames_galaxy <- sapply(av_spectra$fileid, function(x) basename(pa@fileList[as.integer(x)]))

av_spectra = as.data.frame(append(av_spectra, list(filename = filenames), after=2))
}

colnames(av_spectra)[2] <- 'fileid'
av_spectra$avid <- 1:nrow(av_spectra)

filenames <- sapply(av_spectra$fileid, function(x) names(pa@fileList)[as.integer(x)])
# filenames_galaxy <- sapply(av_spectra$fileid, function(x) basename(pa@fileList[as.integer(x)]))

av_spectra = as.data.frame(append(av_spectra, list(filename = filenames), after=2))

print(head(av_spectra))
write.table(av_spectra, opt$out_peaklist, row.names=FALSE, sep='\t')
Expand Down
43 changes: 17 additions & 26 deletions tools/msPurity/averageFragSpectra.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
<tool id="mspurity_averagefragspectra" name="msPurity.averageFragSpectra" version="@TOOL_VERSION@+galaxy@GALAXY_TOOL_VERSION@">
<description>
Average and filter LC-MS/MS fragmentation spectra (Inter, Intra or All)
</description>

<description>Average and filter LC-MS/MS fragmentation spectra (Inter, Intra or All)</description>
<macros>
<import>macros.xml</import>
</macros>

<expand macro="requirements">
</expand>

<stdio>
<exit_code range="1:" />
</stdio>
<command interpreter="Rscript"><![CDATA[
averageFragSpectra.R
--out_rdata="$averageFragSpectra_output_rdata"
--out_peaklist="$averageFragSpectra_output_tsv"
--pa="$pa"
<expand macro="requirements"/>
<command detect_errors="exit_code"><![CDATA[
Rscript '$__tool_directory__/averageFragSpectra.R'
--out_rdata='$averageFragSpectra_output_rdata'
--out_peaklist='$averageFragSpectra_output_tsv'
--pa='$pa'
--av_level=$av_level
--cores=\${GALAXY_SLOTS:-4}
--minfrac=$minfrac
Expand All @@ -30,29 +21,29 @@
$rmp
]]></command>
<inputs>
<param name="pa" type="data" label="purityA object" format="rdata"
<param argument="--pa" type="data" label="purityA object" format="rdata"
help="purityA object saved as 'pa' in a RData file (output from frag4feature tool)"/>


<param name="av_level" type="select" label="Average and filter fragmentation spectra for each XCMS feature" help="">
<param argument="--av_level" type="select" label="Average and filter fragmentation spectra for each XCMS feature" help="">
<option value="intra" selected="true">within a MS data file</option>
<option value="inter">across MS data files</option>
<option value="all">within and across MS data files (ignoring intra and inter relationships)</option>
</param>


<param name="snr" type="float" value="0.0" label="Signal-to-noise threshold after averaging or summing" help="" />
<param name="ra" type="float" min="0.0" max="1.0" value="0.0" label="Relative abundance threshold after averaging or summing" help="" />
<param name="minfrac" type="float" min="0.0" max="1.0" value="0.5" label="Minimum fraction (i.e. percentage) of (averaged) scans a fragment peak has to be present in." help="" />
<param name="minnum" type="integer" value="1" label="Minimum number of (averaged) fragmentation scans for a fragmentation event (precursor)." help="" />
<param name="ppm" type="float" value="5.0" label="Ppm error tolerance" help="Maximum tolerated m/z deviation in parts per million." />
<param name="sumi" type="boolean" checked="false" truevalue="--sumi" falsevalue="" label="Sum intensities across (averaged) scans?" help="" />
<param name="av" type="select" label="Function to calculate the average intensity, m/z and SNR values across (averaged) scans after filtering." help="This is ignored for intensities when intensities are summed." >
<param argument="--snr" type="float" min="0.0" value="0.0" label="Signal-to-noise threshold after averaging or summing" help="" />
<param argument="--ra" type="float" min="0.0" max="1.0" value="0.0" label="Relative abundance threshold after averaging or summing" help="" />
<param argument="--minfrac" type="float" min="0.0" max="1.0" value="0.5" label="Minimum fraction (i.e. percentage) of (averaged) scans a fragment peak has to be present in." help="" />
<param argument="--minnum" type="integer" min="1" value="1" label="Minimum number of (averaged) fragmentation scans for a fragmentation event (precursor)." help="" />
<param argument="--ppm" type="float" min="0.0" value="5.0" label="Ppm error tolerance" help="Maximum tolerated m/z deviation in parts per million." />
<param argument="--sumi" type="boolean" checked="false" truevalue="--sumi" falsevalue="" label="Sum intensities across (averaged) scans?" help="" />
<param argument="--av" type="select" label="Function to calculate the average intensity, m/z and SNR values across (averaged) scans after filtering." help="This is ignored for intensities when intensities are summed." >
<option value="median" selected="true">median</option>
<option value="mean">mean</option>
</param>

<param name="rmp" type="boolean" checked="true" truevalue="--rmp" falsevalue="" label="Remove peaks that do not meet the filtering criteria. Otherwise peaks will be flagged instead."
<param argument="--rmp" type="boolean" checked="true" truevalue="--rmp" falsevalue="" label="Remove peaks that do not meet the filtering criteria. Otherwise peaks will be flagged instead."
help="" />
</inputs>
<outputs>
Expand Down
17 changes: 9 additions & 8 deletions tools/msPurity/combineAnnotations.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ option_list <- list(
make_option("--ms1_lookup_keepAdducts", type="character", default=NA),
make_option("--ms1_lookup_dbSource", type="character", default="hmdb"),

make_option(c("-sw","--sm_weight"),type="numeric"),
make_option(c("-mw","--metfrag_weight"),type="numeric"),
make_option(c("-cw","--sirius_csi_weight"),type="numeric"),
make_option(c("-pw","--probmetab_weight"),type="numeric"),
make_option(c("-lw","--ms1_lookup_weight"),type="numeric"),
make_option(c("-bw","--biosim_weight"),type="numeric"),
make_option("--sm_weight", type="numeric"),
make_option("--metfrag_weight", type="numeric"),
make_option("--sirius_csi_weight", type="numeric"),
make_option("--probmetab_weight", type="numeric"),
make_option("--ms1_lookup_weight", type="numeric"),
make_option("--biosim_weight", type="numeric"),

make_option("--create_new_database", action="store_true"),
make_option(c("-o","--outdir"),type="character", default="."),
make_option("--outdir", type="character", default="."),

make_option("--compoundDbType", type="character", default="sqlite"),
make_option("--compoundDbPth", type="character", default=NA),
Expand Down Expand Up @@ -67,7 +67,8 @@ if (opt$compoundDbType=='local_config'){
source_local <- function(fname){ argv <- commandArgs(trailingOnly=FALSE); base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)); source(paste(base_dir, fname, sep="/")) }
source_local("dbconfig.R")
}else{
compoundDbType = compoundDbType
compoundDbPth = opt$compoundDbPth
compoundDbType = opt$compoundDbType
compoundDbName = NA
compoundDbHost = NA
compoundDbPort = NA
Expand Down
68 changes: 28 additions & 40 deletions tools/msPurity/combineAnnotations.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
<tool id="mspurity_combineannotations" name="msPurity.combineAnnotations" version="@TOOL_VERSION@+galaxy@GALAXY_TOOL_VERSION@">
<description>
Combine, score and rank metabolite annotation results
</description>

<description>Combine, score and rank metabolite annotation results</description>
<macros>
<import>macros.xml</import>
</macros>

<expand macro="requirements">
</expand>

<stdio>
<exit_code range="1:" />
</stdio>
<command interpreter="Rscript"><![CDATA[
combineAnnotations.R
--sm_resultPth="$sm_resultPth"
--metfrag_resultPth="$metfrag_resultPth"
--sirius_csi_resultPth="$sirius_csi_resultPth"
--probmetab_resultPth="$probmetab_resultPth"
--ms1_lookup_resultPth=$ms1_lookup_resultPth
<expand macro="requirements"/>
<command detect_errors="exit_code"><![CDATA[
Rscript '$__tool_directory__/combineAnnotations.R'
--sm_resultPth='$sm_resultPth'
--metfrag_resultPth='$metfrag_resultPth'
--sirius_csi_resultPth='$sirius_csi_resultPth'
--probmetab_resultPth='$probmetab_resultPth'
--ms1_lookup_resultPth='$ms1_lookup_resultPth'
#if $ms1_lookup_checkAdducts:
--ms1_lookup_checkAdducts
#end if
--ms1_lookup_keepAdducts="$ms1_lookup_keepAdducts"
--ms1_lookup_keepAdducts='$ms1_lookup_keepAdducts'
--ms1_lookup_dbSource=$ms1_lookup_dbSource
--sm_weight=$sm_weight
Expand All @@ -44,56 +34,54 @@
--compoundDbType=$compoundDbTypeCond.compoundDbType
#if $compoundDbTypeCond.compoundDbType== 'sqlite'
--compoundDbPth=$compoundDbTypeCond.compoundDbPth
--compoundDbPth='$compoundDbTypeCond.compoundDbPth'
#end if
]]></command>
<inputs>


<param name="sm_resultPth" type="data" label="Spectral matching result" format="sqlite"
<param argument="--sm_resultPth" type="data" label="Spectral matching result" format="sqlite"
help="The SQLite database generated from msPurity.spectralMatching"/>
<param name="metfrag_resultPth" type="data" label="Metfrag result" format="tsv,tabular" optional="true"
<param argument="--metfrag_resultPth" type="data" label="Metfrag result" format="tsv,tabular" optional="true"
help="The result of the MetFrag analysis (requires a column indicating the XCMS group ID)"/>
<param name="sirius_csi_resultPth" type="data" label="Sirius CSI:FingerID result" format="tsv,tabular" optional="true"
<param argument="--sirius_csi_resultPth" type="data" label="Sirius CSI:FingerID result" format="tsv,tabular" optional="true"
help="The result of the CSI:FingerID analysis (requires a column indicating the XCMS group ID)"/>
<param name="probmetab_resultPth" type="data" label="Probmetab result" format="tsv,tabular" optional="true"
<param argument="--probmetab_resultPth" type="data" label="Probmetab result" format="tsv,tabular" optional="true"
help="The result of the Probmetab analysis (requires a column indicating the XCMS group ID)"/>
<param name="ms1_lookup_resultPth" type="data" label="MS1 Lookup result" format="tsv,tabular" optional="true"
<param argument="--ms1_lookup_resultPth" type="data" label="MS1 Lookup result" format="tsv,tabular" optional="true"
help="The result of the a generic MS1 lookup annotation software (e.g. BEAMS can be used)"/>
<param name="ms1_lookup_keepAdducts" type="text" label="MS1 lookup adducts to keep" optional="true"
<param argument="--ms1_lookup_keepAdducts" type="text" label="MS1 lookup adducts to keep" optional="true"
help="Provide a list of adducts that should be used from the MS1 lookup (e.g. [M+H]+, [M+Na]+"/>
<param name="ms1_lookup_checkAdducts" type="boolean" label="MS1 lookup check adducts to CAMERA"
<param argument="--ms1_lookup_checkAdducts" type="boolean" label="MS1 lookup check adducts to CAMERA"
help="Check if adducts match to those found in CAMERA (requires the database to have been created with CAMERA object"/>
<param name="ms1_lookup_dbSource" type="select" label="MS1 lookup database source" help="Which database was used for the MS1 lookup" >
<param argument="--ms1_lookup_dbSource" type="select" label="MS1 lookup database source" help="Which database was used for the MS1 lookup" >
<option value="hmdb" selected="true">hmdb</option>
<option value="pubchem">pubchem</option>
<option value="kegg">kegg</option>
</param>
<param name="sm_weight" type="float" min="0.0" max="1.0" value="0.3" label="Spectral matching weight" help="all weights need to sum to 1" />
<param name="metfrag_weight" type="float" min="0.0" max="1.0" value="0.2" label="Metfrag weight" help="all weights need to sum to 1" />
<param name="sirius_csi_weight" type="float" min="0.0" max="1.0" value="0.2" label="Sirius CSI:FingerID weight" help="all weights need to sum to 1" />
<param name="probmetab_weight" type="float" min="0.0" max="1.0" value="0.0" label="Probmetab weight" help="all weights need to sum to 1" />
<param name="ms1_lookup_weight" type="float" min="0.0" max="1.0" value="0.05" label="MS1 Lookup weight" help="all weights need to sum to 1" />
<param name="biosim_weight" type="float" min="0.0" max="1.0" value="0.25" label="Biological similarity weight" help="all weights need to sum to 1" />
<param name="create_new_database" type="boolean" checked="true" label="Create a new database for the results?"
<param argument="--sm_weight" type="float" min="0.0" max="1.0" value="0.3" label="Spectral matching weight" help="all weights need to sum to 1" />
<param argument="--metfrag_weight" type="float" min="0.0" max="1.0" value="0.2" label="Metfrag weight" help="all weights need to sum to 1" />
<param argument="--sirius_csi_weight" type="float" min="0.0" max="1.0" value="0.2" label="Sirius CSI:FingerID weight" help="all weights need to sum to 1" />
<param argument="--probmetab_weight" type="float" min="0.0" max="1.0" value="0.0" label="Probmetab weight" help="all weights need to sum to 1" />
<param argument="--ms1_lookup_weight" type="float" min="0.0" max="1.0" value="0.05" label="MS1 Lookup weight" help="all weights need to sum to 1" />
<param argument="--biosim_weight" type="float" min="0.0" max="1.0" value="0.25" label="Biological similarity weight" help="all weights need to sum to 1" />
<param argument="--create_new_database" type="boolean" checked="true" label="Create a new database for the results?"
help="A copy will be made of the input SQLite spectral matching database and the results will be added to this copy.
When False, the input SQLite database will be updated the results. Use False
if you want to reduce storage space being used."/>

<conditional name="compoundDbTypeCond">
<param name="compoundDbType" type="select" label="compoundDbType" help="Database type for compound database to be used full database available on request - contact [email protected])." >
<param argument="--compoundDbType" type="select" label="compoundDbType" help="Database type for compound database to be used full database available on request - contact [email protected])." >
<option value="sqlite" selected="true">SQLite</option>
<option value="local_config" >Locally configured MySQL, Postgres or SQLite database</option>
</param>
<when value="sqlite">
<param type="data" name="compoundDbPth" label="SQLite compound database pth" format="sqlite" help=""/>
<param argument="--compoundDbPth" type="data" label="SQLite compound database pth" format="sqlite" help=""/>
</when>
<when value="local_config">
</when>
<when value="msPurityData">
</when>
</conditional>

</inputs>
Expand Down
Loading

0 comments on commit cb903cd

Please sign in to comment.