Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter definitions to acc2lin.R #39

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions R/acc2lin.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,25 @@ sinkReset <- function() {

#' addLineage
#'
#' @param df
#' @param acc_col
#' @param assembly_path
#' @param lineagelookup_path
#' @param ipgout_path
#' @param plan
#' @param df A `data.frame` containing the input data. One column must contain
#' the accession numbers.
#' @param acc_col A string specifying the column name in `df` that holds the
#' accession numbers. Defaults to `"AccNum"`.
#' @param assembly_path A string specifying the path to the `assembly_summary.txt`
#' file. This file contains metadata about assemblies.
#' @param lineagelookup_path A string specifying the path to the lineage lookup
#' file, which contains a mapping from tax IDs to their corresponding lineages.
#' @param ipgout_path (Optional) A string specifying the path where IPG database
#' fetch results will be saved. If `NULL`, the results are not written to a file.
#' @param plan A string specifying the parallelization strategy for the future
#' package, such as `"sequential"` or `"multisession"`.
#'
#' @importFrom dplyr pull
#' @importFrom magrittr %>%
#' @importFrom rlang sym
#'
#' @return Describe return, in detail
#' @return A `data.frame` that combines the original `df` with the lineage
#' information.
#' @export
#'
#' @examples
Expand Down Expand Up @@ -78,9 +85,12 @@ addLineage <- function(df, acc_col = "AccNum", assembly_path,
#' (taxid to lineage mapping). This file can be generated using the
#' @param ipgout_path Path to write the results of the efetch run of the accessions
#' on the ipg database. If NULL, the file will not be written. Defaults to NULL
#' @param plan
#' @param plan A string specifying the parallelization strategy for the future
#' package, such as `"sequential"` or `"multisession"`.
#'
#' @return Describe return, in detail
#' @return A `data.table` that contains the lineage information, mapping protein
#' accessions to their tax IDs and lineages.
#' @export
#' @export
#'
#' @examples
Expand Down Expand Up @@ -112,13 +122,14 @@ acc2Lineage <- function(accessions, assembly_path, lineagelookup_path, ipgout_pa
#' @param accnums Character vector containing the accession numbers to query on
#' the ipg database
#' @param out_path Path to write the efetch results to
#' @param plan
#' @param plan A string specifying the parallelization strategy for the future
#' package, such as `"sequential"` or `"multisession"`.
#'
#' @importFrom furrr future_map
#' @importFrom future plan
#' @importFrom rentrez entrez_fetch
#'
#' @return Describe return, in detail
#' @return No return value. The function writes the fetched results to `out_path`.
#' @export
#'
#' @examples
Expand Down Expand Up @@ -186,7 +197,8 @@ efetchIPG <- function(accnums, out_path, plan = "sequential", ...) {
#'
#' @importFrom data.table fread
#'
#' @return Describe return, in detail
#' @return A `data.table` with the lineage information for the provided protein
#' accessions.
#' @export
#'
#' @examples
Expand Down
3 changes: 2 additions & 1 deletion man/IPG2Lineage.Rd

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

3 changes: 2 additions & 1 deletion man/acc2Lineage.Rd

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

18 changes: 17 additions & 1 deletion man/addLineage.Rd

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

2 changes: 1 addition & 1 deletion man/efetchIPG.Rd

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

Loading