Skip to content

Perform Sequence Alignment Using MUMmer ​

This function orchestrates the alignment of sequences in a specified directory using MUMmer, a tool for aligning large DNA or protein sequences. It can handle GenBank and FASTA file formats. and performs checks to ensure necessary files are present.

Usage ​

r
mummer_alignment(
  path,
  cluster = NULL,
  maptype = "many-to-many",
  seqtype = "protein",
  mummer_options = "",
  filter_options = "",
  remove_files = TRUE,
  output_dir = tempdir()
)

Arguments ​

ArgumentDescription
pathThe directory containing the sequence files. Its path may contain spaces; the names of the files may not.
clusterOptional vector of cluster names to consider for alignment. If NULL, clusters are inferred from file names. The order of names determines the alignment sequence.
maptypeThe type of mapping to perform; "many-to-many" or "one-to-one". "many-to-many" allows for multiple matches between clusters, "one-to-one" restricts alignments to unique matches between a pair.
seqtypeThe type of sequences, either "protein" or "nucleotide".
mummer_optionsAdditional command line options for MUMmer. To see all available options, you can run nucmer --help or promer --help in the terminal depending on whether you are aligning nucleotide or protein sequences.
filter_optionsAdditional options for filtering MUMmer results. To view all filtering options, run delta-filter --help in the terminal.
remove_filesLogical indicating whether to remove intermediate files generated during the process, defaults to TRUE.
output_dirParent directory for a unique working subdirectory, without spaces in its path (MUMmer cannot use it otherwise); defaults to tempdir(). With remove_files = FALSE, copied inputs and alignment files are retained in that subdirectory.

Value ​

A data frame combining all alignment results, or NULL if errors occur during processing.

References ​

Kurtz S, Phillippy A, Delcher AL, Smoot M, Shumway M, Antonescu C, Salzberg SL (2004). Versatile and open software for comparing large genomes. Genome Biology, 5(R12).

Examples ​

r
## Not run:
# Requires the external MUMmer programs (nucmer or promer, delta-filter and
# show-coords) on the PATH.

# Basic alignment with default options
mummer_alignment(
  path = "/path/to/sequences",
  maptype = "many-to-many",
  seqtype = "protein"
)

# Alignment with specific MUMmer options
mummer_alignment(
  path = "/path/to/sequences",
  maptype = "one-to-one",
  seqtype = "protein",
  mummer_options = "--maxgap=500 --mincluster=100",
  filter_options = "-i 90"
)
## End(Not run)