Skip to content

Commit

Permalink
refactor function names in R/tree.R
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyCodex committed Oct 7, 2024
1 parent 94369a2 commit 96d0ddf
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ export(cleanup_species)
export(combine_files)
export(combine_full)
export(combine_ipr)
export(convertAlignment2Trees)
export(convertFA2Tree)
export(convert_aln2fa)
export(convert_fa2tre)
export(count_bycol)
export(count_to_sunburst)
export(count_to_treemap)
export(createFA2Tree)
export(create_all_col_params)
export(create_lineage_lookup)
export(create_one_col_params)
Expand All @@ -42,9 +44,7 @@ export(find_top_acc)
export(format_job_args)
export(gc_undirected_network)
export(generate_all_aln2fa)
export(generate_fa2tre)
export(generate_msa)
export(generate_trees)
export(get_accnums_from_fasta_file)
export(get_job_message)
export(get_proc_medians)
Expand Down
16 changes: 8 additions & 8 deletions R/tree.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Generating Phylogenetic Trees from Alignment Fasta files
## Includes the following functions:
## generate_trees, convert_fa2tre, generate_fa2tre
## convertAlignment2Trees, convertFA2Tree, createFA2Tree
## Modified: Jan, 2020
## Janani Ravi (@jananiravi), Molecular Ecologist (@molecologist)

Expand Down Expand Up @@ -35,7 +35,7 @@
## Approach 0 | FastTree2.0
###########################
## !! FastTree will only work if there are unique sequence names!!
#' convert_fa2tre
#' convertFA2Tree
#'
#' @param fa_path
#' @param tre_path
Expand All @@ -45,7 +45,7 @@
#' @export
#'
#' @examples
convert_fa2tre <- function(fa_path = here("data/alns/pspa_snf7.fa"),
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")
Expand All @@ -67,7 +67,7 @@ convert_fa2tre <- function(fa_path = here("data/alns/pspa_snf7.fa"),
# here("src/FastTree.c"), "-lm", collapse=" "))
}
## Generate Trees for ALL fasta files in "data/alns"
#' generate_trees
#' convertAlignment2Trees
#'
#' @description
#' Generate Trees for ALL fasta files in "data/alns"
Expand All @@ -82,7 +82,7 @@ convert_fa2tre <- function(fa_path = here("data/alns/pspa_snf7.fa"),
#' @export
#'
#' @examples
generate_trees <- function(aln_path = here("data/alns/")) {
convertAlignment2Trees <- function(aln_path = here("data/alns/")) {
# finding all fasta alignment files
fa_filenames <- list.files(path = aln_path, pattern = "*.fa")
fa_paths <- paste0(aln_path, fa_filenames)
Expand All @@ -96,15 +96,15 @@ generate_trees <- function(aln_path = here("data/alns/")) {
tre_path = paste0(aln_path, variable, ".tre")
)
pmap(
.l = fa2tre_args, .f = convert_fa2tre,
.l = fa2tre_args, .f = convertFA2Tree,
fasttree_path = here("src/FastTree")
)
}

##############################
## REFS: 1-4
############
#' generate_fa2tre
#' createFA2Tree
#'
#' @author Janani Ravi, MolEcologist
#' @keywords phylogenetic tree, alignment, fasta
Expand Down Expand Up @@ -134,7 +134,7 @@ generate_trees <- function(aln_path = here("data/alns/")) {
#' \dontrun{
#' generate_aln2tree("pspa_snf7.fa")
#' }
generate_fa2tre <- function(fa_file = "data/alns/pspa_snf7.fa",
createFA2Tree <- function(fa_file = "data/alns/pspa_snf7.fa",
out_file = "data/alns/pspa_snf7.tre") {
## SAMPLE ARGS
# fa_file="data/alns/pspa_snf7.fa"
Expand Down
8 changes: 4 additions & 4 deletions man/generate_trees.Rd → man/convertAlignment2Trees.Rd

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

10 changes: 5 additions & 5 deletions man/convert_fa2tre.Rd → man/convertFA2Tree.Rd

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

8 changes: 4 additions & 4 deletions man/generate_fa2tre.Rd → man/createFA2Tree.Rd

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

0 comments on commit 96d0ddf

Please sign in to comment.