Skip to content

C) Running hogwash

Katie Saund edited this page Sep 12, 2020 · 26 revisions

hogwash()

If you haven't yet, install the package on your computer:

install.packages("devtools")
devtools::install_github("katiesaund/hogwash")

Once it's been installed once you only need to call library(hogwash) in order to use the package.

The hogwash() function shown with its default values.

library(hogwash)
hogwash(pheno, 
        geno,  
        tree,      
        tree_type = "phylogram",
        file_name = "hogwash",
        dir = ".",
        perm = 10000,
        fdr = 0.15,
        bootstrap = 0.70,
        group_genotype_key = NULL, 
        grouping_method = "post-ar",
        test = "both")

pheno Phenotype - must be provided by the user
geno Genotype - must be provided by the user
tree Phylogenetic tree - must be provided by the user
tree_type Either "phylogram" or "fan".
file_name Prefix for both the .pdf and .rda output files - must be a character string
dir Directory in which to save the output files
perm Number of permutations to run
fdr False discovery rate
bootstrap Lowest value bootstrap value to consider a tree edge to be high confidence
group_genotype_key Key to put genotypes into biologically meaningful groups
grouping_method Either "post-ar" or "pre-ar". Ignored if group_genotype_key is not provided
test Ignored for Continuous Test

See the next page for detailed descriptions of inputs.

Instructions to run example data on your computer:

Run the Continuous Test

library(hogwash)
phenotype <- hogwash::growth
genotype <- hogwash::snp_genotype
tree <- hogwash::tree

hogwash(pheno = phenotype, 
        geno = genotype,  
        tree = tree)

Run the Continuous Test while grouping SNPs into genes

library(hogwash)
phenotype <- hogwash::growth
genotype <- hogwash::snp_genotype
tree <- hogwash::tree
key <- hogwash::snp_gene_key

hogwash(pheno = phenotype, 
        geno = genotype,  
        tree = tree,      
        group_genotype_key = key, 
        grouping_method = "post-ar")

Run both the Synchronous Test & PhyC

library(hogwash)
phenotype <- hogwash::antibiotic_resistance
genotype <- hogwash::snp_genotype
tree <- hogwash::tree

hogwash(pheno = phenotype, 
        geno = genotype,  
        tree = tree, 
        test = "both")

Run just the Synchronous Test while grouping SNPs into genes

library(hogwash)
phenotype <- hogwash::antibiotic_resistance
genotype <- hogwash::snp_genotype
tree <- hogwash::tree
key <- hogwash::snp_gene_key

hogwash(pheno = phenotype, 
        geno = genotype,  
        tree = tree,      
        group_genotype_key = key, 
        test = "synchronous", 
        grouping_method = "post-ar")

Run just PhyC while grouping SNPs into genes

library(hogwash)
phenotype <- hogwash::antibiotic_resistance
genotype <- hogwash::snp_genotype
tree <- hogwash::tree
key <- hogwash::snp_gene_key

hogwash(pheno = phenotype, 
        geno = genotype,  
        tree = tree,      
        group_genotype_key = key, 
        test = "phyc", 
        grouping_method = "post-ar")

report_phylogenetic_signal()

Hogwash seems to perform better for phenotypes whose evolution more closely reflects white noise rather than a Brownian motion model of evolution. A phenotype that is characterized by white noise seems be unrelated to structure of the phylogenetic tree and could be a result of events like horizontal gene transfer. A phenotype that is characterized by Brownian motion model of evolution has values that closely reflect the structure of the phylogenetic tree. Please see the preprint for more details on Brownian motion vs. white noise. If you want to check the phylogenetic signal of your phenotype prior to running hogwash you can with the report_phylogenetic_signal_function().

library(hogwash)
phenotype <- hogwash::growth
tree <- hogwash::tree
hogwash::report_phylogenetic_signal(phenotype, tree)

This will report the phylogenetic signal:

[1] "The phenotype is modeled well by Brownian Motion; Pagel's lambda = 0.99993"

Next: the hogwash inputs.