Skip to content

Commit

Permalink
Merge pull request #66 from teddyCodex/issue-54-rename-functions
Browse files Browse the repository at this point in the history
Refactored function names in R/tree.R
- fixes #54
  • Loading branch information
the-mayer authored Oct 8, 2024
2 parents 92e1017 + acd7f8c commit f6b8992
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 @@ -31,11 +31,13 @@ export(combine_ipr)
export(condenseRepeatedDomains)
export(convert2TitleCase)
export(convertAlignment2FA)
export(convertAlignment2Trees)
export(convertFA2Tree)
export(convert_aln2fa)
export(convert_fa2tre)
export(count_bycol)
export(count_to_sunburst)
export(count_to_treemap)
export(createFA2Tree)
export(createWordCloud2Element)
export(createWordCloudElement)
export(create_all_col_params)
Expand All @@ -52,9 +54,7 @@ export(format_job_args)
export(gc_undirected_network)
export(generateAllAlignments2FA)
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 f6b8992

Please sign in to comment.