-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from margotbligh/dev
Dev
- Loading branch information
Showing
33 changed files
with
12,752 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
on: | ||
push: | ||
branches: [main, master] | ||
pull_request: | ||
branches: [main, master] | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
name: pkgdown | ||
|
||
jobs: | ||
pkgdown: | ||
runs-on: ubuntu-latest | ||
# Only restrict concurrency for non-PR jobs | ||
concurrency: | ||
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::pkgdown, local::. | ||
needs: website | ||
|
||
- name: Build site | ||
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) | ||
shell: Rscript {0} | ||
|
||
- name: Deploy to GitHub pages 🚀 | ||
if: github.event_name != 'pull_request' | ||
uses: JamesIves/github-pages-deploy-action@v4.4.1 | ||
with: | ||
clean: false | ||
branch: gh-pages | ||
folder: docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#' MS/MS Spectra Extraction from annotated features | ||
#' | ||
#' @description This function extracts MS/MS spectra associated with | ||
#' features annotated by \link[GlycoAnnotateR]{glycoAnnotate} function. | ||
|
||
#' @param data_ms2 [MSnbase::MSnExp()], [MSnbase::OnDiskMSnExp()] or [xcms::XCMSnExp()] | ||
#' object with MS/MS spectra. | ||
#' @param data_features [xcms::XCMSnExp()] with MS1 features defined by XCMS processing | ||
#' that were annotated by \link[GlycoAnnotateR]{glycoAnnotate}. | ||
#' @param annotations Output of \link[GlycoAnnotateR]{glycoAnnotate}. It needs to be a | ||
#' `data.frame` with numerical columns named "mz" and "rt" (mz columns contains *m/z* | ||
#' of the features, not of the annotations!). | ||
#' | ||
#' @return It returns a MSpectra object with all msLevel=2 spectra whose | ||
#' precursors are the features annotated by \link[GlycoAnnotateR]{glycoAnnotate} function. | ||
#' | ||
#' @export | ||
#' | ||
#' @seealso [GlycoAnnotateR::glycoPredict()] | ||
#' @seealso [GlycoAnnotateR::glycoPredictParam()] | ||
#' | ||
|
||
glycoMS2Extract = function(data_ms2, data_features, annotations){ | ||
|
||
# Check if "data_ms2" has msLevel = 2 spectra. | ||
if(any(table(data_ms2@featureData@data$msLevel, data_ms2@featureData@data$fileIdx)[2,]==0)){ | ||
stop("Error: Some of the files do not have MS level 2 data.") | ||
} | ||
|
||
# Change "data_ms2" into "XCMSnExp" | ||
data_ms2 = as(data_ms2, "XCMSnExp") | ||
|
||
# Overwrite "data_ms2" peaks and features for the ones in "data_features" | ||
chromPeaks(data_ms2) = xcms::chromPeaks(data_features) | ||
featureDefinition = xcms::featureDefinitions(data_features) | ||
featureDefinition_filtered = featureDefinition[paste0(featureDefinition$mzmed,"_", featureDefinition$rtmed) %in% | ||
paste0(annotations$mz,"_",annotations$rt),] | ||
|
||
featureDefinitions(data_ms2) = featureDefinition_filtered | ||
|
||
# Get msLevel=2 spectra that is related to defined features. | ||
MS2Spectra = xcms::featureSpectra(data_ms2, msLevel = 2, expandMz = 0.005) | ||
|
||
return(MS2Spectra) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
url: https://margotbligh.github.io/GlycoAnnotateR/ | ||
template: | ||
bootstrap: 5 | ||
|
Oops, something went wrong.