This function renames sequences in fasta files based on a correspondence table.

rename_sequences(
  fasta_files,
  df = NULL,
  filename = NULL,
  marker_names = NULL,
  out = NULL,
  format = "fasta",
  excel.sheet = 1,
  unalign = FALSE,
  exclude
)

Arguments

fasta_files

Optional, a vector of paths to the fasta files that should be renamed. If this argument is missing, the function automatically detects and uses all the fasta files present in the working directory.

df

The user-defined correspondence table, as a data frame or equivalent. This is used only if no filename argument is provided.

filename

Filename of correspondence table. Alternatively, if no filename is provided, the user can provide their own correspondence table as the df argument.

marker_names

the name of the marker for each alignment to be appended at the end of the sequences names, in the same order as in the correspondence table

out

specify outputs filename

format

a string specifying in what formats you want the alignment. Can be "fasta", "phylip" and "nexus"

excel.sheet

specify what sheet from the excel spreadsheet you wanna read. Either a string (the name of a sheet), or an integer (the position of the sheet).

unalign

return unaligned fasta files as output

exclude

Optional regular expression used to exclude some filenames from the list of detected files.

Value

No return value, called for side effect of saving a correspondence table.