Skip to content

Commit

Permalink
deprecate search_datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
oganm committed Aug 26, 2023
1 parent ba4cda5 commit 8923206
Show file tree
Hide file tree
Showing 2 changed files with 183 additions and 2 deletions.
77 changes: 75 additions & 2 deletions R/deprecation.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ get_taxon_datasets <- function(taxon,
raw = getOption("gemma.raw",FALSE),
memoised = getOption("gemma.memoised", FALSE),
file = getOption("gemma.file",NA_character_),
overwrite = getOption("gemma.overwrite",FALSE)){
warning('get_taxon_datasets is deprecated, please use get_datasets instead')
overwrite = getOption("gemma.overwrite",FALSE),...){
warning('get_taxon_datasets is deprecated. please use get_datasets instead')

get_datasets(taxa = taxon,
offset = offset,
Expand All @@ -102,3 +102,76 @@ get_taxon_datasets <- function(taxon,
file = file,
overwrite = overwrite)
}


#' Retrieve datasets associated to an annotation tags search
#'
#' This function is deprecated in favor of \code{\link{get_datasets}}
#'
#' @param query The search query. Either plain text ('traumatic'), or an ontology term URI ('http://purl.obolibrary.org/obo/UBERON_0002048'). Datasets that contain the given string in their short
#' or full name will also be matched. Can be multiple identifiers separated by commas.
#' @param taxon Can either be Taxon ID, Taxon NCBI ID, or one of its string identifiers: scientific name, common name.
#' It is recommended to use Taxon ID for efficiency.
#' Please note, that not all taxa have all the possible identifiers available.
#' Use the \code{\link{get_taxa_by_ids}} function to retrieve the necessary information. For convenience, below is a list of officially supported taxa:
#' \tabular{rllr}{
#' \strong{ID} \tab \strong{Comm.name} \tab \strong{Scient.name} \tab \strong{NcbiID}\cr
#' 1 \tab human \tab Homo sapiens \tab 9606 \cr
#' 2 \tab mouse \tab Mus musculus \tab 10090 \cr
#' 3 \tab rat \tab Rattus norvegicus \tab 10116 \cr
#' 11 \tab yeast \tab Saccharomyces cerevisiae \tab 4932 \cr
#' 12 \tab zebrafish \tab Danio rerio \tab 7955 \cr
#' 13 \tab fly \tab Drosophila melanogaster \tab 7227 \cr
#' 14 \tab worm \tab Caenorhabditis elegans \tab 6239
#' }
#' @param offset The offset of the first retrieved result.
#' @param limit Optional, defaults to 20. Limits the result to specified amount
#' of objects. Has a maximum value of 100. Use together with \code{offset} and
#' the \code{totalElements} \link[base:attributes]{attribute} in the output to
#' compile all data if needed.
#' @param sort Order results by the given property and direction. The '+' sign indicate ascending order whereas the '-' indicate descending.
#' @param raw \code{TRUE} to receive results as-is from Gemma, or \code{FALSE} to enable
#' parsing. Raw results usually contain additional fields and flags that are
#' omitted in the parsed results.
#' @param memoised Whether or not to save to cache for future calls with the
#' same inputs and use the result saved in cache if a result is already saved.
#' Doing \code{options(gemma.memoised = TRUE)} will ensure that the cache is always
#' used. Use \code{\link{forget_gemma_memoised}} to clear the cache.
#' @param file The name of a file to save the results to, or \code{NULL} to not write
#' results to a file. If \code{raw == TRUE}, the output will be a JSON file. Otherwise,
#' it will be a RDS file.
#' @param overwrite Whether or not to overwrite if a file exists at the specified
#' filename.
#' @param attributes If \code{TRUE} additional information from the call will be added
#' into the output object's attributes such as offset and available elements.
#'
#' @inherit processDatasets return
#' @export
#'
#'
#' @examples
#' search_datasets("bipolar", taxon = "human")
search_datasets <- function(query, taxon = NA_character_,
offset = 0L,
limit = 20L,
sort = "+id",
raw = getOption("gemma.raw", FALSE), memoised = getOption(
"gemma.memoised",
FALSE
),
file = getOption("gemma.file", NA_character_),
overwrite = getOption("gemma.overwrite", FALSE), attributes = getOption(
"gemma.attributes",
TRUE
),...){
warning("search_datasets is deprecated. please use get_datasets instead")

get_datasets(query = query,
taxa = taxon,
limit = limit,
sort = sort,
offset = offset,
raw = raw,
file = file,
overwrite = overwrite)
}
108 changes: 108 additions & 0 deletions man/search_datasets.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8923206

Please sign in to comment.