From b9fca1656ac893b08c5a55c02b4d1be77c718e63 Mon Sep 17 00:00:00 2001 From: Paul Staab Date: Sun, 19 Jan 2020 13:22:40 +0100 Subject: [PATCH] Remove PopGenome --- DESCRIPTION | 6 +- NAMESPACE | 2 - NEWS.md | 8 +++ R/import_popgenome.R | 68 ------------------ man/as.segsites.GENOME.Rd | 31 --------- man/calc_sumstats_from_data.Rd | 9 ++- man/coal_model.Rd | 3 +- man/feat_growth.Rd | 21 +++--- man/feat_ignore_singletons.Rd | 18 ++--- man/feat_migration.Rd | 28 +++++--- man/feat_mutation.Rd | 31 +++++---- man/feat_outgroup.Rd | 19 ++--- man/feat_pop_merge.Rd | 18 ++--- man/feat_recombination.Rd | 18 ++--- man/feat_selection.Rd | 36 ++++++---- man/feat_size_change.Rd | 20 +++--- man/feat_unphased.Rd | 18 ++--- man/get_features.Rd | 3 +- man/locus_trio.Rd | 7 +- man/simulate.coalmodel.Rd | 3 +- man/simulator_ms.Rd | 7 +- man/simulator_msms.Rd | 10 +-- man/simulator_scrm.Rd | 7 +- man/simulator_seqgen.Rd | 6 +- man/sumstat_class.Rd | 118 ++++++++++++++++++++++++++++++-- man/sumstat_dna.Rd | 22 +++--- man/sumstat_file.Rd | 22 +++--- man/sumstat_four_gamete.Rd | 28 +++++--- man/sumstat_ihh.Rd | 31 +++++---- man/sumstat_jsfs.Rd | 30 ++++---- man/sumstat_mcmf.Rd | 31 +++++---- man/sumstat_nucleotide_div.Rd | 26 +++---- man/sumstat_omega.Rd | 32 +++++---- man/sumstat_seg_sites.Rd | 21 +++--- man/sumstat_sfs.Rd | 25 +++---- man/sumstat_tajimas_d.Rd | 28 +++++--- man/sumstat_trees.Rd | 22 +++--- vignettes/coala-data-import.Rmd | 62 ++--------------- 38 files changed, 479 insertions(+), 416 deletions(-) delete mode 100644 R/import_popgenome.R delete mode 100644 man/as.segsites.GENOME.Rd diff --git a/DESCRIPTION b/DESCRIPTION index c98dd78..b395a22 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: coala -Version: 0.5.3 +Version: 0.5.4 License: MIT + file LICENSE Title: A Framework for Coalescent Simulation Authors@R: c( @@ -31,7 +31,6 @@ Imports: Suggests: abc (>= 2.0), knitr, - PopGenome (>= 2.1.0), phyclust (>= 0.1-16), rmarkdown, testthat (>= 0.11.0) @@ -55,7 +54,6 @@ Collate: 'feature_size_change.R' 'feature_sumstats.R' 'feature_unphased.R' - 'import_popgenome.R' 'interface_abc.R' 'locus.R' 'model_build.R' @@ -92,4 +90,4 @@ Collate: 'sumstat_tajimas_d.R' 'sumstat_trees.R' 'tools.R' -RoxygenNote: 6.1.1 +RoxygenNote: 7.0.2 diff --git a/NAMESPACE b/NAMESPACE index 11a9f91..04afbd4 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -3,7 +3,6 @@ S3method("+",coalmodelpart) S3method("[",segsites) S3method(as.matrix,segsites) -S3method(as.segsites,GENOME) S3method(as.segsites,default) S3method(as.segsites,list) S3method(conv_to_ms_arg,default) @@ -151,6 +150,5 @@ importFrom(scrm,scrm) importFrom(stats,rbinom) importFrom(stats,rgamma) importFrom(stats,simulate) -importFrom(utils,capture.output) importFrom(utils,suppressForeignCheck) useDynLib(coala, .registration = TRUE) diff --git a/NEWS.md b/NEWS.md index aa08c58..5985d3e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +coala 0.5.4 +=========== + +* Removes the option to import data import via PopGenome, as PopGenome is not on + CRAN anymore. + + + coala 0.5.3 =========== diff --git a/R/import_popgenome.R b/R/import_popgenome.R deleted file mode 100644 index e0bbd36..0000000 --- a/R/import_popgenome.R +++ /dev/null @@ -1,68 +0,0 @@ -#' Convert PopGenome Data into Coala's Format -#' -#' Using this function, you can convert genetic data imported with the package -#' \pkg{PopGenome} into coala's segsites format. See \code{\link{as.segsites}} -#' for general information on converting genetic data for coala. -#' -#' This function imports all loci from the \code{GENOME} object that have at -#' least one valid site (\code{data@n.valid.sites}). The number of valid sites -#' is used as length of a locus. -#' -#' @param data The \code{GENOME} data from \pkg{PopGenome}. -#' @param only_synonymous Only import synonymous SNPs if set to \code{TRUE}. -#' This requires that \pkg{PopGenome} knows where coding regions are., e.g. -#' by using gff files. -#' @param ... Ignored. -#' @seealso An example and additional instructions are provided in the -#' `coala-data-import` vignette -#' @export -as.segsites.GENOME <- function(data, only_synonymous = FALSE, ...) { #nolint - require_package("PopGenome") - - lapply(which(data@n.valid.sites > 0), function(locus_number) { - bam <- PopGenome::get.biallelic.matrix(data, locus_number) - - if (is.null(bam)) { - warning("Locus ", locus_number, " is NULL") - return(create_empty_segsites(length(unlist(data@populations)) + - length(data@outgroup))) - } - - pops <- which(row.names(bam) %in% unlist(data@populations)) - outgroup <- which(row.names(bam) %in% data@outgroup) - stopifnot(!is.null(pops)) - stopifnot(!is.null(outgroup)) - - # Select relevant data - if (only_synonymous) { - syn <- data@region.data@synonymous[[locus_number]] - if (is.null(syn)) syn <- numeric(0) - syn[is.na(syn)] <- FALSE - seg_sites <- bam[c(pops, outgroup), syn, drop = FALSE] - } else { - seg_sites <- bam[c(pops, outgroup), , drop = FALSE] #nolint - } - stopifnot(!is.null(seg_sites)) - - # Add positions attribute - pos <- as.numeric(colnames(bam)) / data@n.sites[[locus_number]] - create_segsites(seg_sites, pos) - }) -} - - -#' @importFrom utils capture.output -create_popgenome_test_data <- function() { - require_package("PopGenome") - - capture.output({ - fasta <- system.file("example_fasta_files", package = "coala") - data_pg <- PopGenome::readData(fasta, progress_bar_switch = FALSE) - data_pg <- PopGenome::set.outgroup(data_pg, c("Individual_Out-1", - "Individual_Out-2")) - data_pg <- PopGenome::set.populations(data_pg, - list(paste0("Individual_1-", 1:5), - paste0("Individual_2-", 1:5))) - }) - data_pg -} diff --git a/man/as.segsites.GENOME.Rd b/man/as.segsites.GENOME.Rd deleted file mode 100644 index 1798c0b..0000000 --- a/man/as.segsites.GENOME.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/import_popgenome.R -\name{as.segsites.GENOME} -\alias{as.segsites.GENOME} -\title{Convert PopGenome Data into Coala's Format} -\usage{ -\method{as.segsites}{GENOME}(data, only_synonymous = FALSE, ...) -} -\arguments{ -\item{data}{The \code{GENOME} data from \pkg{PopGenome}.} - -\item{only_synonymous}{Only import synonymous SNPs if set to \code{TRUE}. -This requires that \pkg{PopGenome} knows where coding regions are., e.g. -by using gff files.} - -\item{...}{Ignored.} -} -\description{ -Using this function, you can convert genetic data imported with the package -\pkg{PopGenome} into coala's segsites format. See \code{\link{as.segsites}} -for general information on converting genetic data for coala. -} -\details{ -This function imports all loci from the \code{GENOME} object that have at -least one valid site (\code{data@n.valid.sites}). The number of valid sites -is used as length of a locus. -} -\seealso{ -An example and additional instructions are provided in the - `coala-data-import` vignette -} diff --git a/man/calc_sumstats_from_data.Rd b/man/calc_sumstats_from_data.Rd index f01f4c8..913fa86 100644 --- a/man/calc_sumstats_from_data.Rd +++ b/man/calc_sumstats_from_data.Rd @@ -4,8 +4,13 @@ \alias{calc_sumstats_from_data} \title{Calculate summary statistics for biological data} \usage{ -calc_sumstats_from_data(model, segsites_list = NULL, tree_list = NULL, - trios = NULL, ...) +calc_sumstats_from_data( + model, + segsites_list = NULL, + tree_list = NULL, + trios = NULL, + ... +) } \arguments{ \item{model}{The coala model. The summary statistics present in this model diff --git a/man/coal_model.Rd b/man/coal_model.Rd index e862955..3cfb7e4 100644 --- a/man/coal_model.Rd +++ b/man/coal_model.Rd @@ -4,8 +4,7 @@ \alias{coal_model} \title{Create a Coalescent Model} \usage{ -coal_model(sample_size, loci_number = 0, loci_length = 1000, - ploidy = 1) +coal_model(sample_size, loci_number = 0, loci_length = 1000, ploidy = 1) } \arguments{ \item{sample_size}{Defines the number of populations and the number of diff --git a/man/feat_growth.Rd b/man/feat_growth.Rd index 322ce73..5a5dacd 100644 --- a/man/feat_growth.Rd +++ b/man/feat_growth.Rd @@ -4,8 +4,7 @@ \alias{feat_growth} \title{Feature: Exponential population size growth/decline} \usage{ -feat_growth(rate, population = "all", time = "0", - locus_group = "all") +feat_growth(rate, population = "all", time = "0", locus_group = "all") } \arguments{ \item{rate}{The growth rate. Can be a numeric or a \code{\link{parameter}}. @@ -60,13 +59,15 @@ For instantaneous population size For creating a model: \code{\link{coal_model}} -Other features: \code{\link{feat_ignore_singletons}}, - \code{\link{feat_migration}}, - \code{\link{feat_mutation}}, \code{\link{feat_outgroup}}, - \code{\link{feat_pop_merge}}, - \code{\link{feat_recombination}}, - \code{\link{feat_selection}}, - \code{\link{feat_size_change}}, - \code{\link{feat_unphased}} +Other features: +\code{\link{feat_ignore_singletons}()}, +\code{\link{feat_migration}()}, +\code{\link{feat_mutation}()}, +\code{\link{feat_outgroup}()}, +\code{\link{feat_pop_merge}()}, +\code{\link{feat_recombination}()}, +\code{\link{feat_selection}()}, +\code{\link{feat_size_change}()}, +\code{\link{feat_unphased}()} } \concept{features} diff --git a/man/feat_ignore_singletons.Rd b/man/feat_ignore_singletons.Rd index 5f6533b..3c74e76 100644 --- a/man/feat_ignore_singletons.Rd +++ b/man/feat_ignore_singletons.Rd @@ -45,13 +45,15 @@ simulate(model)$n_mut \seealso{ For creating a model: \code{\link{coal_model}} -Other features: \code{\link{feat_growth}}, - \code{\link{feat_migration}}, - \code{\link{feat_mutation}}, \code{\link{feat_outgroup}}, - \code{\link{feat_pop_merge}}, - \code{\link{feat_recombination}}, - \code{\link{feat_selection}}, - \code{\link{feat_size_change}}, - \code{\link{feat_unphased}} +Other features: +\code{\link{feat_growth}()}, +\code{\link{feat_migration}()}, +\code{\link{feat_mutation}()}, +\code{\link{feat_outgroup}()}, +\code{\link{feat_pop_merge}()}, +\code{\link{feat_recombination}()}, +\code{\link{feat_selection}()}, +\code{\link{feat_size_change}()}, +\code{\link{feat_unphased}()} } \concept{features} diff --git a/man/feat_migration.Rd b/man/feat_migration.Rd index 0020198..71b8dec 100644 --- a/man/feat_migration.Rd +++ b/man/feat_migration.Rd @@ -4,8 +4,14 @@ \alias{feat_migration} \title{Feature: Migration/Gene Flow} \usage{ -feat_migration(rate, pop_from = NULL, pop_to = NULL, - symmetric = FALSE, time = "0", locus_group = "all") +feat_migration( + rate, + pop_from = NULL, + pop_to = NULL, + symmetric = FALSE, + time = "0", + locus_group = "all" +) } \arguments{ \item{rate}{The migration rate. Can be a numeric or a @@ -70,13 +76,15 @@ simulate(model) \seealso{ For creating a model: \code{\link{coal_model}} -Other features: \code{\link{feat_growth}}, - \code{\link{feat_ignore_singletons}}, - \code{\link{feat_mutation}}, \code{\link{feat_outgroup}}, - \code{\link{feat_pop_merge}}, - \code{\link{feat_recombination}}, - \code{\link{feat_selection}}, - \code{\link{feat_size_change}}, - \code{\link{feat_unphased}} +Other features: +\code{\link{feat_growth}()}, +\code{\link{feat_ignore_singletons}()}, +\code{\link{feat_mutation}()}, +\code{\link{feat_outgroup}()}, +\code{\link{feat_pop_merge}()}, +\code{\link{feat_recombination}()}, +\code{\link{feat_selection}()}, +\code{\link{feat_size_change}()}, +\code{\link{feat_unphased}()} } \concept{features} diff --git a/man/feat_mutation.Rd b/man/feat_mutation.Rd index 013f4bc..73232c6 100644 --- a/man/feat_mutation.Rd +++ b/man/feat_mutation.Rd @@ -4,9 +4,15 @@ \alias{feat_mutation} \title{Feature: Mutation} \usage{ -feat_mutation(rate, model = "IFS", base_frequencies = NA, - tstv_ratio = NA, gtr_rates = NA, fixed_number = FALSE, - locus_group = "all") +feat_mutation( + rate, + model = "IFS", + base_frequencies = NA, + tstv_ratio = NA, + gtr_rates = NA, + fixed_number = FALSE, + locus_group = "all" +) } \arguments{ \item{rate}{The mutation rate. Can be a numeric or a \code{\link{parameter}}. @@ -126,14 +132,15 @@ For adding recombination: \code{\link{feat_recombination}}. For creating a model: \code{\link{coal_model}} -Other features: \code{\link{feat_growth}}, - \code{\link{feat_ignore_singletons}}, - \code{\link{feat_migration}}, - \code{\link{feat_outgroup}}, - \code{\link{feat_pop_merge}}, - \code{\link{feat_recombination}}, - \code{\link{feat_selection}}, - \code{\link{feat_size_change}}, - \code{\link{feat_unphased}} +Other features: +\code{\link{feat_growth}()}, +\code{\link{feat_ignore_singletons}()}, +\code{\link{feat_migration}()}, +\code{\link{feat_outgroup}()}, +\code{\link{feat_pop_merge}()}, +\code{\link{feat_recombination}()}, +\code{\link{feat_selection}()}, +\code{\link{feat_size_change}()}, +\code{\link{feat_unphased}()} } \concept{features} diff --git a/man/feat_outgroup.Rd b/man/feat_outgroup.Rd index dca0ee3..88c18fb 100644 --- a/man/feat_outgroup.Rd +++ b/man/feat_outgroup.Rd @@ -41,14 +41,15 @@ model <- coal_model(c(4, 6, 1), 2, 10) + \seealso{ For creating a model: \code{\link{coal_model}} -Other features: \code{\link{feat_growth}}, - \code{\link{feat_ignore_singletons}}, - \code{\link{feat_migration}}, - \code{\link{feat_mutation}}, - \code{\link{feat_pop_merge}}, - \code{\link{feat_recombination}}, - \code{\link{feat_selection}}, - \code{\link{feat_size_change}}, - \code{\link{feat_unphased}} +Other features: +\code{\link{feat_growth}()}, +\code{\link{feat_ignore_singletons}()}, +\code{\link{feat_migration}()}, +\code{\link{feat_mutation}()}, +\code{\link{feat_pop_merge}()}, +\code{\link{feat_recombination}()}, +\code{\link{feat_selection}()}, +\code{\link{feat_size_change}()}, +\code{\link{feat_unphased}()} } \concept{features} diff --git a/man/feat_pop_merge.Rd b/man/feat_pop_merge.Rd index fd906c2..95891ba 100644 --- a/man/feat_pop_merge.Rd +++ b/man/feat_pop_merge.Rd @@ -56,13 +56,15 @@ simulate(model_iwm) \seealso{ For creating a model: \code{\link{coal_model}} -Other features: \code{\link{feat_growth}}, - \code{\link{feat_ignore_singletons}}, - \code{\link{feat_migration}}, - \code{\link{feat_mutation}}, \code{\link{feat_outgroup}}, - \code{\link{feat_recombination}}, - \code{\link{feat_selection}}, - \code{\link{feat_size_change}}, - \code{\link{feat_unphased}} +Other features: +\code{\link{feat_growth}()}, +\code{\link{feat_ignore_singletons}()}, +\code{\link{feat_migration}()}, +\code{\link{feat_mutation}()}, +\code{\link{feat_outgroup}()}, +\code{\link{feat_recombination}()}, +\code{\link{feat_selection}()}, +\code{\link{feat_size_change}()}, +\code{\link{feat_unphased}()} } \concept{features} diff --git a/man/feat_recombination.Rd b/man/feat_recombination.Rd index dab8288..4f0d996 100644 --- a/man/feat_recombination.Rd +++ b/man/feat_recombination.Rd @@ -49,13 +49,15 @@ For creating a model: \code{\link{coal_model}} For adding recombination: \code{\link{feat_mutation}}. -Other features: \code{\link{feat_growth}}, - \code{\link{feat_ignore_singletons}}, - \code{\link{feat_migration}}, - \code{\link{feat_mutation}}, \code{\link{feat_outgroup}}, - \code{\link{feat_pop_merge}}, - \code{\link{feat_selection}}, - \code{\link{feat_size_change}}, - \code{\link{feat_unphased}} +Other features: +\code{\link{feat_growth}()}, +\code{\link{feat_ignore_singletons}()}, +\code{\link{feat_migration}()}, +\code{\link{feat_mutation}()}, +\code{\link{feat_outgroup}()}, +\code{\link{feat_pop_merge}()}, +\code{\link{feat_selection}()}, +\code{\link{feat_size_change}()}, +\code{\link{feat_unphased}()} } \concept{features} diff --git a/man/feat_selection.Rd b/man/feat_selection.Rd index 8cda88f..62de53c 100644 --- a/man/feat_selection.Rd +++ b/man/feat_selection.Rd @@ -4,10 +4,20 @@ \alias{feat_selection} \title{Feature: Selection} \usage{ -feat_selection(strength_AA = 0, strength_Aa = 0, strength_aa = 0, - strength_A = NULL, population = "all", time, start = TRUE, - start_frequency = 5e-04, Ne = 10000, position = 0.5, - force_keep = TRUE, locus_group = "all") +feat_selection( + strength_AA = 0, + strength_Aa = 0, + strength_aa = 0, + strength_A = NULL, + population = "all", + time, + start = TRUE, + start_frequency = 5e-04, + Ne = 10000, + position = 0.5, + force_keep = TRUE, + locus_group = "all" +) } \arguments{ \item{strength_AA}{The selection strength for the selected homozygote. @@ -100,13 +110,15 @@ For summary statistics that are sensitive for selection: For creating a model: \code{\link{coal_model}} -Other features: \code{\link{feat_growth}}, - \code{\link{feat_ignore_singletons}}, - \code{\link{feat_migration}}, - \code{\link{feat_mutation}}, \code{\link{feat_outgroup}}, - \code{\link{feat_pop_merge}}, - \code{\link{feat_recombination}}, - \code{\link{feat_size_change}}, - \code{\link{feat_unphased}} +Other features: +\code{\link{feat_growth}()}, +\code{\link{feat_ignore_singletons}()}, +\code{\link{feat_migration}()}, +\code{\link{feat_mutation}()}, +\code{\link{feat_outgroup}()}, +\code{\link{feat_pop_merge}()}, +\code{\link{feat_recombination}()}, +\code{\link{feat_size_change}()}, +\code{\link{feat_unphased}()} } \concept{features} diff --git a/man/feat_size_change.Rd b/man/feat_size_change.Rd index 6662989..fa64663 100644 --- a/man/feat_size_change.Rd +++ b/man/feat_size_change.Rd @@ -4,8 +4,7 @@ \alias{feat_size_change} \title{Feature: Instantaneous Size Change} \usage{ -feat_size_change(new_size, population = 1, time = "0", - locus_group = "all") +feat_size_change(new_size, population = 1, time = "0", locus_group = "all") } \arguments{ \item{new_size}{A \code{\link{parameter}} giving the new size of the @@ -62,12 +61,15 @@ For continuous size changes over time: \code{\link{feat_growth}}. For creating a model: \code{\link{coal_model}} -Other features: \code{\link{feat_growth}}, - \code{\link{feat_ignore_singletons}}, - \code{\link{feat_migration}}, - \code{\link{feat_mutation}}, \code{\link{feat_outgroup}}, - \code{\link{feat_pop_merge}}, - \code{\link{feat_recombination}}, - \code{\link{feat_selection}}, \code{\link{feat_unphased}} +Other features: +\code{\link{feat_growth}()}, +\code{\link{feat_ignore_singletons}()}, +\code{\link{feat_migration}()}, +\code{\link{feat_mutation}()}, +\code{\link{feat_outgroup}()}, +\code{\link{feat_pop_merge}()}, +\code{\link{feat_recombination}()}, +\code{\link{feat_selection}()}, +\code{\link{feat_unphased}()} } \concept{features} diff --git a/man/feat_unphased.Rd b/man/feat_unphased.Rd index bd57a72..3b77d8b 100644 --- a/man/feat_unphased.Rd +++ b/man/feat_unphased.Rd @@ -53,13 +53,15 @@ simulate(model) \seealso{ For creating a model: \code{\link{coal_model}} -Other features: \code{\link{feat_growth}}, - \code{\link{feat_ignore_singletons}}, - \code{\link{feat_migration}}, - \code{\link{feat_mutation}}, \code{\link{feat_outgroup}}, - \code{\link{feat_pop_merge}}, - \code{\link{feat_recombination}}, - \code{\link{feat_selection}}, - \code{\link{feat_size_change}} +Other features: +\code{\link{feat_growth}()}, +\code{\link{feat_ignore_singletons}()}, +\code{\link{feat_migration}()}, +\code{\link{feat_mutation}()}, +\code{\link{feat_outgroup}()}, +\code{\link{feat_pop_merge}()}, +\code{\link{feat_recombination}()}, +\code{\link{feat_selection}()}, +\code{\link{feat_size_change}()} } \concept{features} diff --git a/man/get_features.Rd b/man/get_features.Rd index d752288..630b880 100644 --- a/man/get_features.Rd +++ b/man/get_features.Rd @@ -36,8 +36,7 @@ get_locus_length_matrix(model) get_locus_number(model, group = NA, ignore_variation = FALSE) -get_population_individuals(model, pop, zero_indexed = FALSE, - haploids = TRUE) +get_population_individuals(model, pop, zero_indexed = FALSE, haploids = TRUE) get_summary_statistics(model) } diff --git a/man/locus_trio.Rd b/man/locus_trio.Rd index 35c9361..81bd55c 100644 --- a/man/locus_trio.Rd +++ b/man/locus_trio.Rd @@ -4,8 +4,11 @@ \alias{locus_trio} \title{Locus Trios} \usage{ -locus_trio(locus_length = c(left = 1000, middle = 1000, right = 1000), - distance = c(left_middle = 500, middle_right = 500), number = 1) +locus_trio( + locus_length = c(left = 1000, middle = 1000, right = 1000), + distance = c(left_middle = 500, middle_right = 500), + number = 1 +) } \arguments{ \item{locus_length}{An integer vector of length 3, giving the length of each diff --git a/man/simulate.coalmodel.Rd b/man/simulate.coalmodel.Rd index f7aedf7..a681427 100644 --- a/man/simulate.coalmodel.Rd +++ b/man/simulate.coalmodel.Rd @@ -4,8 +4,7 @@ \alias{simulate.coalmodel} \title{Simulate Data According to a Demographic Model} \usage{ -\method{simulate}{coalmodel}(object, nsim = 1, seed, ..., - pars = numeric(0), cores = 1) +\method{simulate}{coalmodel}(object, nsim = 1, seed, ..., pars = numeric(0), cores = 1) } \arguments{ \item{object}{The coalescent model to be simulated} diff --git a/man/simulator_ms.Rd b/man/simulator_ms.Rd index 4beaf6b..8070ff2 100644 --- a/man/simulator_ms.Rd +++ b/man/simulator_ms.Rd @@ -28,8 +28,9 @@ Bioinformatics (2002) 18 (2): 337-338 doi:10.1093/bioinformatics/18.2.337 } \seealso{ -Other simulators: \code{\link{simulator_msms}}, - \code{\link{simulator_scrm}}, - \code{\link{simulator_seqgen}} +Other simulators: +\code{\link{simulator_msms}}, +\code{\link{simulator_scrm}}, +\code{\link{simulator_seqgen}} } \concept{simulators} diff --git a/man/simulator_msms.Rd b/man/simulator_msms.Rd index c129781..cce6fbe 100644 --- a/man/simulator_msms.Rd +++ b/man/simulator_msms.Rd @@ -5,8 +5,7 @@ \alias{activate_msms} \title{Simulator: msms} \usage{ -activate_msms(jar = NULL, java = NULL, priority = 200, - download = FALSE) +activate_msms(jar = NULL, java = NULL, priority = 200, download = FALSE) } \arguments{ \item{jar}{The path of the msms jar file.} @@ -37,8 +36,9 @@ Bioinformatics (2010) 26 (16): 2064-2065 doi:10.1093/bioinformatics/btq322 } \seealso{ -Other simulators: \code{\link{simulator_ms}}, - \code{\link{simulator_scrm}}, - \code{\link{simulator_seqgen}} +Other simulators: +\code{\link{simulator_ms}}, +\code{\link{simulator_scrm}}, +\code{\link{simulator_seqgen}} } \concept{simulators} diff --git a/man/simulator_scrm.Rd b/man/simulator_scrm.Rd index f4da6a9..4b0f3b8 100644 --- a/man/simulator_scrm.Rd +++ b/man/simulator_scrm.Rd @@ -34,8 +34,9 @@ Bioinformatics, 31(10), pp. 1680-1682. http://dx.doi.org/10.1093/bioinformatics/btu861 } \seealso{ -Other simulators: \code{\link{simulator_msms}}, - \code{\link{simulator_ms}}, - \code{\link{simulator_seqgen}} +Other simulators: +\code{\link{simulator_msms}}, +\code{\link{simulator_ms}}, +\code{\link{simulator_seqgen}} } \concept{simulators} diff --git a/man/simulator_seqgen.Rd b/man/simulator_seqgen.Rd index b0d086b..fbf1740 100644 --- a/man/simulator_seqgen.Rd +++ b/man/simulator_seqgen.Rd @@ -42,7 +42,9 @@ Comput Appl Biosci (1997) 13 (3): 235-238 doi:10.1093/bioinformatics/13.3.235 } \seealso{ -Other simulators: \code{\link{simulator_msms}}, - \code{\link{simulator_ms}}, \code{\link{simulator_scrm}} +Other simulators: +\code{\link{simulator_msms}}, +\code{\link{simulator_ms}}, +\code{\link{simulator_scrm}} } \concept{simulators} diff --git a/man/sumstat_class.Rd b/man/sumstat_class.Rd index 622fe80..4a6c93e 100644 --- a/man/sumstat_class.Rd +++ b/man/sumstat_class.Rd @@ -1,15 +1,123 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/sumstat.R -\docType{data} \name{sumstat_class} \alias{sumstat_class} \title{Base Class for Summary Statistics} -\format{An object of class \code{R6ClassGenerator} of length 24.} -\usage{ -sumstat_class -} \description{ If you want to create additional summary statistics for coala, create \pkg{R6} classes that inherit from this object. } \keyword{internal} +\section{Super class}{ +\code{\link[coala:coalmodelpart]{coala::coalmodelpart}} -> \code{sumstat} +} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-new}{\code{sumstat_class$new()}} +\item \href{#method-calculate}{\code{sumstat_class$calculate()}} +\item \href{#method-check}{\code{sumstat_class$check()}} +\item \href{#method-get_name}{\code{sumstat_class$get_name()}} +\item \href{#method-requires_files}{\code{sumstat_class$requires_files()}} +\item \href{#method-requires_segsites}{\code{sumstat_class$requires_segsites()}} +\item \href{#method-requires_trees}{\code{sumstat_class$requires_trees()}} +\item \href{#method-print}{\code{sumstat_class$print()}} +\item \href{#method-transform}{\code{sumstat_class$transform()}} +\item \href{#method-clone}{\code{sumstat_class$clone()}} +} +} +\if{html}{ +\out{
Inherited methods} +\itemize{ +} +\out{
} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\subsection{Method \code{new()}}{ +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{sumstat_class$new(name, transformation)}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\subsection{Method \code{calculate()}}{ +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{sumstat_class$calculate(seg_sites, trees, files, model)}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\subsection{Method \code{check()}}{ +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{sumstat_class$check(model)}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\subsection{Method \code{get_name()}}{ +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{sumstat_class$get_name()}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\subsection{Method \code{requires_files()}}{ +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{sumstat_class$requires_files()}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\subsection{Method \code{requires_segsites()}}{ +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{sumstat_class$requires_segsites()}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\subsection{Method \code{requires_trees()}}{ +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{sumstat_class$requires_trees()}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\subsection{Method \code{print()}}{ +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{sumstat_class$print()}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\subsection{Method \code{transform()}}{ +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{sumstat_class$transform(x)}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{sumstat_class$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} +} diff --git a/man/sumstat_dna.Rd b/man/sumstat_dna.Rd index 87070e6..cb76148 100644 --- a/man/sumstat_dna.Rd +++ b/man/sumstat_dna.Rd @@ -39,15 +39,17 @@ To create a demographic model: \code{\link{coal_model}} To calculate this statistic from data: \code{\link{calc_sumstats_from_data}} -Other summary statistics: \code{\link{sumstat_file}}, - \code{\link{sumstat_four_gamete}}, - \code{\link{sumstat_ihh}}, \code{\link{sumstat_jsfs}}, - \code{\link{sumstat_mcmf}}, - \code{\link{sumstat_nucleotide_div}}, - \code{\link{sumstat_omega}}, - \code{\link{sumstat_seg_sites}}, - \code{\link{sumstat_sfs}}, - \code{\link{sumstat_tajimas_d}}, - \code{\link{sumstat_trees}} +Other summary statistics: +\code{\link{sumstat_file}()}, +\code{\link{sumstat_four_gamete}()}, +\code{\link{sumstat_ihh}()}, +\code{\link{sumstat_jsfs}()}, +\code{\link{sumstat_mcmf}()}, +\code{\link{sumstat_nucleotide_div}()}, +\code{\link{sumstat_omega}()}, +\code{\link{sumstat_seg_sites}()}, +\code{\link{sumstat_sfs}()}, +\code{\link{sumstat_tajimas_d}()}, +\code{\link{sumstat_trees}()} } \concept{summary statistics} diff --git a/man/sumstat_file.Rd b/man/sumstat_file.Rd index ff99268..657cf1f 100644 --- a/man/sumstat_file.Rd +++ b/man/sumstat_file.Rd @@ -35,15 +35,17 @@ To create a demographic model: \code{\link{coal_model}} To calculate this statistic from data: \code{\link{calc_sumstats_from_data}} -Other summary statistics: \code{\link{sumstat_dna}}, - \code{\link{sumstat_four_gamete}}, - \code{\link{sumstat_ihh}}, \code{\link{sumstat_jsfs}}, - \code{\link{sumstat_mcmf}}, - \code{\link{sumstat_nucleotide_div}}, - \code{\link{sumstat_omega}}, - \code{\link{sumstat_seg_sites}}, - \code{\link{sumstat_sfs}}, - \code{\link{sumstat_tajimas_d}}, - \code{\link{sumstat_trees}} +Other summary statistics: +\code{\link{sumstat_dna}()}, +\code{\link{sumstat_four_gamete}()}, +\code{\link{sumstat_ihh}()}, +\code{\link{sumstat_jsfs}()}, +\code{\link{sumstat_mcmf}()}, +\code{\link{sumstat_nucleotide_div}()}, +\code{\link{sumstat_omega}()}, +\code{\link{sumstat_seg_sites}()}, +\code{\link{sumstat_sfs}()}, +\code{\link{sumstat_tajimas_d}()}, +\code{\link{sumstat_trees}()} } \concept{summary statistics} diff --git a/man/sumstat_four_gamete.Rd b/man/sumstat_four_gamete.Rd index 5ea68aa..2f4e468 100644 --- a/man/sumstat_four_gamete.Rd +++ b/man/sumstat_four_gamete.Rd @@ -4,8 +4,11 @@ \alias{sumstat_four_gamete} \title{Summary Statistic: Four-Gamete-Condition} \usage{ -sumstat_four_gamete(name = "four_gamete", population = 1, - transformation = identity) +sumstat_four_gamete( + name = "four_gamete", + population = 1, + transformation = identity +) } \arguments{ \item{name}{The name of the summary statistic. When simulating a model, @@ -70,14 +73,17 @@ To create a demographic model: \code{\link{coal_model}} To calculate this statistic from data: \code{\link{calc_sumstats_from_data}} -Other summary statistics: \code{\link{sumstat_dna}}, - \code{\link{sumstat_file}}, \code{\link{sumstat_ihh}}, - \code{\link{sumstat_jsfs}}, \code{\link{sumstat_mcmf}}, - \code{\link{sumstat_nucleotide_div}}, - \code{\link{sumstat_omega}}, - \code{\link{sumstat_seg_sites}}, - \code{\link{sumstat_sfs}}, - \code{\link{sumstat_tajimas_d}}, - \code{\link{sumstat_trees}} +Other summary statistics: +\code{\link{sumstat_dna}()}, +\code{\link{sumstat_file}()}, +\code{\link{sumstat_ihh}()}, +\code{\link{sumstat_jsfs}()}, +\code{\link{sumstat_mcmf}()}, +\code{\link{sumstat_nucleotide_div}()}, +\code{\link{sumstat_omega}()}, +\code{\link{sumstat_seg_sites}()}, +\code{\link{sumstat_sfs}()}, +\code{\link{sumstat_tajimas_d}()}, +\code{\link{sumstat_trees}()} } \concept{summary statistics} diff --git a/man/sumstat_ihh.Rd b/man/sumstat_ihh.Rd index ad43529..b1def19 100644 --- a/man/sumstat_ihh.Rd +++ b/man/sumstat_ihh.Rd @@ -4,8 +4,13 @@ \alias{sumstat_ihh} \title{Summary Statistic: Integrated Extended Haplotype Homozygosity} \usage{ -sumstat_ihh(name = "ihh", population = 1, max_snps = 1000, - calc_ihs = FALSE, transformation = identity) +sumstat_ihh( + name = "ihh", + population = 1, + max_snps = 1000, + calc_ihs = FALSE, + transformation = identity +) } \arguments{ \item{name}{The name of the summary statistic. When simulating a model, @@ -80,16 +85,18 @@ To create a demographic model: \code{\link{coal_model}} To calculate this statistic from data: \code{\link{calc_sumstats_from_data}} -Other summary statistics: \code{\link{sumstat_dna}}, - \code{\link{sumstat_file}}, - \code{\link{sumstat_four_gamete}}, - \code{\link{sumstat_jsfs}}, \code{\link{sumstat_mcmf}}, - \code{\link{sumstat_nucleotide_div}}, - \code{\link{sumstat_omega}}, - \code{\link{sumstat_seg_sites}}, - \code{\link{sumstat_sfs}}, - \code{\link{sumstat_tajimas_d}}, - \code{\link{sumstat_trees}} +Other summary statistics: +\code{\link{sumstat_dna}()}, +\code{\link{sumstat_file}()}, +\code{\link{sumstat_four_gamete}()}, +\code{\link{sumstat_jsfs}()}, +\code{\link{sumstat_mcmf}()}, +\code{\link{sumstat_nucleotide_div}()}, +\code{\link{sumstat_omega}()}, +\code{\link{sumstat_seg_sites}()}, +\code{\link{sumstat_sfs}()}, +\code{\link{sumstat_tajimas_d}()}, +\code{\link{sumstat_trees}()} } \author{ Paul Staab diff --git a/man/sumstat_jsfs.Rd b/man/sumstat_jsfs.Rd index 1cdd5d2..e321e14 100644 --- a/man/sumstat_jsfs.Rd +++ b/man/sumstat_jsfs.Rd @@ -4,8 +4,12 @@ \alias{sumstat_jsfs} \title{Summary Statistic: Joint Site Frequency Spectrum} \usage{ -sumstat_jsfs(name = "jsfs", populations = c(1, 2), per_locus = FALSE, - transformation = identity) +sumstat_jsfs( + name = "jsfs", + populations = c(1, 2), + per_locus = FALSE, + transformation = identity +) } \arguments{ \item{name}{The name of the summary statistic. When simulating a model, @@ -46,15 +50,17 @@ To create a demographic model: \code{\link{coal_model}} To calculate this statistic from data: \code{\link{calc_sumstats_from_data}} -Other summary statistics: \code{\link{sumstat_dna}}, - \code{\link{sumstat_file}}, - \code{\link{sumstat_four_gamete}}, - \code{\link{sumstat_ihh}}, \code{\link{sumstat_mcmf}}, - \code{\link{sumstat_nucleotide_div}}, - \code{\link{sumstat_omega}}, - \code{\link{sumstat_seg_sites}}, - \code{\link{sumstat_sfs}}, - \code{\link{sumstat_tajimas_d}}, - \code{\link{sumstat_trees}} +Other summary statistics: +\code{\link{sumstat_dna}()}, +\code{\link{sumstat_file}()}, +\code{\link{sumstat_four_gamete}()}, +\code{\link{sumstat_ihh}()}, +\code{\link{sumstat_mcmf}()}, +\code{\link{sumstat_nucleotide_div}()}, +\code{\link{sumstat_omega}()}, +\code{\link{sumstat_seg_sites}()}, +\code{\link{sumstat_sfs}()}, +\code{\link{sumstat_tajimas_d}()}, +\code{\link{sumstat_trees}()} } \concept{summary statistics} diff --git a/man/sumstat_mcmf.Rd b/man/sumstat_mcmf.Rd index 0eed668..40ceef6 100644 --- a/man/sumstat_mcmf.Rd +++ b/man/sumstat_mcmf.Rd @@ -4,8 +4,13 @@ \alias{sumstat_mcmf} \title{Summary Statistic: Most Common Mutation's Frequency} \usage{ -sumstat_mcmf(name = "mcmf", population = 1, - transformation = identity, expand_mcmf = FALSE, type_expand = 1) +sumstat_mcmf( + name = "mcmf", + population = 1, + transformation = identity, + expand_mcmf = FALSE, + type_expand = 1 +) } \arguments{ \item{name}{The name of the summary statistic. When simulating @@ -61,15 +66,17 @@ To create a demographic model: \code{\link{coal_model}} To calculate this statistic from data: \code{\link{calc_sumstats_from_data}} -Other summary statistics: \code{\link{sumstat_dna}}, - \code{\link{sumstat_file}}, - \code{\link{sumstat_four_gamete}}, - \code{\link{sumstat_ihh}}, \code{\link{sumstat_jsfs}}, - \code{\link{sumstat_nucleotide_div}}, - \code{\link{sumstat_omega}}, - \code{\link{sumstat_seg_sites}}, - \code{\link{sumstat_sfs}}, - \code{\link{sumstat_tajimas_d}}, - \code{\link{sumstat_trees}} +Other summary statistics: +\code{\link{sumstat_dna}()}, +\code{\link{sumstat_file}()}, +\code{\link{sumstat_four_gamete}()}, +\code{\link{sumstat_ihh}()}, +\code{\link{sumstat_jsfs}()}, +\code{\link{sumstat_nucleotide_div}()}, +\code{\link{sumstat_omega}()}, +\code{\link{sumstat_seg_sites}()}, +\code{\link{sumstat_sfs}()}, +\code{\link{sumstat_tajimas_d}()}, +\code{\link{sumstat_trees}()} } \concept{summary statistics} diff --git a/man/sumstat_nucleotide_div.Rd b/man/sumstat_nucleotide_div.Rd index 60290a8..b68d653 100644 --- a/man/sumstat_nucleotide_div.Rd +++ b/man/sumstat_nucleotide_div.Rd @@ -4,8 +4,7 @@ \alias{sumstat_nucleotide_div} \title{Summary Statistic: Nucleotide Diversity} \usage{ -sumstat_nucleotide_div(name = "pi", population = 1, - transformation = identity) +sumstat_nucleotide_div(name = "pi", population = 1, transformation = identity) } \arguments{ \item{name}{The name of the summary statistic. When simulating a model, @@ -32,7 +31,7 @@ mutation rate \eqn{\theta}. \details{ The nucleotide diversity was introduced by -Nei and Li (1979). "Mathematical Model for Studying Genetic Variation in + Nei and Li (1979). "Mathematical Model for Studying Genetic Variation in Terms of Restriction Endonucleases". PNAS 76 (10): 5269-73. doi:10.1073/pnas.76.10.5269. } @@ -48,14 +47,17 @@ To create a demographic model: \code{\link{coal_model}} To calculate this statistic from data: \code{\link{calc_sumstats_from_data}} -Other summary statistics: \code{\link{sumstat_dna}}, - \code{\link{sumstat_file}}, - \code{\link{sumstat_four_gamete}}, - \code{\link{sumstat_ihh}}, \code{\link{sumstat_jsfs}}, - \code{\link{sumstat_mcmf}}, \code{\link{sumstat_omega}}, - \code{\link{sumstat_seg_sites}}, - \code{\link{sumstat_sfs}}, - \code{\link{sumstat_tajimas_d}}, - \code{\link{sumstat_trees}} +Other summary statistics: +\code{\link{sumstat_dna}()}, +\code{\link{sumstat_file}()}, +\code{\link{sumstat_four_gamete}()}, +\code{\link{sumstat_ihh}()}, +\code{\link{sumstat_jsfs}()}, +\code{\link{sumstat_mcmf}()}, +\code{\link{sumstat_omega}()}, +\code{\link{sumstat_seg_sites}()}, +\code{\link{sumstat_sfs}()}, +\code{\link{sumstat_tajimas_d}()}, +\code{\link{sumstat_trees}()} } \concept{summary statistics} diff --git a/man/sumstat_omega.Rd b/man/sumstat_omega.Rd index 6906209..22f563b 100644 --- a/man/sumstat_omega.Rd +++ b/man/sumstat_omega.Rd @@ -4,8 +4,14 @@ \alias{sumstat_omega} \title{Summary Statistic: Omega} \usage{ -sumstat_omega(name = "omega", min_win = 100, max_win = 1000, - grid = 1000, binary = "automatic", transformation = identity) +sumstat_omega( + name = "omega", + min_win = 100, + max_win = 1000, + grid = 1000, + binary = "automatic", + transformation = identity +) } \arguments{ \item{name}{The name of the summary statistic. When simulating a model, @@ -67,15 +73,17 @@ To create a demographic model: \code{\link{coal_model}} To calculate this statistic from data: \code{\link{calc_sumstats_from_data}} -Other summary statistics: \code{\link{sumstat_dna}}, - \code{\link{sumstat_file}}, - \code{\link{sumstat_four_gamete}}, - \code{\link{sumstat_ihh}}, \code{\link{sumstat_jsfs}}, - \code{\link{sumstat_mcmf}}, - \code{\link{sumstat_nucleotide_div}}, - \code{\link{sumstat_seg_sites}}, - \code{\link{sumstat_sfs}}, - \code{\link{sumstat_tajimas_d}}, - \code{\link{sumstat_trees}} +Other summary statistics: +\code{\link{sumstat_dna}()}, +\code{\link{sumstat_file}()}, +\code{\link{sumstat_four_gamete}()}, +\code{\link{sumstat_ihh}()}, +\code{\link{sumstat_jsfs}()}, +\code{\link{sumstat_mcmf}()}, +\code{\link{sumstat_nucleotide_div}()}, +\code{\link{sumstat_seg_sites}()}, +\code{\link{sumstat_sfs}()}, +\code{\link{sumstat_tajimas_d}()}, +\code{\link{sumstat_trees}()} } \concept{summary statistics} diff --git a/man/sumstat_seg_sites.Rd b/man/sumstat_seg_sites.Rd index 5724a81..78040d5 100644 --- a/man/sumstat_seg_sites.Rd +++ b/man/sumstat_seg_sites.Rd @@ -39,14 +39,17 @@ To create a demographic model: \code{\link{coal_model}} To calculate this statistic from data: \code{\link{calc_sumstats_from_data}} -Other summary statistics: \code{\link{sumstat_dna}}, - \code{\link{sumstat_file}}, - \code{\link{sumstat_four_gamete}}, - \code{\link{sumstat_ihh}}, \code{\link{sumstat_jsfs}}, - \code{\link{sumstat_mcmf}}, - \code{\link{sumstat_nucleotide_div}}, - \code{\link{sumstat_omega}}, \code{\link{sumstat_sfs}}, - \code{\link{sumstat_tajimas_d}}, - \code{\link{sumstat_trees}} +Other summary statistics: +\code{\link{sumstat_dna}()}, +\code{\link{sumstat_file}()}, +\code{\link{sumstat_four_gamete}()}, +\code{\link{sumstat_ihh}()}, +\code{\link{sumstat_jsfs}()}, +\code{\link{sumstat_mcmf}()}, +\code{\link{sumstat_nucleotide_div}()}, +\code{\link{sumstat_omega}()}, +\code{\link{sumstat_sfs}()}, +\code{\link{sumstat_tajimas_d}()}, +\code{\link{sumstat_trees}()} } \concept{summary statistics} diff --git a/man/sumstat_sfs.Rd b/man/sumstat_sfs.Rd index 3620a49..dd63eba 100644 --- a/man/sumstat_sfs.Rd +++ b/man/sumstat_sfs.Rd @@ -4,8 +4,7 @@ \alias{sumstat_sfs} \title{Summary Statistic: Site Frequency Spectrum} \usage{ -sumstat_sfs(name = "sfs", population = "all", - transformation = identity) +sumstat_sfs(name = "sfs", population = "all", transformation = identity) } \arguments{ \item{name}{The name of the summary statistic. When simulating a model, @@ -36,15 +35,17 @@ To create a demographic model: \code{\link{coal_model}} To calculate this statistic from data: \code{\link{calc_sumstats_from_data}} -Other summary statistics: \code{\link{sumstat_dna}}, - \code{\link{sumstat_file}}, - \code{\link{sumstat_four_gamete}}, - \code{\link{sumstat_ihh}}, \code{\link{sumstat_jsfs}}, - \code{\link{sumstat_mcmf}}, - \code{\link{sumstat_nucleotide_div}}, - \code{\link{sumstat_omega}}, - \code{\link{sumstat_seg_sites}}, - \code{\link{sumstat_tajimas_d}}, - \code{\link{sumstat_trees}} +Other summary statistics: +\code{\link{sumstat_dna}()}, +\code{\link{sumstat_file}()}, +\code{\link{sumstat_four_gamete}()}, +\code{\link{sumstat_ihh}()}, +\code{\link{sumstat_jsfs}()}, +\code{\link{sumstat_mcmf}()}, +\code{\link{sumstat_nucleotide_div}()}, +\code{\link{sumstat_omega}()}, +\code{\link{sumstat_seg_sites}()}, +\code{\link{sumstat_tajimas_d}()}, +\code{\link{sumstat_trees}()} } \concept{summary statistics} diff --git a/man/sumstat_tajimas_d.Rd b/man/sumstat_tajimas_d.Rd index 5d8205c..ab9a7ff 100644 --- a/man/sumstat_tajimas_d.Rd +++ b/man/sumstat_tajimas_d.Rd @@ -4,8 +4,11 @@ \alias{sumstat_tajimas_d} \title{Summary Statistic: Tajima's D} \usage{ -sumstat_tajimas_d(name = "tajimas_d", population = "all", - transformation = identity) +sumstat_tajimas_d( + name = "tajimas_d", + population = "all", + transformation = identity +) } \arguments{ \item{name}{The name of the summary statistic. When simulating a model, @@ -48,14 +51,17 @@ To create a demographic model: \code{\link{coal_model}} To calculate this statistic from data: \code{\link{calc_sumstats_from_data}} -Other summary statistics: \code{\link{sumstat_dna}}, - \code{\link{sumstat_file}}, - \code{\link{sumstat_four_gamete}}, - \code{\link{sumstat_ihh}}, \code{\link{sumstat_jsfs}}, - \code{\link{sumstat_mcmf}}, - \code{\link{sumstat_nucleotide_div}}, - \code{\link{sumstat_omega}}, - \code{\link{sumstat_seg_sites}}, - \code{\link{sumstat_sfs}}, \code{\link{sumstat_trees}} +Other summary statistics: +\code{\link{sumstat_dna}()}, +\code{\link{sumstat_file}()}, +\code{\link{sumstat_four_gamete}()}, +\code{\link{sumstat_ihh}()}, +\code{\link{sumstat_jsfs}()}, +\code{\link{sumstat_mcmf}()}, +\code{\link{sumstat_nucleotide_div}()}, +\code{\link{sumstat_omega}()}, +\code{\link{sumstat_seg_sites}()}, +\code{\link{sumstat_sfs}()}, +\code{\link{sumstat_trees}()} } \concept{summary statistics} diff --git a/man/sumstat_trees.Rd b/man/sumstat_trees.Rd index 891cdf1..312b7de 100644 --- a/man/sumstat_trees.Rd +++ b/man/sumstat_trees.Rd @@ -30,15 +30,17 @@ To create a demographic model: \code{\link{coal_model}} To calculate this statistic from data: \code{\link{calc_sumstats_from_data}} -Other summary statistics: \code{\link{sumstat_dna}}, - \code{\link{sumstat_file}}, - \code{\link{sumstat_four_gamete}}, - \code{\link{sumstat_ihh}}, \code{\link{sumstat_jsfs}}, - \code{\link{sumstat_mcmf}}, - \code{\link{sumstat_nucleotide_div}}, - \code{\link{sumstat_omega}}, - \code{\link{sumstat_seg_sites}}, - \code{\link{sumstat_sfs}}, - \code{\link{sumstat_tajimas_d}} +Other summary statistics: +\code{\link{sumstat_dna}()}, +\code{\link{sumstat_file}()}, +\code{\link{sumstat_four_gamete}()}, +\code{\link{sumstat_ihh}()}, +\code{\link{sumstat_jsfs}()}, +\code{\link{sumstat_mcmf}()}, +\code{\link{sumstat_nucleotide_div}()}, +\code{\link{sumstat_omega}()}, +\code{\link{sumstat_seg_sites}()}, +\code{\link{sumstat_sfs}()}, +\code{\link{sumstat_tajimas_d}()} } \concept{summary statistics} diff --git a/vignettes/coala-data-import.Rmd b/vignettes/coala-data-import.Rmd index 62092f9..9cc177c 100644 --- a/vignettes/coala-data-import.Rmd +++ b/vignettes/coala-data-import.Rmd @@ -9,60 +9,10 @@ vignette: > %\usepackage[utf8]{inputenc} --- -While `coala` primiary focuses on simulation of data, it also offers -to calculate summary statsitcs from real data. This is particularly useful -when comparing the statistics of real and simulated data. +Prevously, it was possible it import genetic data via the Package `PopGenome`. +Unfortunately, `PopGenome` was removed from CRAN in early 2020, so this is not +an option anymore. -Rather than offering functions to import data directly, coala can convert -the internal formats of other R packages into its own format. Currently, the -`PopGenome` package is supported, but we plan to support `ape` and `pegas` in the -future. - - -Importing Data from PopGenome ------------------------------ - -`PopGenome` provides functions for reading various data formats, including `vcf` -and `fasta`. Please refer to its documentation for detailed instructions. As an example, -we will read sequence data from a short fasta file that is included in coala: - -```{r import_data, results="hide"} -suppressPackageStartupMessages(library(PopGenome)) -fasta <- system.file("example_fasta_files", package = "coala") -data_pg <- readData(fasta, progress_bar_switch = FALSE) -data_pg <- set.outgroup(data_pg, c("Individual_Out-1", "Individual_Out-2")) -individuals <- list(paste0("Individual_1-", 1:5), paste0("Individual_2-", 1:5)) -data_pg <- set.populations(data_pg, individuals) -``` - -Here the sequences originate from two population and an outgroup. The outgroup -is required for most summary statistics. - -We can now convert `data_pg` using the `as.segsites` function: - -```{r} -library(coala) -segsites <- as.segsites(data_pg) -``` - -Next, we calculate summary statistics using `calc_sumstats_from_data`: -```{r calc_sumstats_1} -model <- coal_model(c(5, 5, 2), 1, 25) + - feat_mutation(5) + - feat_outgroup(3) + - sumstat_sfs(population = 1) -stats <- calc_sumstats_from_data(model, segsites) -stats$sfs -``` - - -Alternatively, it is also possible to pass the `data_pg` object directly to -`calc_sumstats_from_data`: - -```{r calc_sumstats_2} -stats <- calc_sumstats_from_data(model, data_pg) -stats$sfs -``` - -Please refer to the help pages for `as.segsites` and `calc_sumstats_from_data` -for additional information. +You will have to import your data and convert it into a +`seg_sites` object manually. Please refer to the `create_segsites` section +in `coala`'s documentation for details.