align_DNA_fasta: Align an input fasta file with Muscle

View source: R/fasta_utils.R

align_DNA_fastaR Documentation

Align an input fasta file with Muscle

Description

This function is a wrapper to circumvent 2 annoying issues that the msa package has when aligning a fasta sequence, namely not being able to sort the output fasta gapped file as the input sequences and not being able to write to fasta file.

Usage

align_DNA_fasta(input_path, output_path, ...)

Arguments

input_path

A path to a fasta file you want to import and align with MUSCLE.

output_path

A file path to where you want to save the aligned fasta file. If omitted a DNAStringSet is returned.

...

other parameters passed to msa::msaMuscle().

Details

This function only aligns DNA fasta files using an R implementation of the muscle multiple sequences aligner. MUSCLE is claimed to achieve both better average accuracy and better speed than ClustalW2 or T-Coffee, depending on the chosen options (as stated here).

Value

A DNAStringSet. If output_path is specified it writes to file.

Examples

# Input file
dna_fasta_path <- file.path(seqs_dir, "DNA/All_Seq.fasta")
# Output
dna_alg_path <- file.path(seqs_dir, "Alignments/All_Seq_Ordered_as_Input.afa")

align_DNA_fasta(input_path = dna_fasta_path, output_path = dna_alg_path)

Ni-Ar/niar documentation built on Feb. 3, 2025, 9:25 a.m.