Project configuration

General settings that are used to keep plots consistent.

clr

Hamlet colors (standard)

clr2

Hamlet colors (alternative)

clr_below

Default background bar color

clr_loc

Location colors

f_width

Default figure width (double column)

f_width_half

Default figure width (single column)

fll_fun()

Fill function for adxiture classes

fll_n()

Named fill function for adxiture classes

generic_hamlet_img

Generic Hamlet image.

loc_names

Location names

outlr_clr

Outlier color

plot_clr

Default plot color

plot_text_size

Default plot font size

plot_size

Default plot size

pop_levels

Population order

project_case()

Project case

project_inv_case()

Inverted project case

shps

Location shapes

sp_labs

Species labels

sp_names

Species names

General functions

Functions that are used at differnet places.

add_gpos()

Add genomic position

darken()

Darken a given color

get_dxy()

Import dxy data

get_gxp()

Import genotype x phenotype association

get_fst()

Import Fst data

get_fst_summary_data()

Import fst summary data for outlier windows

get_pi()

Import diversity data

join_list()

Iterate left_join over list

lighten()

Lighten a given color

process_input()

Process script input

refactor()

Reorder factor levels

Tables

Functions needed to compile tables.

as_multirow()

Wrap content in multirow

export_2_latex()

Export latex tables

get_genes()

Collect hamlet genes

Figure 1

Functions specific to Figure 1.

bammplot_k()

A modded version of BAMMtools::plot.bammdata

hypo_anno_l_lwd()

Hamlet Annotation (alt)

make_faint_clr()

make a faint version of a color

network_layout()

crate a network layout for pairwise species comparisons

pca_plot()

Automated PCA plotting

plot_fish()

Plot single fish

plot_fish2()

Plot Hamlet drawing (alt)

plot_fish_lwd()

Hamlet Annotation (alt)

plot_network()

Plot pariwise species comparisons per location

summarize_dxy()

Import and summarize dxy data

summarize_fst()

Import and summarize Fst data

whisker_points()

Whisker points

Figure 2

Functions specific to Figure 2.

get_cc()

Import cross coalescence data

get_msmc()

Import msmc data

Figure 3

Functions specific to Figure 3.

collapse_peaks()

Collapse all Fst peaks of a given run

geom_hypo_grob2()

The custom grob geom

get_fst_fixed()

Compute summary stats an absolute for Fst outlier

plot_fishes_location()

Plot two fishes with location

reformat_run_name()

Reformat run name

summarise_model()

summarize model statistics

Figure 4

Functions specific to Figure 4.

get_twisst_data()

Import a single topology weighting data set

match_twisst_files()

Import all topology weighting data sets for a location

Figure 5

Functions specific to Figure 5.

ax_scl()

Scale bp to Mb

custom_annoplot()

Custom annotation base plot

cross_spec()

Cross species pairs

distances_tree()

Get distance matrix of a topology

dist_tibble()

Create tibble of pairwise species distances

get_clr()

Defin topology weighing base color

get_dist()

Create distance of species pair

get_gxp_long()

Import genotype x phenotype association in long format

get_isolated_topos()

get isolated topologies

get_neighbour_topos()

Get pairwise highlighing topologies

is_isolated()

Determine if species is isolated in topology

min_dist()

Find minimum distance to other species in topology

no_title()

drop ggplot y axis titles

plot_fish_zoom()

Plot fish for topology legend

plot_curtain()

Manage plot panels for a single outlier window

plot_leg()

Create topology legend

plot_panel_anno()

Create annotation panel

plot_panel_delta_dxy()

Create the delta dxy panel

plot_panel_dxy()

Create the dxy panel

plot_panel_fst()

Create the fst panel

plot_fst_poptree()

Create the fst population tree panel

plot_panel_gxp()

Create the genotype x phenotype panel

plot_panel_twisst()

Create the topology weighting panel

prep_data()

Prepate topology weighting data for zoom plot

theme_panels()

ggplot layout template

Figure 6

Functions specific to Figure 6.

import_geva_data()

Import Geva data (Allele Age)

gxp_importer()

Import windowed gxp data for focal trait

import_gxp_data()

Import windowed gxp data for all traits

get_gxp_and_geva()

Combine allele age and gxp data import

reverselog_trans()

Custom reverse log transformation

grid_piece_x()

Single grob annotation for specific x range

theme_gradient_bg_x()

Tiled Grob background for ggplot

Figure S1

Functions specific to Figure S1.

pca_plot_no_fish()

PCA plot without fish annotations

Figure S4

Functions specific to Figure S4.

getPofZ()

Get hybridization data

label_spacer()

Adjust plot sizes

plot_loc()

Plot hybridization data

theme_hyb()

Custom ggplot theme

Figure S5

Functions specific to Figure S5.

anno_pair_flag()

create hamlet pair annotations

fst_bar_row_run()

crate global fst bar table

plot_pair_run()

create hamlet pair annotations

refactor_run()

reorder species pairs

rescale_fst()

normalize global fst

Figure S9

Functions specific to Figure S9.

lab2spec()

Convert tree labels

Figure S10

Functions specific to Figure S10.

fish_plot()

hamlet pair annotation

fish_plot2()

hamlet pair annotation 2

Figure S13

Functions specific to Figure S13.

add_spec_drawing()

Add fish annotation

adm_plot()

Plot adimxture data

data_amdx()

Get adimxture data

read_sc()

import sc data sheet

Figure S14

Functions specific to Figure S14.

get_gxp_both_models()

Get gxp data

Figure S15

Functions specific to Figure S15.

get_n_above()

Count number of permutation Fst greather than the original Fst

get_n_total()

Count number of fst permutations

get_percentile()

Compute the percentile of original Fst copared to fst distribution

get_random_fst()

Import Fst permutation tests results