diff --git a/NAMESPACE b/NAMESPACE index 6ae464f6..3a7b5c03 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -247,6 +247,7 @@ importFrom(shiny,showNotification) importFrom(stats,as.formula) importFrom(stats,complete.cases) importFrom(stats,logLik) +importFrom(stats,median) importFrom(stats,na.omit) importFrom(stringi,stri_extract_all_regex) importFrom(stringi,stri_replace_all_regex) @@ -276,6 +277,7 @@ importFrom(tidyr,replace_na) importFrom(tidyr,separate) importFrom(tidyr,unite) importFrom(utils,combn) +importFrom(utils,globalVariables) importFrom(viridis,scale_fill_viridis) importFrom(visNetwork,visEdges) importFrom(visNetwork,visGroups) diff --git a/R/assign_job_queue.R b/R/assign_job_queue.R index e481f400..9d9b6590 100644 --- a/R/assign_job_queue.R +++ b/R/assign_job_queue.R @@ -92,7 +92,8 @@ mapAdvOption2Process <- function(advanced_opts) { #' #' @importFrom dplyr across everything select summarise #' @importFrom rlang warn abort inform -#' +#' @importFrom stats median +#' #' @return [list] names: processes; values: median runtime (seconds) #' #' see molevol_scripts/R/metrics.R for info on functions called here @@ -210,7 +211,7 @@ writeProcessRuntime2TSV <- function(dir_job_results, filepath) { names_to = "process", values_to = "median_seconds" ) |> - dplyr::arrange(dplyr::desc(median_seconds)) + dplyr::arrange(dplyr::desc(.data$median_seconds)) # Write the resulting tibble to a TSV file readr::write_tsv(df_proc_medians, file = filepath) diff --git a/R/globals.R b/R/globals.R new file mode 100644 index 00000000..76da9d5d --- /dev/null +++ b/R/globals.R @@ -0,0 +1,4 @@ +# File to put all data.table variables that aren't defined otherwise + +#' @importFrom utils globalVariables +utils::globalVariables(c("Protein")) \ No newline at end of file diff --git a/R/lineage.R b/R/lineage.R index 46249c91..fa113654 100644 --- a/R/lineage.R +++ b/R/lineage.R @@ -432,7 +432,7 @@ IPG2Lineage <- function(accessions, ipg_file, lins <- GCA2Lineage(prot_data = ipg_dt, assembly_path, lineagelookup_path) - lins <- lins[!is.na(Lineage)] %>% unique() + lins <- lins[!is.na(.data$Lineage)] %>% unique() return(lins) } diff --git a/R/msa.R b/R/msa.R index 8838fdda..f0ee4b07 100644 --- a/R/msa.R +++ b/R/msa.R @@ -196,7 +196,7 @@ createMSA_PDF <- function(fasta_path, out_path = NULL, #' will be saved. #' #' @importFrom Biostrings readAAStringSet -#' +#' #' @return A list containing the alignment object and the output file path. #' @export #' diff --git a/R/tree.R b/R/tree.R index ddbf9d61..5679de34 100755 --- a/R/tree.R +++ b/R/tree.R @@ -59,9 +59,6 @@ convertFA2Tree <- function(fa_path = here("data/alns/pspa_snf7.fa"), tre_path = here("data/alns/pspa_snf7.tre"), fasttree_path = here("src/FastTree")) { - # fa_path=here("data/alns/pspa_snf7.fa") - # tre_path=here("data/alns/pspa_snf7.tre") - # fasttree_path=here("src/FastTree") # Check if the FASTA file exists if (!file.exists(fa_path)) { @@ -89,7 +86,7 @@ convertFA2Tree <- function(fa_path = here("data/alns/pspa_snf7.fa"), message(fa_path) system2( command = fasttree_path, - args = paste(c(fa_path, ">", tre_path), + args = paste(c(fa_path, ">", .data$tre_path), sep = "", collapse = " " ) )