Minor changes for clean check

This commit is contained in:
Waldir Leoncio 2021-08-23 14:34:20 +02:00
parent cabb3318dd
commit db760fe899
7 changed files with 22159 additions and 6 deletions

View file

@ -41,4 +41,5 @@ RoxygenNote: 7.1.1
Suggests: Suggests:
testthat (>= 2.1.0) testthat (>= 2.1.0)
Imports: Imports:
methods methods,
ape

View file

@ -50,7 +50,10 @@ export(uigetfile)
export(uiputfile) export(uiputfile)
export(writeMixtureInfo) export(writeMixtureInfo)
import(utils) import(utils)
importFrom(ape,as.DNAbin)
importFrom(ape,read.FASTA)
importFrom(methods,is) importFrom(methods,is)
importFrom(stats,runif) importFrom(stats,runif)
importFrom(stats,sd)
importFrom(utils,read.delim) importFrom(utils,read.delim)
importFrom(utils,write.table) importFrom(utils,write.table)

View file

@ -3,6 +3,7 @@
#' @details For a list of global variables, check the \code{globals.R} file. #' @details For a list of global variables, check the \code{globals.R} file.
#' @param g the global variable in quesiton. #' @param g the global variable in quesiton.
#' @return TRUE if the variable still contains its original values, FALSE otherwise. #' @return TRUE if the variable still contains its original values, FALSE otherwise.
#' @importFrom stats sd
#' @author Waldir Leoncio #' @author Waldir Leoncio
isGlobalEmpty <- function(g) { isGlobalEmpty <- function(g) {
return(sum(g) == 0 & sd(g) == 0) return(sum(g) == 0 & sd(g) == 0)

View file

@ -9,11 +9,12 @@
#' @return A character matrix with filtered SNP data #' @return A character matrix with filtered SNP data
#' #'
#' @examples #' @examples
#' msa <- system.file("extdata", "seqs.fa", package = "rhierbaps") #' msa <- system.file("ext", "seqs.fa", package="rBAPS")
#' snp.matrix <- load_fasta(msa) #' snp.matrix <- load_fasta(msa)
#' #'
#' @author Gerry Tonkin-Hill #' @author Gerry Tonkin-Hill
#' @seealso rhierbaps::load_fasta #' @seealso rhierbaps::load_fasta
#' @importFrom ape read.FASTA as.DNAbin
#' @export #' @export
load_fasta <- function(msa, keep.singletons=FALSE) { load_fasta <- function(msa, keep.singletons=FALSE) {

22145
inst/ext/seqs.fa Normal file

File diff suppressed because it is too large Load diff

View file

@ -19,7 +19,7 @@ Loads a fasta file into matrix format ready for
running the hierBAPS algorithm. running the hierBAPS algorithm.
} }
\examples{ \examples{
msa <- system.file("extdata", "seqs.fa", package = "rhierbaps") msa <- system.file("ext", "seqs.fa", package="rBAPS")
snp.matrix <- load_fasta(msa) snp.matrix <- load_fasta(msa)
} }

View file

@ -2,12 +2,14 @@ context("Auxiliary functions to greedyMix")
# Defining the relative path to current inst ------------- # # Defining the relative path to current inst ------------- #
if (interactive()) { if (interactive()) {
path_inst <- "../../inst/ext/" path_inst <- "../../inst/ext/BAPS_format_clustering_diploid.txt"
} else { } else {
path_inst <- "inst/ext/" path_inst <- system.file(
"ext", "BAPS_format_clustering_diploid.txt", package="rBAPS"
)
} }
baps_diploid <- read.delim( baps_diploid <- read.delim(
file = file.path(path_inst, "BAPS_format_clustering_diploid.txt"), file = path_inst,
sep = " ", sep = " ",
header = FALSE header = FALSE
) )