Skip to content

Commit

Permalink
V1.28.0+galaxy1 (Galaxy tool fixes for purityX and purityA) (#57)
Browse files Browse the repository at this point in the history
* Filename fix for purityA output

* Fix for purityX xset object read

* Update pr.yaml

* Update pr.yaml - version bump for upload artifact

* Update pr.yaml artifact version bump

* Update filterFragSpectra.R - update filenames - ensure as character

* Update filterFragSpectra.R - revert - not required

* Update pr.yaml - version bump actions

* Update purityX.xml - update xml wrapper to remove ref to xcms object name

* clean up
  • Loading branch information
Tomnl authored Sep 13, 2024
1 parent 20a48a1 commit f10386d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 32 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ jobs:
run: echo "GALAXY_HEAD_SHA=$(git ls-remote ${{ env.GALAXY_REPO }} refs/heads/${{ env.GALAXY_RELEASE }} | cut -f1)" >> $GITHUB_ENV
- name: Save latest galaxy commit to artifact file
run: echo $GALAXY_HEAD_SHA > galaxy.sha
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: Workflow artifacts
path: galaxy.sha
- name: Cache .cache/pip
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-pip
with:
path: ~/.cache/pip
key: pip_cache_py_${{ matrix.python-version }}_gxy1_$GALAXY_HEAD_SHA
- name: Cache .planemo
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-planemo
with:
path: ~/.planemo
Expand All @@ -63,7 +63,7 @@ jobs:
run: |
touch tool.xml
PIP_QUIET=2 planemo test --galaxy_python_version ${{ matrix.python-version }} --no_conda_auto_init --galaxy_source $GALAXY_REPO --galaxy_branch $GALAXY_RELEASE
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
# The range of commits to check for changes is:
Expand All @@ -88,7 +88,7 @@ jobs:
run: planemo ci_find_repos --changed_in_commit_range $COMMIT_RANGE --exclude packages --exclude deprecated --exclude_from .tt_skip --output changed_repositories.list
- name: Show repo list
run: cat changed_repositories.list
- uses: actions/upload-artifact@v2.0.1
- uses: actions/upload-artifact@v3
with:
name: Workflow artifacts
path: changed_repositories.list
Expand All @@ -105,20 +105,20 @@ jobs:
steps:
# checkout the repository
# and use it as the current working directory
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-python@v1
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: Workflow artifacts
path: ../workflow_artifacts/
- name: Determine latest galaxy commit
run: echo "GALAXY_HEAD_SHA=$(cat ../workflow_artifacts/galaxy.sha)" >> $GITHUB_ENV
- name: Cache .cache/pip
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-pip
with:
path: ~/.cache/pip
Expand All @@ -144,20 +144,20 @@ jobs:
steps:
# checkout the repository to master
# and use it as the current working directory
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: Workflow artifacts
path: ../workflow_artifacts/
- name: Determine latest galaxy commit
run: echo "GALAXY_HEAD_SHA=$(cat ../workflow_artifacts/galaxy.sha)" >> $GITHUB_ENV
- name: Cache .cache/pip
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-pip
with:
path: ~/.cache/pip
Expand Down Expand Up @@ -200,7 +200,7 @@ jobs:
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: Workflow artifacts
path: ../workflow_artifacts/
Expand Down Expand Up @@ -267,7 +267,7 @@ jobs:
run: |
mkdir upload
mv tool_test_output.json tool_test_output.html upload/
- uses: actions/upload-artifact@v2.0.1
- uses: actions/upload-artifact@v3
with:
name: 'Tool test output ${{ matrix.chunk }}'
path: upload
Expand All @@ -286,7 +286,7 @@ jobs:
# This job runs on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
path: artifacts
- uses: actions/setup-python@v1
Expand All @@ -295,7 +295,7 @@ jobs:
- name: Determine latest galaxy commit
run: echo "GALAXY_HEAD_SHA=$(cat ../workflow_artifacts/galaxy.sha)" >> $GITHUB_ENV
- name: Cache .cache/pip
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-pip
with:
path: ~/.cache/pip
Expand All @@ -312,7 +312,7 @@ jobs:
run: |
mkdir upload
mv tool_test_output.json tool_test_output.html upload/
- uses: actions/upload-artifact@v2.0.1
- uses: actions/upload-artifact@v3
with:
name: 'All tool test results'
path: upload
Expand All @@ -333,20 +333,20 @@ jobs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.repository_owner == 'computational-metabolomics'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: Workflow artifacts
path: ../workflow_artifacts/
- name: Determine latest galaxy commit
run: echo "GALAXY_HEAD_SHA=$(cat ../workflow_artifacts/galaxy.sha)" >> $GITHUB_ENV
- name: Cache .cache/pip
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-pip
with:
path: ~/.cache/pip
Expand Down
8 changes: 6 additions & 2 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.28.0+galaxy0
Version v1.28.0+galaxy1
------------------------

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

About
------
Expand Down Expand Up @@ -52,6 +52,10 @@ Authors, contributors & contacts

Changes
-------------------------
v1.28.0-galaxy1
- Further fix for purityX galaxy tool (https://github.com/computational-metabolomics/mspurity-galaxy/issues/53)
- Fix for purityA file naming (https://github.com/computational-metabolomics/mspurity-galaxy/issues/56)

v1.28.0-galaxy0
- Version bump to v1.28.0
- createMSP now uses the median precursor MZ and precursor RT in the MSP files
Expand Down
2 changes: 1 addition & 1 deletion tools/msPurity/purityA.R
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ if (!is.null(opt$galaxy_names)) {
print(pa)
save(pa, file = file.path(opt$out_dir, "purityA_output.RData"))

pa@puritydf$filename <- sapply(pa@puritydf$fileid, function(x) names(pa@fileList)[as.integer(x)])
pa@puritydf$filename <- sapply(as.character(pa@puritydf$fileid), function(x) names(pa@fileList)[as.integer(x)])

print(head(pa@puritydf))
write.table(pa@puritydf, file.path(opt$out_dir, "purityA_output.tsv"), row.names = FALSE, sep = "\t")
7 changes: 3 additions & 4 deletions tools/msPurity/purityX.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ option_list <- list(
make_option("--singleFile", default = 0),
make_option("--cores", default = 4),
make_option("--xgroups", type = "character"),
make_option("--rdata_name", default = "xset"),
make_option("--camera_xcms", default = "xset"),
make_option("--files", type = "character"),
make_option("--galaxy_files", type = "character"),
Expand Down Expand Up @@ -63,10 +62,10 @@ if (is.null(opt$rtraw_columns)) {
rtraw_columns <- TRUE
}

loadRData <- function(rdata_path, xset_name) {
loadRData <- function(rdata_path, xnames) {
# loads an RData file, and returns the named xset object if it is there
load(rdata_path)
return(get(ls()[ls() == xset_name]))
return(get(ls()[ls() %in% xnames]))
}


Expand All @@ -90,7 +89,7 @@ getxcmsSetObject <- function(xobject) {
}
}

target_obj <- loadRData(opt$xset_path, opt$rdata_name)
target_obj <- loadRData(opt$xset_path, c('xset', 'xa', 'xdata'))

if (opt$camera_xcms == "camera") {
xset <- target_obj@xcmsSet
Expand Down
6 changes: 1 addition & 5 deletions tools/msPurity/purityX.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
--xgroups='$xgroups.xgroups_value'
#end if
--camera_xcms=$camera_xcms
#if $camera_xcms == "camera"
--rdata_name=xa
#else
--rdata_name=xset
#end if
--iwNorm=$iw_norm
--ilim=$ilim
#if $isotopes.isotopes == "exclude_default"
Expand Down

0 comments on commit f10386d

Please sign in to comment.