Skip to content

Commit 303f59d

Browse files
authored
Merge pull request #10 from iferres/develop
Develop
2 parents 922da24 + 9310cb0 commit 303f59d

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: simurg
2-
Version: 0.1.1
2+
Version: 0.2.1
33
Title: simurg: Simulate Bacterial Pangenomes
44
Description: This package is intended to simulate a bacterial pangenome, given
55
an initial MRCA, a number of generations, a substitution rate, a gene gain and

R/S3methods.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ summary.pangenomeSimulation <- function(object, ...){
2828

2929
cat('Summary of object of class pangenomeSimulation:\n\n')
3030
attrs <- attributes(object)
31-
ret <- list(Coal_times = NULL, Gene_family_frecuency = NULL, Evo_dist = NULL)
31+
ret <- list(Coal_times = NULL, Gene_family_frequency = NULL, Evo_dist = NULL)
3232

3333
cat('** Coalescent ** \n')
3434
phy <- object$coalescent

R/simpg.R

+2-3
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@
5656
#' each of the original genes sampled from this file.
5757
#' @param norg The number of organisms sampled at final time.
5858
#' @param br \code{numeric} vector of length \code{norg - 1} for setting the
59-
#' coalescent branch lengths. By default is calculated as:
60-
#' \code{rexp( norg - 1, choose(seq(norg, 2, -1), 2) )}
59+
#' coalescent branch lengths.
6160
#' as expected by the coalescent theory (see Wakeley, 2008 "Coalescent Theory:
6261
#' An Introduction". Roberts & Company Publishers).
6362
#' @param ne Effective population size. Baumdicker et al. (2012) estimates
@@ -270,7 +269,7 @@ simpg <- function(ref='pan_genome_reference.fa',
270269
if (verbose) message('Simulating coalescent tree, \u03C4')
271270
# cat('Simulating coalescent tree.\n')
272271
if (missing(br)){
273-
br <- rexp(norg - 1, choose(seq(norg, 2, -1), 2))
272+
br <- 2 * rexp(norg - 1)/(as.double(norg:2) * as.double((norg - 1):1))
274273
if (verbose){
275274
mssg1 <- ' Simulated branch lengths:'
276275
mssg2 <- paste(br, collapse = ' ')

0 commit comments

Comments
 (0)