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

Made changes in assign_job_queue.R, cleanup.R, lineage.R, msa.R, tree.R #106

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions R/assign_job_queue.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions R/globals.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# File to put all data.table variables that aren't defined otherwise

#' @importFrom utils globalVariables
utils::globalVariables(c("Protein"))
2 changes: 1 addition & 1 deletion R/lineage.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion R/msa.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
#'
Expand Down
5 changes: 1 addition & 4 deletions R/tree.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
convertFA2Tree <- function(fa_path = here("data/alns/pspa_snf7.fa"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these default/example files don't exist, we could remove them. Otherwise, placeholders that work might be a good idea!

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)) {
Expand Down Expand Up @@ -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 = " "
)
)
Expand Down
Loading