Skip to content

Commit

Permalink
* replaced stackr::ref_alt_allelesto stackr::change_alleles.
Browse files Browse the repository at this point in the history
* replaced `stackr::read_long_tidy_wide` to `stackr::tidy_wide`
  • Loading branch information
thierrygosselin committed Nov 26, 2016
1 parent 0a3bf84 commit b92c38c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
8 changes: 4 additions & 4 deletions R/fst_NEI87.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#' @param data A file in the working directory or object in the global environment
#' in wide or long (tidy) formats. To import, the function uses internally
#' \href{https://github.com/thierrygosselin/stackr}{stackr}
#' \code{\link[stackr]{read_long_tidy_wide}}. See details for more info.
#' \code{\link[stackr]{tidy_wide}}. See details for more info.
#'
#' \emph{How to get a tidy data frame ?}
#' \href{https://github.com/thierrygosselin/stackr}{stackr}
Expand Down Expand Up @@ -129,7 +129,7 @@
#' @details \strong{Input data:}
#'
#' To discriminate the long from the wide format,
#' the function \pkg{stackr} \code{\link[stackr]{read_long_tidy_wide}} searches
#' the function \pkg{stackr} \code{\link[stackr]{tidy_wide}} searches
#' for \code{MARKERS or LOCUS} in column names (TRUE = long format).
#' The data frame is tab delimitted.

Expand Down Expand Up @@ -158,7 +158,7 @@
#' @rdname fst_NEI87
#' @import parallel
#' @importFrom dplyr select distinct n_distinct group_by ungroup rename arrange tally filter if_else mutate summarise left_join inner_join right_join anti_join semi_join full_join summarise_each_ funs summarise_if mutate_if count bind_rows bind_cols ntile desc n
#' @importFrom stackr read_long_tidy_wide change_pop_names
#' @importFrom stackr tidy_wide change_pop_names
#' @importFrom tidyr spread gather unite separate complete nesting
#' @importFrom stringi stri_replace_all_regex stri_sub stri_join
#' @importFrom purrr map
Expand Down Expand Up @@ -256,7 +256,7 @@ fst_NEI87 <- function(

# Import data ---------------------------------------------------------------
if (verbose) message("Importing data")
input <- stackr::read_long_tidy_wide(data = data)
input <- stackr::tidy_wide(data = data)

# Change individuals names containing special character
input$INDIVIDUALS <- stringi::stri_replace_all_fixed(
Expand Down
8 changes: 4 additions & 4 deletions R/fst_WC84.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#' @param data A file in the working directory or object in the global environment
#' in wide or long (tidy) formats. To import, the function uses internally
#' \href{https://github.com/thierrygosselin/stackr}{stackr}
#' \code{\link[stackr]{read_long_tidy_wide}}. See details for more info.
#' \code{\link[stackr]{tidy_wide}}. See details for more info.
#'
#' \emph{How to get a tidy data frame ?}
#' \href{https://github.com/thierrygosselin/stackr}{stackr}
Expand Down Expand Up @@ -137,7 +137,7 @@
#' @details \strong{Input data:}
#'
#' To discriminate the long from the wide format,
#' the function \pkg{stackr} \code{\link[stackr]{read_long_tidy_wide}} searches
#' the function \pkg{stackr} \code{\link[stackr]{tidy_wide}} searches
#' for \code{MARKERS or LOCUS} in column names (TRUE = long format).
#' The data frame is tab delimitted.

Expand Down Expand Up @@ -166,7 +166,7 @@
#' @rdname fst_WC84
#' @import parallel
#' @import ggplot2
#' @importFrom stackr read_long_tidy_wide discard_monomorphic_markers keep_common_markers change_pop_names detect_biallelic_markers
#' @importFrom stackr tidy_wide discard_monomorphic_markers keep_common_markers change_pop_names detect_biallelic_markers
#' @importFrom tidyr separate gather spread unite
#' @importFrom purrr map flatten
#' @importFrom dplyr mutate summarise group_by ungroup select rename full_join left_join anti_join right_join semi_join filter n_distinct distinct arrange sample_n bind_rows bind_cols ntile desc n
Expand Down Expand Up @@ -291,7 +291,7 @@ fst_WC84 <- function(

# Import data ---------------------------------------------------------------
if (verbose) message("Importing data")
input <- stackr::read_long_tidy_wide(data = data, import.metadata = TRUE)
input <- stackr::tidy_wide(data = data, import.metadata = TRUE)

# For long tidy format, switch LOCUS to MARKERS column name, if found MARKERS not found
if (tibble::has_name(input, "LOCUS") && !tibble::has_name(input, "MARKERS")) {
Expand Down
4 changes: 4 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ Danecek P, Auton A, Abecasis G et al. (2011) The variant call format and VCFtool

Foll M, Gaggiotti O (2008) A Genome-Scan Method to Identify Selected Loci Appropriate for Both Dominant and Codominant Markers: A Bayesian Perspective. Genetics, 180, 977–993.

Goudet J.hierfstat, a package for r to compute and test hierarchical F-statistics.
Molecular Ecology Notes.2005; 5: 184-186. doi:10.1111/j.1471-8286.2004.00828.x


Ishwaran H. and Kogalur U.B. (2015). Random Forests for Survival, Regression and Classification (RF-SRC), R package version 1.6.1.

Jombart T (2008) adegenet: a R package for the multivariate analysis of genetic markers. Bioinformatics, 24, 1403–1405.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ Danecek P, Auton A, Abecasis G et al. (2011) The variant call format and VCFtool

Foll M, Gaggiotti O (2008) A Genome-Scan Method to Identify Selected Loci Appropriate for Both Dominant and Codominant Markers: A Bayesian Perspective. Genetics, 180, 977–993.

Goudet J.hierfstat, a package for r to compute and test hierarchical F-statistics. Molecular Ecology Notes.2005; 5: 184-186. <doi:10.1111/j.1471-8286.2004.00828.x>

Ishwaran H. and Kogalur U.B. (2015). Random Forests for Survival, Regression and Classification (RF-SRC), R package version 1.6.1.

Jombart T (2008) adegenet: a R package for the multivariate analysis of genetic markers. Bioinformatics, 24, 1403–1405.
Expand Down

0 comments on commit b92c38c

Please sign in to comment.