HudsonFst.plot {fst4pg}R Documentation

Plot Fst values along chromosomes

Description

Plot Fst values along chromosomes

Usage

HudsonFst.plot(
  Info,
  HFst.m,
  HFst.prof = NULL,
  Coord = NULL,
  Ref = NULL,
  Threshold = NULL
)

Arguments

Info

a data.frame providing information about markers

HFst.m

a data.frame with 2 columns, Fst and Weight, as provided by the HudsonFst.m function

HFst.prof

a data.frame corresponding to one item of the output of the HudsonFst.prof function

Coord

a vector with the minimum and maximum coordinates (i.e. positions along the genome) providing the range of the genomic region that will be plotted.

Ref

a value to plot a reference line

Threshold

a value to plot a threshold line

Value

a ggplot object

Examples

## The full example execution takes a few seconds.
data(Freq);data(NbGamete)
FreqNbG <- BuildFreqNbG(Freq,NbGamete)
HFst.m <- HudsonFst.m(FreqNbG)
TwoPops <- list(First="Colombian",Second="Tuscan")
HFst.prof <- HudsonFst.prof(HFst.m,Contrast=TwoPops)

## Plot the raw data

HudsonFst.plot(Info,HFst.m$Colombian_Tuscan)

## Plot the raw data and the segmentation

HudsonFst.plot(Info,HFst.m$Colombian_Tuscan,HFst.prof$Colombian_Tuscan)

## Add a background/reference level

RefLevel <- median(HFst.prof$Colombian_Tuscan)
HudsonFst.plot(Info,HFst.m$Colombian_Tuscan,HFst.prof$Colombian_Tuscan,
               Ref=RefLevel)

## Add a threshold 

Threshold <- 3*RefLevel
HudsonFst.plot(Info,HFst.m$Colombian_Tuscan,HFst.prof$Colombian_Tuscan,
               Ref=RefLevel,Threshold = Threshold)


[Package fst4pg version 1.0.0 Index]