Skip to contents

baseFreq computes the frequencies (absolute or relative) of the states from a sample of sequences. glance computes some useful information about the alignment. composition\_test computes a \(\chi^2\)-test testing if the state composition for a species differs.

Usage

baseFreq(obj, freq = FALSE, all = FALSE, drop.unused.levels = FALSE)

# S3 method for phyDat
glance(x, ...)

composition_test(obj)

Arguments

obj, x

as object of class phyDat

freq

logical, if 'TRUE', frequencies or counts are returned otherwise proportions

all

all a logical; if all = TRUE, all counts of bases, ambiguous codes, missing data, and alignment gaps are returned as defined in the contrast.

drop.unused.levels

logical, drop unused levels

...

further arguments passed to or from other methods.

Value

baseFreq returns a named vector and glance a one row data.frame.

See also

phyDat, base.freq, glance

Author

Klaus Schliep

Examples


data(Laurasiatherian)
data(chloroplast)
# base frequencies
baseFreq(Laurasiatherian)
#>         a         c         g         t 
#> 0.3321866 0.1990791 0.2040652 0.2646691 
baseFreq(Laurasiatherian, all=TRUE)
#>         a         c         g         t         u         m         r         w 
#> 0.3321866 0.1990791 0.2040652 0.2646691 0.0000000 0.0000000 0.0000000 0.0000000 
#>         s         y         k         v         h         d         b         n 
#> 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 
#>         ?         - 
#> 0.0000000 0.0000000 
baseFreq(Laurasiatherian, freq=TRUE)
#>     a     c     g     t 
#> 49633 29745 30490 39545 
baseFreq(chloroplast)
#>           A           R           N           D           C           Q 
#> 0.086702955 0.051669804 0.036230253 0.040435459 0.006650569 0.039678317 
#>           E           G           H           I           L           K 
#> 0.046635835 0.090775149 0.029395514 0.073585987 0.101712777 0.040148973 
#>           M           F           P           S           T           W 
#> 0.024852664 0.051260539 0.048109192 0.054176557 0.051618646 0.021905951 
#>           Y           V 
#> 0.031636245 0.072818613 
glance(Laurasiatherian)
#>   nseq nchar unique_site_pattern parsimony_informative_sites const_sites
#> 1   47  3179                1605                        1400        1354
glance(chloroplast)
#>   nseq nchar unique_site_pattern parsimony_informative_sites const_sites
#> 1   19  5144                2775                        2032        2190
composition_test(Laurasiatherian)[1:10,]
#>            statistic parameter df     p-value
#> Platypus   2.1137955            3 0.549126893
#> Wallaroo   2.4109765            3 0.491594621
#> Possum     3.5419454            3 0.315362557
#> Bandicoot  7.9087006            3 0.047936758
#> Opposum   12.5176626            3 0.005804765
#> Armadillo  1.5323619            3 0.674821614
#> Elephant   0.2412612            3 0.970668519
#> Aardvark   1.7363022            3 0.628893376
#> Tenrec     0.9995630            3 0.801357693
#> Hedghog    5.2957058            3 0.151381280