Skip to content

Commit

Permalink
v1.12.0+galaxy1 (#33)
Browse files Browse the repository at this point in the history
* Default offsets values able mzXML files

We can run mzXML files with default values here for offsets... Can be good to remove them, but it may be produce an error after that should be managed !

* Bug fix for purityA offsets

* Add missing bracket

* Close bracket

* flagRemove exit updated, update shed yml, update readme

* Make flagRemove.R rdata object backward compatible
  • Loading branch information
Tomnl committed Dec 5, 2019
1 parent cb903cd commit 20d432c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
10 changes: 8 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ msPurity for Galaxy
|Build Status (Travis)| |Git| |Bioconda| |License|


Version v1.12.0+galaxy0
Version v1.12.0+galaxy1
------

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

About
------
Expand Down Expand Up @@ -55,6 +55,12 @@ Authors, contributors & contacts

Changes
-------------------------
v1.12.0-galaxy1
- Bug fix (offsets were not being automatically selected for purityA) thanks jsaintvanne
- Exit script without error for flagRemove
- Username updated in Toolshed yaml


v1.12.0-galaxy0
- Updates for Bioconductor stable msPurity v1.12.0 release
- Additional columns added for spectral matching (for msnpy use case)
Expand Down
2 changes: 1 addition & 1 deletion tools/msPurity/.shed.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
owner: tomnl
owner: computational-metabolomics
remote_repository_url: https://github.com/computational-metabolomics/mspurity-galaxy
homepage_url: https://github.com/computational-metabolomics/mspurity-galaxy
categories: ["Metabolomics"]
Expand Down
4 changes: 2 additions & 2 deletions tools/msPurity/flagRemove.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ if (is.null(opt$samplelist)){
chosen_blank <- samplelist_blank[samplelist_blank %in% xset@phenoData$class]
if (length(chosen_blank)>1){
print('ERROR: only 1 blank is currently allowed to be used with this tool')
exit()
quit()
}
blank_class <- as.character(chosen_blank)
print(blank_class)
Expand Down Expand Up @@ -171,7 +171,7 @@ if (is.null(opt$multilist)){
grp_peaklist <- ffrm_out[[2]]
removed_peaks <- ffrm_out[[3]]

save.image(file=file.path(opt$out_dir, 'xset_filtered.RData'))
save.image(file=file.path(opt$out_dir, 'xset_filtered.RData'), version=2)

# grpid needed for mspurity ID needed for deconrank... (will clean up at some up)
peak_pth <- file.path(opt$out_dir, 'peaklist_filtered.tsv')
Expand Down
2 changes: 1 addition & 1 deletion tools/msPurity/macros.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<macros>
<token name="@TOOL_VERSION@">1.12.0</token>
<token name="@GALAXY_TOOL_VERSION@">0</token>
<token name="@GALAXY_TOOL_VERSION@">1</token>

<xml name="requirements">
<requirements>
Expand Down
22 changes: 15 additions & 7 deletions tools/msPurity/purityA.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ option_list <- list(
make_option(c("-o", "--out_dir"), type="character"),
make_option("--mzML_files", type="character"),
make_option("--galaxy_names", type="character"),
make_option("--minOffset", default=0.5),
make_option("--maxOffset", default=0.5),
make_option("--ilim", default=0.05),
make_option("--minOffset", type="numeric"),
make_option("--maxOffset", type="numeric"),
make_option("--ilim", type="numeric"),
make_option("--iwNorm", default="none", type="character"),
make_option("--exclude_isotopes", action="store_true"),
make_option("--isotope_matrix", type="character"),
Expand All @@ -22,18 +22,26 @@ option_list <- list(
opt <- parse_args(OptionParser(option_list=option_list))
print(opt)

minOffset = as.numeric(opt$minOffset)
maxOffset = as.numeric(opt$maxOffset)

if (opt$iwNorm=='none'){
iwNorm = FALSE
iwNormFun = NULL
}else if (opt$iwNorm=='gauss'){
iwNorm = TRUE
iwNormFun = msPurity::iwNormGauss(minOff=-minOffset, maxOff=maxOffset)
if (is.null(opt$minOffset) || is.null(opt$maxOffset)){
print('User has to define offsets if using Gaussian normalisation')
}else{
iwNormFun = msPurity::iwNormGauss(minOff=-as.numeric(opt$minOffset),
maxOff=as.numeric(opt$maxOffset))
}
}else if (opt$iwNorm=='rcosine'){
iwNorm = TRUE
iwNormFun = msPurity::iwNormRcosine(minOff=-minOffset, maxOff=maxOffset)
if (is.null(opt$minOffset) || is.null(opt$maxOffset)){
print('User has to define offsets if using R-cosine normalisation')
}else{
iwNormFun = msPurity::iwNormRcosine(minOff=-as.numeric(opt$minOffset),
maxOff=as.numeric(opt$maxOffset))
}
}else if (opt$iwNorm=='QE5'){
iwNorm = TRUE
iwNormFun = msPurity::iwNormQE.5()
Expand Down

0 comments on commit 20d432c

Please sign in to comment.