Skip to content

Instantly share code, notes, and snippets.

@lgatto
Last active July 24, 2024 06:11
Show Gist options
  • Save lgatto/b1875458ed4e478ff6e87ce3b346352e to your computer and use it in GitHub Desktop.
Save lgatto/b1875458ed4e478ff6e87ce3b346352e to your computer and use it in GitHub Desktop.
RforMassSpectrometry book installation script
## Installation instructions for the R for Mass Spectrometry tutorial
## https://rformassspectrometry.github.io/book/
## Install packages
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("tidyverse", ask = FALSE)
BiocManager::install("factoextra", ask = FALSE)
BiocManager::install("msdata", ask = FALSE)
BiocManager::install("mzR", ask = FALSE)
BiocManager::install("rhdf5", ask = FALSE)
BiocManager::install("rpx", ask = FALSE)
BiocManager::install("MsCoreUtils", ask = FALSE)
BiocManager::install("QFeatures", ask = FALSE)
BiocManager::install("Spectra", ask = FALSE)
BiocManager::install("ProtGenerics", ask = FALSE)
BiocManager::install("PSMatch", ask = FALSE)
BiocManager::install("pheatmap", ask = FALSE)
BiocManager::install("limma", ask = FALSE)
BiocManager::install("MSnID", ask = FALSE)
BiocManager::install("impute", ask = FALSE)
BiocManager::install("RforMassSpectrometry/SpectraVis", ask = FALSE)
## Download data
library(rpx)
px <- PXDataset("PXD000001") ## answer yes if asked to create a cache directory
fn <- "TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01-20141210.mzML"
mzf <- pxget(px, fn)
px <- PXDataset("PXD022816")
pxget(px, grep("mzID", pxfiles(px))[1:3])
pxget(px, grep("mzML", pxfiles(px))[1:3])
@gith0
Copy link

gith0 commented Jul 24, 2024

Hello,
When I run the code above I get the following error message:

library(rpx)
px <- PXDataset("PXD000001") ## answer yes if asked to create a cache directory
Loading PXD000001 from cache.
fn <- "TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01-20141210.mzML"
mzf <- pxget(px, fn)
Error in .local(object, ...) : No files to download.

When I looked into it and ran pxfiles(px), I get:

pxfiles(px)
Project PXD000001 files (2):
[remote] PRIDE_Exp_Complete_Ac_22134.pride.mgf.gz
[remote] PRIDE_Exp_Complete_Ac_22134.pride.mztab.gz

It states that there are only 2 files in PXD000001 instead of the 11 files stated In the R for Mass Spectrometry course. Unfortunately, the file(s) that are used in the course are not in PXD000001.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment