### Install mafft with apt-get Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/gettingstarted/installation.md Install the MAFFT aligner using apt-get on compatible Linux systems. ```bash sudo apt-get install mafft ``` -------------------------------- ### Install Panaroo from Git (setup.py) Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/gettingstarted/installation.md Install Panaroo from a cloned GitHub repository using setup.py. ```bash git clone https://github.com/gtonkinhill/panaroo cd panaroo python3 setup.py install ``` -------------------------------- ### Install Panaroo from Git (pip) Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/gettingstarted/installation.md Install Panaroo directly from its GitHub repository using pip. ```bash pip3 install git+https://github.com/gtonkinhill/panaroo ``` -------------------------------- ### Install Panaroo Locally Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/gettingstarted/installation.md Install Panaroo from a cloned GitHub repository for local user access using setup.py. ```bash python3 setup.py install --user ``` -------------------------------- ### Install cd-hit with apt-get Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/gettingstarted/installation.md Install the cd-hit dependency using apt-get on compatible Linux systems. ```bash sudo apt-get install cd-hit ``` -------------------------------- ### Install Mamba Solver Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/gettingstarted/installation.md Install the Mamba package manager, a faster alternative to Conda. ```bash conda install mamba -c conda-forge ``` -------------------------------- ### Install Panaroo with Mamba Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/gettingstarted/installation.md Install Panaroo version 1.3 or higher using the Mamba package manager. ```bash mamba install -c conda-forge -c bioconda -c defaults 'panaroo>=1.3' ``` -------------------------------- ### Install Panaroo with Conda Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/gettingstarted/installation.md Install Panaroo version 1.3 or higher using the Conda package manager. ```bash conda install -c conda-forge -c bioconda -c defaults 'panaroo>=1.3' ``` -------------------------------- ### Create Conda Environment Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/gettingstarted/installation.md Create a new Conda environment with Python 3.9 for Panaroo installation. ```bash conda create -n panaroo python=3.9 ``` ```bash conda activate panaroo ``` -------------------------------- ### Spydrpick Algorithm Help Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/coevolution.md Display help information for the Spydrpick command-line tool, including available arguments and their descriptions. ```bash panaroo-spydrpick --help ``` -------------------------------- ### IMG Model Parameters Help Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/pansize.md This help output lists all available arguments for the panaroo-img command, detailing options for model fitting, rate classes, and initial parameter values. ```bash Estimate model parameters for either the Infinitely Many Genes Model using gene frequencies optional arguments: -h, --help show this help message and exit --tree TREE A dated phylogeny. --pa PRESENCE_ABSENCE A presence/absence produced by Panaroo. -o OUTPUT_DIR, --out_dir OUTPUT_DIR location of an output directory -D {1,2} Number of separate rate classes to use for the dispensable genome. Can be either 1 or 2. --no_essential Removes essential gene class from model --no_constraint Removes constraint that u/v must equal the genome size. --model {coalescent,fixed} Model to fit. Can be one of 'coalescent' or 'fixed'. --fit {cp,gf} Whether to use the gene frequency spectrum or the core/pangenome size for fitting (default=gf) --init_u1 U1 Initial value for u1 (default=0.01). --init_u2 U2 Initial value for u2 (default=0.01). --init_v1 V1 Initial value for v1 (default=0.01). --init_v2 V2 Initial value for v2 (default=0.01). --init_ess GESS Initial value for the number of essential genes (default=2000). --verbose print additional output --version show program's version number and exit ``` -------------------------------- ### Run Panaroo on initial dataset Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/merge/add_single.md This command initializes the Panaroo analysis on a set of GFF files. Ensure the output directory and thread count are specified. ```bash panaroo -i kpII/*.gff -o kp_II_panaroo -t 24 --clean-mode sensitive ``` -------------------------------- ### FMG Model Parameters Help Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/pansize.md This help output displays the arguments for the panaroo-fmg command, including options for bootstrap iterations, threads, and output file naming. ```bash Estimate model parameters for the Finitely Many Genes Model optional arguments: -h, --help show this help message and exit --tree TREE A dated phylogeny. --pa PRESENCE_ABSENCE A presence/absence produced by Panaroo. -o OUTPUTFILE, --outfile OUTPUTFILE Name of outputfile. --nboot NBOOT The number of sub-sampling bootstrap iterations to perform. -t N_CPU, --threads N_CPU number of threads to use (default=1) --verbose print additional output --version show program's version number and exit ``` -------------------------------- ### Basic Panaroo Usage with GFF Files Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/README.md Run Panaroo with standard GFF files from Prokka. Ensure you have a 'results' directory created. ```bash mkdir results panaroo -i *.gff -o results --clean-mode strict ``` -------------------------------- ### Configure Docsify Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/index.html Configure Docsify settings for the project. This includes setting the name, repository link, and enabling the sidebar and cover page. ```javascript window.$docsify = { name: '', repo: '', loadSidebar: true, coverpage: true, // onlyCover: true } ``` -------------------------------- ### Panaroo QC Script Parameters Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/quality/quality_control.md Lists the available command-line arguments for the Panaroo quality control script, including options for threads, graph types, reference databases, and input/output. ```bash Generate quality control plots prior to a Panaroo run optional arguments: -h, --help show this help message and exit -t N_CPU, --threads N_CPU number of threads to use (default=1) --graph_type {contam,ngenes,all,mds,ncontigs} the type of graph to generate (default='all') --ref_db REF_DB reference mash database for contamination quantification. --version show program's version number and exit Input/output: -i INPUT_FILES [INPUT_FILES ...], --input INPUT_FILES [INPUT_FILES ...] input GFF3 files (usually output from running Prokka) -o OUTPUT_DIR, --out_dir OUTPUT_DIR location of an output directory ``` -------------------------------- ### Run Infinitely Many Genes (IMG) model Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/pansize.md Use this command to estimate IMG model parameters. A dated phylogeny and Panaroo's presence/absence table are required inputs. The output directory will store the results. ```bash mkdir img_results panaroo-img --pa gene_presence_absence.Rtab -o img_results -tree dated_phylogeny.newick ``` -------------------------------- ### Build Core Gene Phylogeny with IQ-TREE Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/pwas.md Construct a phylogenetic tree from the core gene alignment generated by Panaroo using IQ-TREE. This command is run from within the 'panaroo_output' directory. ```bash cd panaroo_output iqtree -s core_gene_alignment.aln -pre core_tree -nt 8 -fast -m GTR cd .. ``` -------------------------------- ### Run Spydrpick Algorithm Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/coevolution.md Execute the Spydrpick algorithm using the gene presence/absence file and cluster information. Ensure the output directory is created beforehand. ```bash mkdir coevo_results panaroo-spydrpick -i gene_presence_absence.Rtab -o coevo_results --clusters clusters.csv ``` -------------------------------- ### Prodigal for Training File Generation Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/README.md Generate a training file for Prodigal by running it on a representative genome assembly. This file can then be used with Prokka for consistent gene modeling. ```bash prodigal -t prodigal_training_file -c -m -g 11 -p single -q -i input_file.fasta > /dev/null ``` -------------------------------- ### Run Finitely Many Genes (FMG) model Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/pansize.md Execute this command to estimate FMG model parameters. It requires a dated phylogeny and Panaroo's presence/absence table. The output is saved to a specified file. ```bash panaroo-fmg --tree dated_phylogeny.newick --pa gene_presence_absence_renamed.Rtab -o fmg_results.txt ``` -------------------------------- ### Panaroo Generate GFFs Command Parameters Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/output_gffs.md This section details the command-line arguments for the `generate_gff_files` script, including input/output directories, GFF format options, and thread count. ```bash usage: generate_gff_files [-h] -o OUTPUT_DIR -i INPUT_FILES [INPUT_FILES ...] [-f {gff3,prokka}] [-t N_CPU] [--verbose] Generate GFF annotation files for each isolate from the pan-genome graph optional arguments: -h, --help show this help message and exit -t N_CPU, --threads N_CPU number of threads to use (default=1) --verbose print additional output Input/output: -o OUTPUT_DIR, --out_dir OUTPUT_DIR location of the Panaroo output directory -i INPUT_FILES [INPUT_FILES ...], --input INPUT_FILES [INPUT_FILES ...] input GFF3 files used to run panaroo. These are required Can also take a file listing each gff file line by line. GFFs: -f {gff3,prokka}, --f {gff3,prokka} Output format for the GFF files. 'prokka' with included FASTA, or strict 'gff3'. Default: 'prokka' ``` -------------------------------- ### Run Panaroo Quality Control Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/quality/quality_control.md Execute the Panaroo QC script with specified input GFF3 files, output directory, and number of threads. A reference mash database is required for contamination checks. ```bash mkdir results panaroo-qc -i *.gff -o results -t 3 --graph_type all --ref_db refseq.genomes.k21s1000.msh ``` -------------------------------- ### Generate Simplified GFF Files Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/output_gffs.md Run this command using the same output folder from your initial Panaroo run to generate simplified GFF files. The output will be located in `./panaroo_out/panaroo_gffs/`. ```bash panaroo-generate-gffs -i *.gff -o panaroo_out ``` -------------------------------- ### Panaroo Filter PA Usage Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/filter.md This displays the command-line usage for `panaroo-filter-pa`. It shows the required input file (`-i`) and output directory (`-o`), as well as optional arguments like `--type` to specify filtering criteria. ```bash usage: panaroo_filter_pa [-h] -i INPUT_FILE -o OUTPUT_DIR [--type TYPE] [--version] Filters the Panaroo gene_presence_absence.csv file to exclude sequences classed as length outliers, pseudo genes or fragmented. optional arguments: -h, --help show this help message and exit --type TYPE any combination of 'pseudo', 'length' or 'frag' separated by commas --version show program's version number and exit Input/output: -i INPUT_FILE, --input INPUT_FILE input 'gene_presence_absence.csv' file generated by Panaroo -o OUTPUT_DIR, --out_dir OUTPUT_DIR location of an output directory ``` -------------------------------- ### Prokka with Custom Prodigal Training File Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/README.md Generate annotations using Prokka with a custom Prodigal training file (`--prodigaltf`). This ensures consistent gene modeling across all genomes, applying any biases from the training model to all annotations. ```bash prokka --prodigaltf prodigal_training_file input_file.fasta ``` -------------------------------- ### Panaroo QC Pre-processing Script Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/README.md Utilize the `panaroo-qc` script for preliminary quality checks on input GFF files before running Panaroo. This script requires a reference mash database. ```bash panaroo-qc -t 3 --graph_type all -i *.gff --ref_db refseq.genomes.k21s1000.msh -o results ``` -------------------------------- ### Run Panaroo for Pangenome Analysis Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/pwas.md Execute Panaroo to generate a pangenome from Prokka GFF files. This command processes all GFF files from the 'prokka_output' directory and builds a multiple sequence alignment of core genes using MAFFT. ```bash mkdir panaroo_output panaroo -i ./prokka_output/*/*.gff -o panaroo_output -t 8 --verbose -a core ``` -------------------------------- ### Run Pyseer for Association Analysis Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/pwas.md Perform association analyses using Pyseer. This script first calculates the phylogenetic distance matrix and then iterates through specified antibiotic resistance phenotypes to find gene associations. ```bash python ~/pyseer/scripts/phylogeny_distance.py --lmm ./panaroo_output/core_tree.treefile > pyseer_out/phylogeny_K.tsv for anti in AZM CRO CFM CIP PEN SMX TET do python ~/pyseer/pyseer-runner.py --lmm --phenotypes ./metadata/pathogenwatch-neigo-eurogasp2013-amr-profile-1.tab --pres ./panaroo_output/gene_presence_absence.Rtab --similarity ./pyseer_out/phylogeny_K.tsv --phenotype-column $anti --output-patterns ./pyseer_out/gene_patterns_${anti}.txt > ./pyseer_out/${anti}_gwas.txt done ``` -------------------------------- ### Generate Cut Edges with Reference Genome Layout Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/vis/layout.md Use this script to identify and generate a list of edges that break long-range connections when using a reference genome for layout. The --add_reference_edges flag is recommended to ensure all reference genome connections are preserved. ```bash python ~/repos/panaroo/scripts/reference_based_layout.py 0 final_graph.gml capacity_cut_edges.txt --add_reference_edges ``` -------------------------------- ### Integrate a single genome into an existing Panaroo graph Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/merge/add_single.md Use this command to add a new genome to a previously generated Panaroo graph. Specify the directory of the existing graph, the new genome's GFF file, and the output directory for the updated results. ```bash panaroo-integrate -d kp_II_panaroo/ -i kpIII/5150_1#7.gff -t 24 -o updated_output ``` -------------------------------- ### Run Panaroo on separate datasets Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/merge/merge_graphs.md Execute Panaroo independently on different genome datasets. Use sensitive cleaning mode and ensure all edges are retained in the final graph. ```bash panaroo -i kpII/*.gff -o kp_II_panaroo -t 24 --clean-mode sensitive --no_clean_edges panaroo -i kpIII/*.gff -o kp_III_panaroo -t 24 --clean-mode sensitive --no_clean_edges ``` -------------------------------- ### Explore gene neighbourhood with custom expansion Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/gene_neighbourhood.md Modify the `panaroo-gene-neighbourhood` behavior to explore a different number of genes upstream and downstream from the target gene by adjusting the `--expand_no` parameter. This allows for a more focused or broader analysis of the gene's neighbourhood. ```bash panaroo-gene-neighbourhood --gene metG_2 --graph final_graph.gml --out neighbourhood.txt --expand_no 2 ``` -------------------------------- ### Run Pyseer for Structural Variant Association Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/sv.md This shell script iterates through a list of antibiotics, running Pyseer to find associations between structural variants and phenotypes. It outputs pattern files and WAS results for each antibiotic. ```bash for anti in AZM CRO CFM CIP PEN SMX TET do python ~/pyseer/pyseer-runner.py --lmm --phenotypes ./metadata/pathogenwatch-neigo-eurogasp2013-amr-profile-1.tab --pres ./panaroo_output/struct_presence_absence.Rtab --similarity ./pyseer_out/phylogeny_K.tsv --phenotype-column $anti --output-patterns ./pyseer_out/struct_patterns_${anti}.txt > ./pyseer_out/${anti}_struct_was.txt done ``` -------------------------------- ### Annotate Genomes with Prokka Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/pwas.md Use Prokka to annotate multiple FASTA files of bacterial genomes. This command iterates through each FASTA file in the 'genomes' directory, setting the genus to 'Neisseria' and outputting results to 'prokka_output'. ```bash mkdir prokka_output for fasta in ./genomes/*.fasta do prefix=$(basename ${fasta} .fasta) prokka --cpus 5 --genus Neisseria --usegenus --outdir ./prokka_output/${prefix} --prefix $prefix $fasta done ``` -------------------------------- ### Infinitely Many Genes (IMG) Model Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/pansize.md Estimates model parameters for the Infinitely Many Genes model using gene frequencies. Requires a dated phylogeny and a presence/absence file. ```APIDOC ## panaroo-img ### Description Estimate model parameters for either the Infinitely Many Genes Model using gene frequencies. ### Method Command-line tool ### Endpoint `panaroo-img --pa gene_presence_absence.Rtab -o img_results -tree dated_phylogeny.newick` ### Parameters #### Path Parameters - `--tree` (string) - Required - A dated phylogeny. - `--pa` (string) - Required - A presence/absence file produced by Panaroo. - `-o` or `--out_dir` (string) - Required - Location of an output directory. #### Optional Arguments - `-h`, `--help` - show this help message and exit - `-D` (integer) - Number of separate rate classes to use for the dispensable genome. Can be either 1 or 2. - `--no_essential` - Removes essential gene class from model. - `--no_constraint` - Removes constraint that u/v must equal the genome size. - `--model` (string) - Model to fit. Can be one of 'coalescent' or 'fixed'. - `--fit` (string) - Whether to use the gene frequency spectrum or the core/pangenome size for fitting (default=gf). - `--init_u1` (float) - Initial value for u1 (default=0.01). - `--init_u2` (float) - Initial value for u2 (default=0.01). - `--init_v1` (float) - Initial value for v1 (default=0.01). - `--init_v2` (float) - Initial value for v2 (default=0.01). - `--init_ess` (integer) - Initial value for the number of essential genes (default=2000). - `--verbose` - print additional output. - `--version` - show program's version number and exit ### Request Example ```bash mkdir img_results panaroo-img --pa gene_presence_absence.Rtab -o img_results -tree dated_phylogeny.newick ``` ### Response Output files containing estimated model parameters will be generated in the specified output directory. ``` -------------------------------- ### Run Panaroo with edge filtering disabled Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/gene_neighbourhood.md Execute Panaroo with the `--no_clean_edges` flag to disable edge filtering. This is useful for examining all edges in the graph, including those that might be artifacts of misassemblies, providing a more complete view of the graph structure. ```bash panaroo -i *.gff -o output_panaroo/ --clean-mode strict -t 24 --no_clean_edges ``` -------------------------------- ### Panaroo in Sensitive Mode Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/README.md Run Panaroo in sensitive mode to retain a higher proportion of genes, including rare plasmids, at the potential expense of increased contamination. This mode is less conservative than the default. ```bash panaroo -i *.gff -o results --clean-mode sensitive ``` -------------------------------- ### Finitely Many Genes (FMG) Model Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/pansize.md Estimates model parameters for the Finitely Many Genes model. Requires a dated phylogeny and a presence/absence file. ```APIDOC ## panaroo-fmg ### Description Estimate model parameters for the Finitely Many Genes Model. ### Method Command-line tool ### Endpoint `panaroo-fmg --tree dated_phylogeny.newick --pa gene_presence_absence_renamed.Rtab -o fmg_results.txt` ### Parameters #### Path Parameters - `--tree` (string) - Required - A dated phylogeny. - `--pa` (string) - Required - A presence/absence file produced by Panaroo. - `-o` or `--outfile` (string) - Required - Name of the output file. #### Optional Arguments - `-h`, `--help` - show this help message and exit - `--nboot` (integer) - The number of sub-sampling bootstrap iterations to perform. - `-t` or `--threads` (integer) - Number of threads to use (default=1). - `--verbose` - print additional output. - `--version` - show program's version number and exit ### Request Example ```bash panaroo-fmg --tree dated_phylogeny.newick --pa gene_presence_absence_renamed.Rtab -o fmg_results.txt ``` ### Response Output file containing estimated model parameters will be generated with the specified name. ``` -------------------------------- ### Find all paths through a gene Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/gene_neighbourhood.md Use `panaroo-gene-neighbourhood` to find all unique paths that traverse a specified gene in the genome graph. This helps in understanding structural variations and supported paths. ```bash panaroo-gene-neighbourhood --gene metG_2 --graph final_graph.gml --out neighbourhood.txt ``` -------------------------------- ### Align Core Genome with Clustal Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/gettingstarted/params.md Aligns core genes using Clustal, specifying the core genome and number of CPUs. Ensure input GFF files are provided. ```bash panaroo -i *.gff -o ./results/ --clean-mode strict -a core --aligner clustal --core_threshold 0.98 -t 10 ``` -------------------------------- ### Count Patterns for False Discovery Analysis Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/sv.md This Python script counts the number of patterns found by Pyseer, which is necessary for calculating the false discovery rate threshold. ```python python ~/pyseer/scripts/count_patterns.py ./pyseer_out/struct_patterns_AZM.txt ``` -------------------------------- ### Merge Panaroo graphs Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/merge/merge_graphs.md Merge the pangenome graphs generated from independent Panaroo runs. This command takes the output directories of previous Panaroo runs as input. ```bash mkdir kp_merge panaroo-merge -d kp_II_panaroo/ kp_III_panaroo/ -o kp_merge -t 24 ``` -------------------------------- ### Merge Paralogs Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/gettingstarted/params.md Enables the merging of paralogs into separate clusters. Use this option when paralogs should be treated as a single gene family. ```bash panaroo -i *.gff -o ./results/ --clean-mode strict --merge_paralogs ``` -------------------------------- ### Adjust Gene Family Collapse Threshold Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/gettingstarted/params.md Runs Panaroo with a relaxed family sequence identity threshold of 50%. Adjusts the level at which genes are collapsed into putative families. ```bash panaroo -i *.gff -o ./results/ --clean-mode strict -f 0.5 ``` -------------------------------- ### Summarize Rearrangement Results in R Source: https://github.com/gtonkinhill/panaroo/blob/master/docs/post/sv.md This R code aggregates structural variant association results across multiple antibiotics, filters for significant p-values, removes duplicates, and saves the annotated top results to a CSV file. ```r gono_struct_was <- do.call(rbind, map(antibiotics, function(ant){ tbl <- fread(paste(c("./gono_harris_gwas/",ant,"_struct_was.txt"), collapse = ""), data.table = FALSE) tbl$antibiotic <- ant return(tbl) })) gono_struct_was <- gono_struct_was[order(gono_struct_was$`lrt-pvalue`),] gono_struct_was <- gono_struct_was[!grepl("bad-chisq", gono_struct_was$notes),] # threshold form running count_patterns in pyseer sig_threshold <- 0.05/(3239*length(antibiotics)) sum(gono_struct_was$`lrt-pvalue`