get.nj: Generate a distance matrix for a SNP using fsts

Description Usage Arguments Value Examples

View source: R/gwscaR_popgen.R

Description

Generate a distance matrix for a SNP using fsts

Usage

1
get.nj(vcf.row, pop.list)

Arguments

vcf.row

A row of a vcf file

pop.list

A list of populations in the order you want them to appear in the matrix

Value

fst.tree A neighbor-joining tree from the ape package

Examples

1
2
3
4
5
6
7
require(ape)
vcf.file<-system.file("extdata", "example.vcf.txt",package = "gwscaR")
vcf<-parse.vcf(vcf.file)
fst.trees<-list()
for(vcf.row in 1: nrow(vcf)){
  fst.trees<-c(fst.trees,get.nj(vcf[vcf.row,],pop.list=c("FEM","PRM","OFF")))
}

spflanagan/gwscaR documentation built on Nov. 14, 2019, 9:16 p.m.