Implementation

The heavy lifting of sequence analyses are done by the following third party programs. They should be installed on your computer:

vtamR has been tested using the above mentioned versions, but it should work with later versions.

vtamR was tested on Windows and Linux, and should work in all operating systems.

Install vtamR

Install vtamR and its CRAN dependencies by pak.

if(!requireNamespace("pak", quietly = TRUE)) install.packages("pak")
pak::pkg_install("meglecz/vtamR", dependencies=TRUE)

Alternatively, you can use devtools.

if (!requireNamespace("devtools", quietly = TRUE)) install.packages("devtools")
devtools::install_github("meglecz/vtamR", dependencies = TRUE)

Install Bioconductor packages manually if you intend to use TaxAssignRDP function.

# Install Bioconductor suggested packages manually if needed (only for TaxAssignRDP)
if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager")
if (!requireNamespace("rRDP", quietly = TRUE)) BiocManager::install("rRDP")
if (!requireNamespace("rRDPData", quietly = TRUE)) BiocManager::install("rRDPData")
if (!requireNamespace("Biostrings", quietly = TRUE)) BiocManager::install("Biostrings")

Read the Manual on how to construct a full metabarcoding pipeline.

Install third party programs

Linux

Add the executables to your PATH

This step is optional. If third-party executables are included in your PATH, you won’t need to manually specify their locations when running functions that use them.

If you prefer not to modify your PATH, be sure to provide the full path to each program using the corresponding vtamR function argument (e.g., vsearch_path).

  1. Edit (or create) your ~/.Renviron file
nano ~/.Renviron
  1. Add the directory to the PATH
PATH="/home/user/tools/myprogram/bin:${PATH}"

Note: The PATH must contain a directory, not an executable file. For example, use: /home/username/miniconda3/envs/vtamr/bin and not: /home/username/miniconda3/envs/vtamr/bin/cutadapt

  1. Restart R or RStudio

The new PATH is loaded at startup.

  1. Verify that R sees the correct executables
system("cutadapt --version")
system("swarm --version")
system("vsearch --version")
system("blastn -version")
system("pigz --version")

Windows

Download binaries and save them to a convenient place on your computer (path without space, e.g. C:/Users/Public/)

VSEARCH

CUTADAPT

SWARM

BLAST

  • Download the installer (ncbi-blast-x.xx.x+-win64.exe) from: https://ftp.ncbi.nlm.nih.gov/blast/executables/LATEST/
  • Double-click the .exe file, accept the license agreement, and keep the suggested installation path. This will automatically add BLAST to your system PATH, so you won’t need to specify its location when using it.
  • The executables will be installed in: C:\Program Files\NCBI\blast-x.xx.x+\bin

VSEARCH (Optional)

  • Download pigz-win32.zip
  • Decompress the zip file
  • The executable (pigz.exe) is in the pigz-win32 directory

Add executables to your PATH

This step is optional. If third-party executables are included in your system PATH, you won’t need to manually specify their locations when running functions that use them.

If you prefer not to add them, make sure to provide the full path to each program through the appropriate vtamR function argument (e.g., vsearch_path).

You can use either GUI or PowerShell to add executables to your PATH.

  1. Using the Windows GUI (System Settings)
  • Press Win + R, type sysdm.cpl, and press Enter. (Opens System Properties.)
  • Go to the Advanced tab.
  • Click Environment Variables…
  • In the System variables section, find and select Path.
  • Click Edit…
  • Click New, then paste the directory you want to add (for example: C:\Users\YourName\Tools\bin)
  • Click OK on all windows to save.
  1. Using PowerShell
  • Press Win + R, type powershell, and press Enter. (Opens Powershell)
setx PATH "$($env:Path);C:\My\New\Folder\vsearch:C:\My\New\Folder\cutadapt;C:\My\New\Folder\pigz;C:\My\New\Folder\swarm"
  • Close de Powershell, since the change applies only to new terminals, not the current one.

Verify Program Versions

Open a Command Prompt on Windows (Win + R, type cmd)

cutadapt --version
swarm --version
vsearch --version
pigz --version
blastn -version

Note These commands will display the version of each program if the executables are in your PATH. Otherwise, don’t forget to provide the full path to the executables.

Example:

C:/Users/Public/vsearch-x.xx.x-win-x86_64/bin/vsearch --version

TaxAssign reference data base

TaxAssignLTG

For TaxAssignLTG (BLAST based Lowest Common Ancestor method), a ready-to-use COI database is available from OSF OSF, (Meglécz, 2023).

Download and extract using:

library(vtamR)

download_osf(filename = "COInr_for_vtam_2025_05_23_dbV5.tar.gz",
    url = "https://osf.io/download/jyhz6/",
    dest_dir = "COInr_db",
    untar = TRUE,
    quiet = FALSE
    )

To check for newer versions:

Alternatively, you can also create a custom version from the TSV format database available at Zenodo and make a custom version using mkCOInr (Meglécz, 2023).

For other markers you will need a database formatted to BLAST, containing taxIDs and a taxonomy file. If all sequences are extracted from NCBI-nt, the taxonomy file provided in OSF can be used without modification.

TaxAssignRDP

TaxAssignRDP function uses de RDP algorithm to assign bacterial 16S sequences. The database is provided in the rRDPData R data package.

It is also possible to provide to provide a trained classifier object created with trainRDP().