snp.sim.Q: Aternative SNPs simulation fn.

View source: R/snp.sim.Q_old.R View source: R/snp.sim.Q.R

snp.sim.QR Documentation

Aternative SNPs simulation fn.

Description

Currently under development. Please use the regular snp.sim function to simulate genetic data.

NOT currently in use. Please use the regular snp.sim function to simulate genetic data.

Usage

snp.sim.Q(
  n.snps = 10000,
  n.subs = 1,
  snp.root = NULL,
  n.snps.assoc = 10,
  assoc.prob = 100,
  Q = matrix(c(2, 0.75, 0.75, 1, 3, 0.5, 0.25, 3, 3, 0.25, 0.5, 3, 1, 0.75, 0.75, 2),
    nrow = 4, byrow = T, dimnames = rep(list(c("0|0", "0|1", "1|0", "1|1")), 2)),
  tree = coalescent.tree.sim(100),
  n.phen.subs = 15,
  phen.loci = NULL,
  heatmap = FALSE,
  reconstruct = FALSE,
  dist.dna.model = "JC69",
  grp.min = 0.25,
  row.names = NULL,
  set = 3,
  seed = 1
)

snp.sim.Q(
  n.snps = 10000,
  n.subs = 1,
  snp.root = NULL,
  n.snps.assoc = 10,
  assoc.prob = 100,
  Q = matrix(c(2, 0.75, 0.75, 1, 3, 0.5, 0.25, 3, 3, 0.25, 0.5, 3, 1, 0.75, 0.75, 2),
    nrow = 4, byrow = T, dimnames = rep(list(c("0|0", "0|1", "1|0", "1|1")), 2)),
  tree = coalescent.tree.sim(100),
  n.phen.subs = 15,
  phen.loci = NULL,
  heatmap = FALSE,
  reconstruct = FALSE,
  dist.dna.model = "JC69",
  grp.min = 0.25,
  row.names = NULL,
  set = 3,
  seed = 1
)

Arguments

n.snps

An integer specifying the number of snps columns to be simulated.

tree

A phylo object containing the phylogenetic tree; or, a character string, one of "NJ", "BIONJ" (the default), or "parsimony"; or, if NAs are present in the distance matrix, one of: "NJ*" or "BIONJ*", specifying the method of phylogenetic reconstruction.

heatmap

A logical indicating whether to produce a heatmap of the genetic distance between the simulated genomes of the n.ind individuals.

reconstruct

Either a logical indicating whether to attempt to reconstruct a phylogenetic tree using the simulated genetic data, or one of c("UPGMA", "nj", "ml") to specify that tree reconstruction is desired by one of these three methods (Unweighted Pair Group Method with Arithmetic Mean, Neighbour-Joining, Maximum-Likelihood).

dist.dna.model

A character string specifying the type of model to use in reconstructing the phylogenetic tree for calculating the genetic distance between individual genomes, only used if tree is a character string (see ?dist.dna).

grp.min

(Not yet (re-)implemented in this function.) An optional number between 0.1 and 0.9 to control the proportional size of the smaller phenotypic group.

row.names

An optional vector containing row names for the individuals to be simulated.

seed

An optional integer to control the pseudo-randomisation process and allow for identical repeat runs of the function; else NULL.

phen.reconstruction

Either a character string specifying "parsimony" (the default) or "ML" (maximum likelihood) for the ancestral state reconstruction of the phenotypic variable, or a vector containing this reconstruction if it has been performed elsewhere.

s

If set is 3, the s parameter controls a baseline number of substitutions to be experienced by the phenotype and associated loci: by default, 20.

af

If set is 3, the af parameter provides an association factor, controlling the preference for association over non-association at associated loci: by default, 10 (for a 10x preference).

plot

A logical indicating whether to generate a plot of the phylogenetic tree (TRUE) or not (FALSE, the default).

Author(s)

Caitlin Collins caitiecollins@gmail.com

Examples

## Example ##

## Example ##


caitiecollins/treeWAS documentation built on Sept. 9, 2024, 8:23 a.m.