mafft_wrap: Wrapper Function for MAFFT

View source: R/Sero_Placement_Functions.R

mafft_wrapR Documentation

Wrapper Function for MAFFT

Description

Creates an R interface for using the command line tool MAFFT in an R environment. It is required that MAFFT is initially installed on the machine. Installation instructions for MAC OS X and Windows can be located at <https://mafft.cbrc.jp/alignment/software/source.html>. The installation path should be noted and may be needed as a variable in the wrapper function. This wrapper is a more specific implementation of MAFFT which will take the user's input query sequences and align them to a previously aligned reference sequence database. The input sequences will be aligned with their lengths adjusted to match the reference multiple sequence alignment (MSA). The input sequences will then be appended to the end of the MSA for use in downstream analysis. This wrapper is not currently designed to include all options contained in MAFFT since our implementation requires a specific set of parameters to be used. The code we used for this package is modified from similar wrapper functions from the R package "ips" by Christoph Heibl. We thank the previous authors for this work and have built upon their wrapper functions for mafft and epa-ng in this software.

Usage

mafft_wrap(Reference, Query, exec, options, file, add)

Arguments

Reference

An organism name (currently accepts "Salmonella" or "E.coli") which lets the function know which reference file to select. The reference sequence files are provided as part of the package.

Query

A set of amplicon sequencing variants (ASVs) representing the 7 16S alleles. These are the query sequences which will be aligned to the multiple sequence alignment in x.

exec

(Optional) The path on the machine in which the MAFFT program is installed. This path will default to the default installation path if left blank (/usr/local/bin/mafft).

options

(Optional) Option settings which can be passed to the MAFFT command. The default setting will add the option –keeplength. This option is required for this analysis, as it will ensure that the length of the sequences in the multiple sequence alignment is not changed after the addition of the user's query sequences.

file

(Optional) A path to which the output FASTA should be saved. If left blank, the wrapper function will output the resulting FASTA as an R environment object.

add

Attaches the –add argument to the MAFFT command, setting the program to append the user's query sequences to the provided reference multiple sequence alignment. This command is required for merging the query sequences into the reference FASTA file. If left blank this will by default use the –add argument.

Value

A multiple sequence alignment in FASTA format containing the reference sequences and the aligned query sequences appended as the last sequences in the file. The sequences in this alignment will be identical in length to the original reference multiple sequence alignment.

Examples

Output_FASTA<-mafft_wrap(Reference = "Salmonella", y = Query.fasta, options = "--keeplength")

Dogrinev/Seroplacer documentation built on Jan. 28, 2024, 11:26 p.m.