midas_dos: Direction of Selection statistics on MIDAS output

Description Usage Arguments Value Examples

View source: R/dos.r

Description

Take output from MIDAS script midas_merge.py and obtain and test Direction of Selection (DoS) statistics.

Usage

1
2
3
4
5
6
7
8
9
midas_dos(
  midas_dir,
  map,
  map_file,
  genes = NULL,
  depth_thres = 1,
  freq_thres = 0.5,
  focal_group = NA
)

Arguments

midas_dir

Directory where the output from midas_merge.py is located. It must include files: 'snps_info.txt', 'snps_depth.txt' and 'snps_freq.txt'.

map

Either a file path or a tibble. If a path, it mos point to a mapping file associating samples in the MIDAS otput to groups. It must have an 'ID' and a 'Group' column. If a tibble. It must have columns 'sample' and 'Group'.

map_file

Same as map. Present for backwards compatibility.

genes

The list of genes that are to be tested. Must correspond to entries in the 'genes_id' column of the 'snps_info.txt' file. If NULL, all genes will be tested.

depth_thres

The minimum number of reads at a position in a given sample for that position in that sample to be included.

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].

focal_group

A string indicating the group that should be compared to everything else. If different from NA, all values in the 'Group' column of the mapping file will be converted to "non.<focal_group>", ensuring a dichotomous grouping.

Value

A tibble with columns gene_id, Dn, Ds, Pn, Ps, DoS and p.value.

Examples

1
2
midas_dos(midas_dir = system.file("toy_example/merged.snps/", package = "HMVAR"),
          map = system.file("toy_example/map.txt", package = "HMVAR"))

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