### Installation and Verification Source: https://context7.com/ncbi/amr/llms.txt Instructions to install and verify the AMRFinderPlus setup, including running the test suite and checking dependencies. ```APIDOC ## Test Installation ### Verify AMRFinderPlus Setup Run test suite to verify correct installation and database functionality. ```bash # Download test script curl -O https://raw.githubusercontent.com/ncbi/amr/master/test_amrfinder.sh # Test AMRFinderPlus in PATH (bioconda install) bash test_amrfinder.sh -p # Test local binary bash test_amrfinder.sh # Verify dependencies blastp -help | head -5 hmmsearch -h | head -5 # Expected success output: # Success! ``` ``` -------------------------------- ### Compile and Install AMRFinder Source: https://github.com/ncbi/amr/wiki/Compile-AMRFinder-from-source Commands to compile the source code and install the resulting executables. The installation directory can be customized using the INSTALL_DIR variable. ```bash make ``` ```bash make install ``` ```bash make install INSTALL_DIR=$HOME/amrfinder ``` -------------------------------- ### Install Miniconda on Linux Source: https://github.com/ncbi/amr/wiki/Install-with-bioconda Downloads and executes the Miniconda installer script for Linux x86_64 systems. Users must follow the interactive prompts to complete the installation and update their shell configuration. ```bash curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh bash ./Miniconda3-latest-Linux-x86_64.sh ``` -------------------------------- ### Verify AMRFinderPlus Installation and Setup Source: https://context7.com/ncbi/amr/llms.txt This section details how to verify the correct installation of AMRFinderPlus and its database functionality by running a test suite and checking essential dependencies like BLAST and HMMER. It includes commands for downloading the test script and executing it for both bioconda and local installations. ```bash curl -O https://raw.githubusercontent.com/ncbi/amr/master/test_amrfinder.sh bash test_amrfinder.sh -p bash test_amrfinder.sh blastp -help | head -5 hmmsearch -h | head -5 ``` -------------------------------- ### Verify Dependency Installation Source: https://github.com/ncbi/amr/wiki/Test-your-installation Checks if BLAST and HMMER binaries are correctly installed and accessible in the system path by invoking their help commands. ```bash blastp -help hmmsearch -h ``` -------------------------------- ### Install Miniconda on MacOS Source: https://github.com/ncbi/amr/wiki/Install-with-bioconda Downloads and executes the Miniconda installer script for MacOS systems. Users must follow the interactive prompts to complete the installation and update their shell configuration. ```bash curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh bash ./Miniconda3-latest-MacOSX-x86_64.sh ``` -------------------------------- ### Install AMRFinderPlus Prerequisites Source: https://github.com/ncbi/amr/wiki/Install-with-binary Uses Conda to install the required BLAST, HMMER, and libcurl dependencies in a single command. ```bash conda install -y blast hmmer libcurl ``` -------------------------------- ### Download and Setup AMRFinderPlus Binary Source: https://github.com/ncbi/amr/wiki/Install-with-binary Automated script to fetch the latest AMRFinderPlus binary release from GitHub, extract the files, and update the database. ```bash mkdir amrfinder cd amrfinder URL=`curl -s https://api.github.com/repos/ncbi/amr/releases/latest | grep "browser_download_url.*amrfinder_binaries" | cut -d '"' -f 4` curl -sOL "$URL" filename=`basename $URL` tar xvfz $filename ./amrfinder -u ``` -------------------------------- ### Install AMRFinderPlus via Bioconda Source: https://context7.com/ncbi/amr/llms.txt Sets up a dedicated Conda environment, installs the AMRFinderPlus package, and initializes the required reference database. ```bash conda create -y -c conda-forge -c bioconda -n amrfinder --strict-channel-priority ncbi-amrfinderplus source ~/miniconda3/bin/activate amrfinder amrfinder -u amrfinder --version ``` -------------------------------- ### Install Miniconda on MacOS Source: https://github.com/ncbi/amr/wiki/BioConda-installation Downloads and executes the Miniconda installer script for MacOS systems. This script sets up the environment to allow for bioconda package management. ```bash curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOS-x86_64.sh bash ./Miniconda3-latest-MacOS-x86_64.sh ``` -------------------------------- ### Test AMRFinderPlus Custom Database Installation Source: https://github.com/ncbi/amr/wiki/amrfinder_customize This command runs a test to verify the correct installation and configuration of the custom database for AMRFinderPlus. It ensures that the database can be built and queried successfully. ```bash make test_customdb ``` -------------------------------- ### Download and Run AMRFinderPlus Tests Source: https://github.com/ncbi/amr/wiki/Test-your-installation Downloads the test script from the repository and executes it to verify the installation. The -p flag tests the version currently in the system PATH. ```bash BASE_URL=https://raw.githubusercontent.com/ncbi/amr/master curl --silent --location -O ${BASE_URL}/test_amrfinder.sh bash test_amrfinder.sh -p ``` -------------------------------- ### Configure Bioconda Environment Source: https://github.com/ncbi/amr/wiki/Install-with-binary Commands to download and install Miniconda and configure the necessary channels for Bioconda to manage software dependencies. ```bash curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh bash ./Miniconda3-latest-Linux-x86_64.sh export PATH=$HOME/miniconda3/bin:$PATH conda config --add channels defaults conda config --add channels bioconda conda config --add channels conda-forge ``` -------------------------------- ### Filter AMRFinderPlus Output by Column Value (Awk) Source: https://github.com/ncbi/amr/wiki/Tips-and-tricks This example demonstrates how to filter AMRFinderPlus output using awk based on specific column values. It shows a general pattern for filtering and a specific example for extracting 'core' genes from column 8 or beta-lactam resistance genes from column 11. It requires knowledge of the column number and the value to filter by. ```awk awk -F'\t' 'NR == 1 || $ == "" { print }' ``` ```awk # filter for beta-lactam resistance elements awk -F'\t' 'NR == 1 || $11 == "BETA-LACTAM" { print }' test_both.expected ``` -------------------------------- ### Install AMRFinder via Conda Source: https://github.com/ncbi/amr/wiki/BioConda-installation Installs the ncbi-amr package and all required dependencies using the conda package manager. ```bash conda install ncbi-amr ``` -------------------------------- ### AMRFinderPlus: Print Command-Line Options Source: https://github.com/ncbi/amr/wiki/New-in-AMRFinderPlus This command displays a list of all available command-line options for the AMRFinderPlus tool, helping users understand its capabilities and parameters. ```bash amrfinder --help ``` -------------------------------- ### Install AMRFinderPlus via Bioconda Source: https://github.com/ncbi/amr/wiki/Install-with-bioconda Creates a dedicated conda environment named 'amrfinder' and installs the ncbi-amrfinderplus package with strict channel priority. This ensures all dependencies are correctly managed. ```bash source ~/miniconda3/bin/activate conda create -y -c conda-forge -c bioconda -n amrfinder --strict-channel-priority ncbi-amrfinderplus ``` -------------------------------- ### Update AMRFinderPlus Source: https://github.com/ncbi/amr/wiki/Install-with-bioconda Updates the existing AMRFinderPlus installation to the latest version available in the configured channels. ```bash conda update -y -c conda-forge -c bioconda --strict-channel-priority ncbi-amrfinderplus ``` -------------------------------- ### Version Information Source: https://github.com/ncbi/amr/wiki/Running-AMRFinderPlus Prints the software version. Use -V for more complete information. ```APIDOC ## --version ### Description Print out just the software version. For more complete information, it is recommended to use the `-V` command. ### Method --version or -v ### Endpoint N/A (Command-line option) ### Parameters N/A ### Request Example ```bash amrfinder.pl --version ``` ### Response N/A (Command-line option) ``` -------------------------------- ### List Supported Organisms Source: https://context7.com/ncbi/amr/llms.txt Displays all taxa supported for organism-specific point mutation detection and gene filtering. ```bash amrfinder -l ``` -------------------------------- ### GET /reference-gene-hierarchy Source: https://github.com/ncbi/amr/wiki/AMRFinderPlus-database Retrieves the hierarchical data structure used for gene identification, including node relationships, symbols, and classification metadata. ```APIDOC ## GET /reference-gene-hierarchy ### Description Retrieves the tab-delimited hierarchy of genes, families, and upstream nodes used by AMRFinderPlus for identification and naming. ### Method GET ### Endpoint /reference-gene-hierarchy ### Parameters #### Query Parameters - **scope** (string) - Optional - Filter by 'core' (AMR-specific) or 'plus' (stress/virulence) data subsets. - **type** (string) - Optional - Filter by protein/mutation type (AMR, STRESS, VIRULENCE). ### Request Example GET /reference-gene-hierarchy?scope=core ### Response #### Success Response (200) - **node_id** (string) - Unique node identifier. - **parent_node_id** (string) - Identifier for the parent node. - **symbol** (string) - Gene symbol reported by AMRFinderPlus. - **hmm_acc** (string) - HMM accession number. - **scope** (string) - Data subset (core/plus). - **class** (string) - Broad phenotype definition. - **subclass** (string) - Specific antibiotic or phenotypic class. #### Response Example { "node_id": "NG_047348.1", "parent_node_id": "NG_047348", "symbol": "blaCTX-M-15", "scope": "core", "type": "AMR", "class": "BETA-LACTAM", "subclass": "CEPHALOSPORIN" } ``` -------------------------------- ### Upgrade AMRFinderPlus from Source Source: https://github.com/ncbi/amr/wiki/Upgrading Commands to pull the latest source code and recompile the software. ```bash git pull git submodule update make clean make ``` -------------------------------- ### Upgrade AMRFinderPlus via Bioconda Source: https://github.com/ncbi/amr/wiki/Upgrading Commands to upgrade the AMRFinderPlus package using Conda. Includes standard update and forced version installation. ```bash source ~/miniconda3/bin/activate conda update -c conda-forge -c bioconda ncbi-amrfinderplus conda install -c conda-forge -c bioconda ncbi-amrfinderplus= ``` -------------------------------- ### Manage Custom Databases Source: https://context7.com/ncbi/amr/llms.txt Commands for using specific database versions, indexing custom directories, and updating the AMRFinderPlus database location. ```bash amrfinder -p proteins.fa --database /path/to/data/2024-01-31.1 amrfinder_index /path/to/custom/database/2024-01-31.1 amrfinder_update --database /custom/amrfinder/data ``` -------------------------------- ### Support for Annotation Formats Source: https://context7.com/ncbi/amr/llms.txt Commands demonstrating how to specify the input annotation format when parsing GFF files from different pipelines like Prokka, RAST, Bakta, and PGAP. ```bash amrfinder -p sample.faa -g sample.gff -n sample.fna --annotation_format prokka amrfinder -p sample.faa -g sample.gff -n sample.fna --annotation_format rast amrfinder -p sample.faa -g sample.gff3 -n sample.fna --annotation_format bakta amrfinder -p annot.faa -g annot.gff -n annot.fna --annotation_format pgap ``` -------------------------------- ### AMRFinderPlus: Download Latest Database Source: https://github.com/ncbi/amr/wiki/New-in-AMRFinderPlus This command initiates the download of the most recent compatible database for AMRFinderPlus. It is crucial for ensuring accurate and up-to-date analysis, especially after version upgrades. ```bash amrfinder -u ``` -------------------------------- ### Run AMRFinderPlus with Sample Data Source: https://github.com/ncbi/amr/wiki/Running-AMRFinderPlus This command executes AMRFinderPlus using specified protein and GFF files, along with a DNA FASTA file, and targets a specific organism. It demonstrates the typical command-line interface for the tool. ```bash amrfinder -p test_prot.fa -g test_prot.gff -n test_dna.fa -O Campylobacter ``` -------------------------------- ### Advanced Options Source: https://context7.com/ncbi/amr/llms.txt Details on how to configure performance and output for AMRFinderPlus using various command-line options. ```APIDOC ## Advanced Options ### Performance and Output Tuning Configure threads, identity thresholds, and additional output options. ```bash # Multi-threaded analysis (default: 4) amrfinder -n assembly.fa --threads 16 # Custom identity threshold (default: curated or 0.9) amrfinder -p proteins.fa --ident_min 0.8 # Custom coverage threshold (default: 0.5) amrfinder -p proteins.fa --coverage_min 0.6 # Report all equally-scoring matches amrfinder -p proteins.fa --report_all_equal # Add hierarchy node column to output amrfinder -p proteins.fa --print_node # Extract identified proteins to FASTA amrfinder -p proteins.fa --protein_output identified_proteins.fa # Quiet mode (suppress status messages) amrfinder -p proteins.fa -q -o results.tsv # Custom translation table for BLASTX (default: 11) amrfinder -n assembly.fa --translation_table 4 ``` ``` -------------------------------- ### AMRFinderPlus Core Usage Source: https://github.com/ncbi/amr/wiki/Running-AMRFinderPlus Basic command structure for running AMRFinderPlus with required input files. ```APIDOC ## AMRFinderPlus Core Usage ### Description This section describes the fundamental command-line arguments for running AMRFinderPlus, specifying either protein or nucleotide sequence input. ### Method Command Line Tool ### Endpoint `amrfinder (-p | -n ) [options]` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example `amrfinder -p proteins.fasta` `amrfinder -n nucleotides.fasta` ### Response #### Success Response (200) Output detailing identified AMR genes, their locations, and associated information. #### Response Example (Output varies based on input and database) ``` -------------------------------- ### Enable Plus Genes and Virulence Factors Source: https://context7.com/ncbi/amr/llms.txt Commands to include additional gene categories such as virulence factors, biocide, heat, acid, and metal resistance in the analysis results. ```bash amrfinder -p proteins.fa --plus amrfinder -p proteins.fa -g annotation.gff -n assembly.fa -O Escherichia --plus -o results_with_plus.tsv ``` -------------------------------- ### Commonly Used Options Source: https://github.com/ncbi/amr/wiki/Running-AMRFinderPlus Detailed explanation of frequently used command-line options for AMRFinderPlus. ```APIDOC ## Commonly Used Options ### Description This section details various options available for customizing AMRFinderPlus analysis, including input file types, organism specificity, and output formatting. ### Method Command Line Tool ### Endpoint `amrfinder [options]` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example `amrfinder -p proteins.fasta -g annotation.gff -O Escherichia` `amrfinder -n genome.fasta --plus` `amrfinder -V` `amrfinder -l` ### Response #### Success Response (200) Results of the analysis or requested information (e.g., organism list, version info). #### Response Example (Varies based on the option used. For `-l`, a list of organisms is printed. For `-V`, version information is printed to STDERR.) ### Options Details: - `--protein ` or `-p `: Protein FASTA file to search. - `--nucleotide ` or `-n `: Assembled nucleotide FASTA file to search. Use genomic sequence when running in combined mode. - `--gff ` or `-g `: GFF file for sequence coordinates. Required for combined protein and nucleotide searches. The 'Name=' field in GFF must match protein FASTA identifiers. The first column of GFF must match nucleotide FASTA identifiers. - `--organism ` or `-O `: Taxon for screening known resistance-causing point mutations and blacklisting non-informative genes. Use `amrfinder -l` to list possible values. - `--list_organisms` or `-l`: Prints the list of all possible taxonomy groups for the `-O/--organism` option. - `--update` or `-u`: Downloads the latest AMRFinderPlus database to the default location. - `--force_update` or `-U`: Downloads the latest AMRFinderPlus database and overwrites any existing directory. - `--plus`: Includes results from "Plus" genes such as virulence factors and stress-response genes. - `--database_version` or `-V`: Prints complete version information for both the database and software. This option should appear alone. - `--print_node`: Adds an additional "Hierarchy node" column to the output with the node identifier used in the AMRFinderPlus reference gene hierarchy. ``` -------------------------------- ### Run amrfinder_customize to Build Custom Database Source: https://github.com/ncbi/amr/wiki/amrfinder_customize This command executes the `amrfinder_customize` tool to build or update the AMRFinderPlus database with custom genetic information. It requires input FASTA and metadata files and specifies output database locations. ```bash amrfinder_customize --database_in data/latest --database_out data/customdb --prot custom.fa --metadata custom.meta ``` -------------------------------- ### Run AMRFinderPlus and Combine Results (Bash) Source: https://github.com/ncbi/amr/wiki/Tips-and-tricks This script combines the functionality of running AMRFinderPlus on multiple files and then combining their results. It uses a bash loop to process each .assembly.fa file, adding an assembly identifier using the --name option, and then concatenates the results into a combined.tsv file, similar to the previous combination script. ```bash for assembly in *.assembly.fa do base=$(basename $assembly .assembly.fa) # note that we use the --name option to add the "base" as the first # column of the output amrfinder -n $assembly --threads 8 --plus --name=$base > $base.amrfinder done head -1 $(ls *.amrfinder | head -1) > combined.tsv grep -h -v 'Protein identifier' *.amrfinder >> combined.tsv ``` -------------------------------- ### AMR Project Configuration Options Source: https://github.com/ncbi/amr/wiki/Running-AMRFinderPlus This section outlines the various command-line options available for configuring the AMR project, including parameters for similarity cutoffs, gene coverage, translation tables, and specific pipeline integrations. ```APIDOC ## AMR Project Configuration Options ### Description This section outlines the various command-line options available for configuring the AMR project, including parameters for similarity cutoffs, gene coverage, translation tables, and specific pipeline integrations. ### Parameters #### Similarity Threshold - `--similarity_cutoff <0-1>` or `-s <0-1>`: Minimum similarity proportion for a BLAST-based hit (Methods BLAST or PARTIAL). -1 means use the curated threshold if it exists and 0.9 otherwise. Setting this value to something other than -1 will override curated similarity cutoffs. We only recommend using this option if you have a specific reason; don't make our curators sad by throwing away some of their hard work. #### Minimum Gene Coverage - `--coverage_min <0-1>` or `-c <0-1>`: Minimum proportion of reference gene covered for a BLAST-based hit (Methods BLAST or PARTIAL). Default value is 0.5 #### Translation Table - `--translation_table <1-33>` or `-t <1-33>`: Number from 1 to 33 to represent the translation table used for BLASTX. Default is 11. See [Translation table description](https://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi) for a description of the available tables. #### Pipeline Specific Options - `--pgap`: Alters the GFF and FASTA file handling to correctly interpret the output of the pgap pipeline. Note that you should use the `annot.fna` file in the pgap output directory as the argument to the `-n/--nucleotide` option. - `--gpipe_org`: Use Pathogen Detection taxgroup names as arguments to the --organism option. #### Debugging and Development - `--parm `: Pass additional parameters to amr_report. This is mostly used for development and debugging. - `--debug`: Perform some additional integrity checks. May be useful for debugging, but not intended for public use. ``` -------------------------------- ### Batch Processing and Matrix Generation Source: https://context7.com/ncbi/amr/llms.txt Automate analysis across multiple assembly files and aggregate results into a single file or a presence/absence matrix. ```bash for assembly in *.assembly.fa; do base=$(basename "$assembly" .assembly.fa) amrfinder -n "$assembly" --threads 8 --plus --name "$base" > "${base}.amrfinder" done head -1 $(ls *.amrfinder | head -1) > combined.tsv grep -h -v 'Protein identifier' *.amrfinder >> combined.tsv perl amr2matrix.pl *.amrfinder > matrix.tsv ``` -------------------------------- ### Blast Bin Directory Source: https://github.com/ncbi/amr/wiki/Running-AMRFinderPlus Specifies a directory to search for third-party binaries like blast and hmmer if they are not found in the system's PATH. ```APIDOC ## --blast_bin ### Description Specifies a directory to search for 3rd party binaries (blast and hmmer) if they are not in the system's PATH. ### Method --blast_bin ### Endpoint N/A (Command-line option) ### Parameters #### Query Parameters - **directory** (string) - Required - The path to the directory containing the binaries. ### Request Example ```bash amrfinder.pl --blast_bin /path/to/blast/bin ... ``` ### Response N/A (Command-line option) ``` -------------------------------- ### Run Combined Protein and Nucleotide Analysis Source: https://context7.com/ncbi/amr/llms.txt Executes a comprehensive analysis using both protein and nucleotide inputs, with support for specific annotation formats and sample labeling. ```bash amrfinder -p proteins.fa -g annotation.gff -n assembly.fa -O Escherichia --plus -o results.tsv ``` -------------------------------- ### AMRFinderPlus Advanced Options: Performance and Output Tuning Source: https://context7.com/ncbi/amr/llms.txt This snippet demonstrates various command-line options for AMRFinderPlus to customize analysis performance and output format. It covers multi-threaded analysis, custom identity and coverage thresholds, reporting all equally-scoring matches, adding hierarchy nodes, extracting identified proteins, enabling quiet mode, and specifying custom translation tables. ```bash # Multi-threaded analysis (default: 4) amrfinder -n assembly.fa --threads 16 # Custom identity threshold (default: curated or 0.9) amrfinder -p proteins.fa --ident_min 0.8 # Custom coverage threshold (default: 0.5) amrfinder -p proteins.fa --coverage_min 0.6 # Report all equally-scoring matches amrfinder -p proteins.fa --report_all_equal # Add hierarchy node column to output amrfinder -p proteins.fa --print_node # Extract identified proteins to FASTA amrfinder -p proteins.fa --protein_output identified_proteins.fa # Quiet mode (suppress status messages) amrfinder -p proteins.fa -q -o results.tsv # Custom translation table for BLASTX (default: 11) amrfinder -n assembly.fa --translation_table 4 ``` -------------------------------- ### Perform Nucleotide Sequence Analysis Source: https://context7.com/ncbi/amr/llms.txt Analyzes assembled nucleotide FASTA files using translated BLASTX, supporting multi-threading and nucleotide sequence extraction. ```bash amrfinder -n assembly.fa -O Campylobacter --threads 8 --nucleotide_output identified_regions.fa ```