-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug fix in the compilation results section when not using pop.id.star…
…t and pop.id.end (bug introduced in version 0.2.2)
- Loading branch information
1 parent
ed74974
commit 0cc864a
Showing
7 changed files
with
87 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
Package: assigner | ||
Type: Package | ||
Title: Assignment Analysis with GBS/RADseq Data using R | ||
Version: 0.2.2 | ||
Date: 2016-04-15 | ||
Version: 0.2.3 | ||
Date: 2016-04-23 | ||
Encoding: UTF-8 | ||
Authors@R: c( | ||
person("Thierry", "Gosselin", email = "[email protected]", role = c("aut", "cre"))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Write a dataframe containing all the subsample individual assignment | ||
|
||
#' @name import_subsamples | ||
#' @title Import individual's assignment results of different subsample folder. | ||
#' @description This function will import all the individual's assignment results | ||
#' of different subsample folder into R. | ||
#' @param dir.path The path to the directory containing the subsample folders. | ||
#' @param imputations (logical) Was the data imputed or not. | ||
#' Default: \code{imputations = FALSE} | ||
#' @return A data frame of all the individual's assignment, with iterations and subsample. | ||
|
||
#' @export | ||
#' @rdname import_subsamples | ||
#' @import dplyr | ||
#' @import stringi | ||
|
||
|
||
#' @examples | ||
#' \dontrun{ | ||
#' subsamples.data <- import_subsamples( | ||
#' dir.path = "assignment_analysis_method_random_imputations_rf_populations", | ||
#' imputations = TRUE | ||
#' ) | ||
#' } | ||
|
||
#' @author Thierry Gosselin \email{thierrygosselin@@icloud.com} | ||
|
||
import_subsamples <- function(dir.path, imputations){ | ||
if (missing (dir.path)) stop("dir.path argument missing") | ||
if (missing (imputations)) imputations <- FALSE | ||
|
||
subsample.folders <- list.files(path = dir.path, pattern = "subsample_", full.names = FALSE) | ||
data <- list() | ||
for (i in subsample.folders) { | ||
sub.name <- stri_replace_all_fixed(str = i, pattern = "_", replacement = ".", vectorize_all = FALSE) | ||
if (imputations == TRUE){ | ||
filename <- stri_paste(i, "/","assignment.random.imputed.results.individuals.iterations.", sub.name, ".tsv") | ||
} else { | ||
filename <- stri_paste(i, "/","assignment.random.no.imputation.results.individuals.iterations.", sub.name, ".tsv") | ||
} | ||
subsample.data <- read_tsv(file = filename, col_names = TRUE) #%>% filter (MISSING_DATA == 'no.imputation') | ||
data[[i]] <- subsample.data | ||
} | ||
data <- as_data_frame(bind_rows(data)) | ||
return(data) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.