R/deprecate.R

Defines functions mgnify_retrieve_json mgnify_get_analyses_metadata mgnify_get_analyses_phyloseq mgnify_get_analyses_results mgnify_download mgnify_get_download_urls mgnify_analyses_from_studies mgnify_analyses_from_samples mgnify_query mgnify_client

Documented in mgnify_analyses_from_samples mgnify_analyses_from_studies mgnify_client mgnify_download mgnify_get_analyses_metadata mgnify_get_analyses_phyloseq mgnify_get_analyses_results mgnify_get_download_urls mgnify_query mgnify_retrieve_json

#' These functions will be deprecated. Please use other functions instead.
#'
#' @param url -
#'
#' @param username -
#'
#' @param password -
#'
#' @param usecache -
#'
#' @param cache_dir -
#'
#' @param warnings -
#'
#' @param use_memcache -
#'
#' @param client -
#'
#' @param qtype -
#'
#' @param accession -
#'
#' @param asDataFrame -
#'
#' @param maxhits -
#'
#' @param ... -
#'
#' @param accessions -
#'
#' @param accession_type -
#'
#' @param file -
#'
#' @param read_func -
#'
#' @param Debug -
#'
#' @param retrievelist -
#'
#' @param compact_results -
#'
#' @param bulk_dl -
#'
#' @param returnLists -
#'
#' @param tax_SU -
#'
#' @param get_tree -
#'
#' @param path -
#'
#' @param complete_url -
#'
#' @param qopts -
#' 
#' @return -
#' 
#' @name deprecate
NULL

#' @rdname deprecate
#' @export
mgnify_client <- function(
        username = NULL, password = NULL, usecache = FALSE,
        cache_dir = NULL, warnings = FALSE, use_memcache = FALSE, ...){
    .Deprecated("MgnifyClient")
    MgnifyClient(
        username = username, password = password,
        useCache = usecache, cacheDir = cache_dir, warnings = warnings,
        use.mem.cache = use_memcache, ...)
}

#' @rdname deprecate
#' @export
mgnify_query <- function(
        client, qtype = "samples", accession = NULL, asDataFrame = TRUE,
        maxhits = 200, usecache = FALSE, ...){
    .Deprecated("doQuery")
    doQuery(
        x = client, type = qtype, accession = accession,
        as.df = asDataFrame, max.hits = maxhits, usecache = usecache, ...)
}

#' @rdname deprecate
#' @export
mgnify_analyses_from_samples <- function(
        client, accession, usecache = TRUE, ...){
    .Deprecated("searchAnalysis")
    searchAnalysis(
        x = client, type = "samples", accession = accession,
        use.cache = usecache, ...)
}

#' @rdname deprecate
#' @export
mgnify_analyses_from_studies <- function(
        client, accession, usecache = TRUE, ...){
    .Deprecated("searchAnalysis")
    searchAnalysis(
        x = client, type = "studies", accession = accession,
        use.cache = usecache, ...)
}

#' @rdname deprecate
#' @export
mgnify_get_download_urls <- function(
        client, accessions, accession_type, usecache = TRUE, ...){
    .Deprecated("searchFile")
    searchFile(
        x = client, accession = accessions, type = accession_type,
        use.cache = usecache, ...)
}

#' @rdname deprecate
#' @export
mgnify_download <- function(
        client, url, file = NULL, read_func = NULL, usecache = TRUE,
        Debug = FALSE, ...){
    .Deprecated("getFile")
    getFile(
        x = client, url = url, file = file,
        read.func = read_func, use.cache = usecache, ...)
}

#' @rdname deprecate
#' @export
mgnify_get_analyses_results <- function(
        client  = NULL, accessions, retrievelist = c(), compact_results = TRUE,
        usecache = TRUE, bulk_dl = FALSE, ...){
    .Deprecated("getResult")
    if( length(retrievelist) == 0 ){
        retrievelist <- FALSE
    }
    getResult(
        x = client, accession = accessions, get.taxa = FALSE,
        get.func = retrievelist, output = "list", usecache = TRUE,
        as.df = compact_results, ...)
}

#' @rdname deprecate
#' @export
mgnify_get_analyses_phyloseq <- function(
        client = NULL, accessions, usecache = TRUE, returnLists = FALSE,
        tax_SU = "SSU", get_tree = FALSE, ...){
    .Deprecated("getResult")
    output <- ifelse(returnLists, "list", "phyloseq")
    getResult(
        x = client, accession = accessions, get.taxa = TRUE, get.func = FALSE,
        output = output, use.cache = usecache, tax.su = tax_SU,
        get.tree = get_tree, ...
    )
}

#' @rdname deprecate
#' @export
mgnify_get_analyses_metadata <- function(
        client, accessions, usecache = TRUE, ...){
    .Deprecated("getMetadata")
    getMetadata(x = client, accession = accessions, usecache = usecache, ...)
}

#' @rdname deprecate
#' @export
mgnify_retrieve_json <- function(
        client, path = "biomes", complete_url = NULL, qopts = NULL,
        maxhits = 200, usecache = FALSE, Debug = FALSE, ...){
    .Deprecated(msg = "'mgnify_retrieve_json' is deprecated.\n",
                "See other functions and use them instead.\n",
                "See help('Deprecated')")
    return(NULL)
}
beadyallen/MGnifyR documentation built on Nov. 3, 2024, 4:23 p.m.