a2i: Convert an alignment position to an index

Description Usage Arguments Value Author(s) Examples

Description

Convert an alignment position to an index

Usage

1
a2i(sti, ai, nstpist, napst)

Arguments

sti

the species tree index, a value from 1 to and including 2

ai

the alignment index, the ai-th alignment of that species tree, a value from 1 to and including the number of alignments per species tree

nstpist

the number of species trees per incipient species tree

napst

the number of alignments per species tree

Value

the plain index

Author(s)

Richel Bilderbeek

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  # only index must be one
  testit::assert(1 == a2i(sti = 1, ai = 1, nstpist = 1, napst = 1))

  # With only two species tree indices must be one and two
  testit::assert(1 == a2i(sti = 1, ai = 1, nstpist = 1, napst = 1))
  testit::assert(2 == a2i(sti = 2, ai = 1, nstpist = 2, napst = 1))

  # With only two alignment indices must be one and two
  testit::assert(1 == a2i(sti = 1, ai = 1, nstpist = 1, napst = 1))
  testit::assert(2 == a2i(sti = 1, ai = 2, nstpist = 1, napst = 2))

  # With only three species tree indices must be one to three
  testit::assert(1 == a2i(sti = 1, ai = 1, nstpist = 1, napst = 1))
  testit::assert(2 == a2i(sti = 2, ai = 1, nstpist = 2, napst = 1))
  testit::assert(3 == a2i(sti = 3, ai = 1, nstpist = 3, napst = 1))

richelbilderbeek/wiritttes documentation built on May 27, 2019, 8:14 a.m.