### Install Hogwash Package Source: https://github.com/katiesaund/hogwash/wiki/C)-Running-hogwash Install the hogwash package from GitHub using devtools. This is a one-time installation. ```r install.packages("devtools") devtools::install_github("katiesaund/hogwash") ``` -------------------------------- ### Install R Package from GitHub Source: https://github.com/katiesaund/hogwash/blob/master/README.md Use this command to install the hogwash package directly from its GitHub repository. Requires devtools. ```r devtools::install_github("katiesaund/hogwash") ``` -------------------------------- ### Install R Package from CRAN Source: https://github.com/katiesaund/hogwash/blob/master/README.md Use this command to install the hogwash package from CRAN. Ensure devtools is installed first. ```r install.packages("devtools") ``` -------------------------------- ### Run Continuous Test Example Source: https://github.com/katiesaund/hogwash/wiki/C)-Running-hogwash Execute the continuous test using example phenotype, genotype, and tree data. This demonstrates a basic usage of the hogwash() function. ```r library(hogwash) phenotype <- hogwash::growth genotype <- hogwash::snp_genotype tree <- hogwash::tree hogwash(pheno = phenotype, geno = genotype, tree = tree) ``` -------------------------------- ### Run Hogwash with Default Values Source: https://github.com/katiesaund/hogwash/wiki/C)-Running-hogwash Example of calling the hogwash() function with its default parameters. Ensure 'pheno', 'geno', and 'tree' are provided. ```r 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") ``` -------------------------------- ### Load R Package Source: https://github.com/katiesaund/hogwash/blob/master/README.md Load the hogwash package into your R session after installation to use its functions. ```r library(hogwash) ``` -------------------------------- ### Run Synchronous Test and PhyC Source: https://github.com/katiesaund/hogwash/wiki/C)-Running-hogwash Execute both the synchronous test and the PhyC analysis using example data. This is useful for a comprehensive evolutionary analysis. ```r library(hogwash) phenotype <- hogwash::antibiotic_resistance genotype <- hogwash::snp_genotype tree <- hogwash::tree hogwash(pheno = phenotype, geno = genotype, tree = tree, test = "both") ``` -------------------------------- ### Phylogenetic Signal Output Source: https://github.com/katiesaund/hogwash/wiki/C)-Running-hogwash Example output from the report_phylogenetic_signal() function, indicating how well the phenotype is modeled by Brownian Motion. ```text [1] "The phenotype is modeled well by Brownian Motion; Pagel's lambda = 0.99993" ``` -------------------------------- ### Run PhyC with SNP Grouping Source: https://github.com/katiesaund/hogwash/wiki/C)-Running-hogwash Execute the PhyC analysis with SNPs grouped into genes. This specifically targets PhyC for gene-level evolutionary insights. ```r 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") ``` -------------------------------- ### Run Continuous Test with SNP Grouping Source: https://github.com/katiesaund/hogwash/wiki/C)-Running-hogwash Perform the continuous test while grouping SNPs into genes using a provided key. This allows for gene-level analysis. ```r 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") ``` -------------------------------- ### Adjust P-values using Bonferroni Source: https://github.com/katiesaund/hogwash/wiki/F)-Exploring-your-hogwash-results Accesses raw, unadjusted P-values from hogwash and applies the Bonferroni correction method. This allows for custom P-value adjustment. ```r p.adjust(exp(-hogwash_phyc$raw_pvals$neg_log_unadjusted_pvals), method = "bonferroni") ``` -------------------------------- ### Plot P-value vs. Epsilon Source: https://github.com/katiesaund/hogwash/wiki/F)-Exploring-your-hogwash-results Generates a scatter plot of corrected P-values against epsilon values. Requires the tidyverse package and a loaded 'phyc_output_file_name.rda' file. ```r library(tidyverse) load("phyc_output_file_name.rda") df <- as_tibble(cbind(hogwash_phyc$hit_pvals$fdr_corrected_pvals, hogwash_phyc$convergence$epsilon)) colnames(df) <- c("P-value", "Epsilon") df %>% ggplot(aes(x = Epsilon, y = `P-value`)) + geom_jitter() ``` -------------------------------- ### Run Synchronous Test with SNP Grouping Source: https://github.com/katiesaund/hogwash/wiki/C)-Running-hogwash Perform the synchronous test with SNPs grouped into genes. This focuses the analysis on gene-level evolutionary patterns. ```r 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") ``` -------------------------------- ### Report Phylogenetic Signal Source: https://github.com/katiesaund/hogwash/wiki/C)-Running-hogwash Use report_phylogenetic_signal() to assess the phylogenetic signal of a phenotype before running hogwash. This helps understand if the phenotype aligns with Brownian motion or white noise models. ```r library(hogwash) phenotype <- hogwash::growth tree <- hogwash::tree hogwash::report_phylogenetic_signal(phenotype, tree) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.