Nucleotide_diversity: Calculate nucleotide diversity for each position in the...

Description Usage Arguments Value Examples

View source: R/VCF_Utils.R

Description

Calculate nucleotide diversity for each position in the coding sequence

Usage

1
Nucleotide_diversity(tidyVCF, approxMissingRefGt = TRUE)

Arguments

tidyVCF

the $dat field of a tidyVCF object

approxMissingRefGt

logical, if true, assume all undetermined geneotypes are 0|0 in positions where no 0|0s are present

Value

input with Diversity field appended

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## make a gene info DF
geneInfo <- getGeneInfo(genes = c("AT3G62980", "AT3G26810"))

## download a single VCF
myVCF <- VCFByTranscript(geneInfo[1, ])

## calculate site-wise nucleotide diversity of a single VCF
myVCFWithDiv <- Nucleotide_diversity(myVCF)

## This function can also be applied to a list of VCF files created by the
## `VCFList()` function, see example in the documentation for VCFList()

wrightrc/r1001genomes documentation built on Sept. 11, 2018, 1:40 a.m.