dos: Calculate Direction of Selection from SNV data

Description Usage Arguments Value

View source: R/dos.r

Description

Takes SNV data in MIDAS format and produces Direction of Selection (DoS) statistics.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
dos(
  info,
  freq,
  depth,
  map,
  depth_thres = 1,
  freq_thres = 0.5,
  test = TRUE,
  clean = TRUE
)

Arguments

info

Data table corresponding to the 'snps_info.txt' file from MIDAS. Must have columns 'site_id' and 'sample'

freq

A data table corresponding to the 'snps_freq.txt' file from MIDAS. Must have a 'site_id' column, and one more column per sample. Each row is the frequency of the minor allele for the corresponding site in the corresponding sample.

depth

A data table corresponding to the 'snps_depth.txt' file from MIDAS. Must have a 'site_id' column, and one more column per sample. Each row is the sequencing depth for the corresponding site in the corresponding sample.

map

A data table associating samples with groups (sites). must have columns 'sample' and 'Group'.

depth_thres

Minimum number of reads (depth) at a site at a sample to be considered.

freq_thres

Frequency cuttoff for minor vs major allele. The value represents the distance from 0 or 1, for a site to be assigned to the major or minor allele respectively. It must be a value in [0,1].

test

It TRUE, a Z-test will be performed on the DoS statistic.

clean

If TRUE, genes where DoS is undefined (either Dn and Ds are both zero, or Pn and Ps are both zero), will be removed from the result.

Value

A tibble with the same columns as Dat plus a column named DoS. If test is passed, a column named p.value will also be included unless such a column already exists. In that case a column with the name DoS.p.value will be included


surh/HMVAR documentation built on Aug. 18, 2021, 1:21 a.m.