Skip to content

Commit

Permalink
pRolocmarker versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
lgatto committed Oct 9, 2024
1 parent ad9af3a commit 5ec5574
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 34 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: pRoloc
Type: Package
Title: A unifying bioinformatics framework for spatial proteomics
Version: 1.45.1
Version: 1.45.2
Authors@R: c(person(given = "Laurent", family = "Gatto",
email = "[email protected]",
role = c("aut","cre")),
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# pRoloc 1.45

## Changes in version 1.45.2

- `pRolocmarkers()` has a new `version` argument, to allow for new
markers versions to be added.

## Changes in version 1.45.1

- Import 'mclust::estep*()'.
Expand Down
71 changes: 38 additions & 33 deletions R/pRolocmarkers.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,53 @@
## data is in inst/extdata/marker_species.rda


##' This function retrieves a list of organelle markers or, if no
##' \code{species} is provided, prints a description of available
##' marker sets. The markers can be added to and \code{MSnSet} using
##' the \code{\link{addMarkers}} function.
##'
##' The markers have been contributed by various members of the
##' Cambridge Centre for Proteomics, in particular Dr Dan Nightingale
##' for yeast, Dr Andy Christoforou and Dr Claire Mulvey for human, Dr
##' Arnoud Groen for Arabodopsis and Dr Claire Mulvey for mouse. In
##' addition, original (curated) markers from the \code{pRolocdata}
##' datasets have been extracted (see \code{pRolocdata} for details
##' and references). Curation involved verification of publicly
##' available subcellular localisation annotation based on the
##' curators knowledge of the organelles/proteins considered and
##' tracing the original statement in the literature.
##'
##' These markers are provided as a starting point to generate
##' reliable sets of organelle markers but still need to be verified
##' against any new data in the light of the quantitative data and the
##' study conditions.
##'
##' This function retrieves a list of organelle markers or, if no \code{species}
##' is provided, prints a description of available marker sets. The markers can
##' be added to and \code{MSnSet} using the \code{\link{addMarkers}} function.
##'
##' The markers have been contributed by various members of the Cambridge Centre
##' for Proteomics, in particular Dr Dan Nightingale for yeast, Dr Andy
##' Christoforou and Dr Claire Mulvey for human, Dr Arnoud Groen for Arabodopsis
##' and Dr Claire Mulvey for mouse. In addition, original (curated) markers from
##' the \code{pRolocdata} datasets have been extracted (see \code{pRolocdata}
##' for details and references). Curation involved verification of publicly
##' available subcellular localisation annotation based on the curators
##' knowledge of the organelles/proteins considered and tracing the original
##' statement in the literature.
##'
##' These markers are provided as a starting point to generate reliable sets of
##' organelle markers but still need to be verified against any new data in the
##' light of the quantitative data and the study conditions.
##'
##' @title Organelle markers
##' @param species The species of interest.
##' @return Prints a description of the available marker lists if
##' \code{species} is missing or a named character with organelle
##' markers.
##'
##' @param species `character(1)` defining the species of interest.
##'
##' @param version `character(1)` defining the marker version.
##'
##' @return Prints a description of the available marker lists if \code{species}
##' is missing or a named character with organelle markers.
##'
##' @author Laurent Gatto
##' @seealso \code{\link{addMarkers}} to add markers to an
##' \code{MSnSet} and \code{\link{markers}} for more information about
##' marker encoding.
##'
##' @seealso \code{\link{addMarkers}} to add markers to an \code{MSnSet} and
##' \code{\link{markers}} for more information about marker encoding.
##'
##' @examples
##' pRolocmarkers()
##' table(pRolocmarkers("atha"))
##' table(pRolocmarkers("hsap"))
pRolocmarkers <- function(species) {
pRolocmarkers <- function(species, version = "1") {
prefix <- switch(as.character(version),
"1" = "marker_")
fls <- dir(system.file("extdata", package = "pRoloc"),
full.names = TRUE, pattern = "marker_")
full.names = TRUE, pattern = prefix)
if (missing(species)) {
cat(length(fls), "marker lists available:\n")
cat(length(fls), " marker lists (version ", version, ") available:\n",
sep = "")
for (f in fls) {
m <- readRDS(f)
x <- sub(".rds", "", sub("^.+marker_", "", f))
x <- sub(".rds", "", sub(prefix, "", basename(f)))
cat(m$species, " [", x, "]:\n", sep = "")
cat(" Ids: ", m$ids, ", ", length(m$markers),
" markers\n", sep = "")
Expand All @@ -52,7 +57,7 @@ pRolocmarkers <- function(species) {
if (species == "scer")
species <- "scer_uniprot"
species <- tolower(species)
x <- sub(".rds", "", sub("^.+marker_", "", fls))
x <- sub(".rds", "", sub(prefix, "", basename(fls)))
k <- match(species, x)
if (is.na(k))
stop("Available species: ", paste(x, collapse = ", "),
Expand Down

0 comments on commit 5ec5574

Please sign in to comment.