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
)
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.
The user-defined correspondence table, as a data frame or equivalent. This is used only if no filename
argument is provided.
Filename of correspondence table. Alternatively, if no filename is provided, the user can provide their own correspondence table as the df
argument.
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
specify outputs filename
a string specifying in what formats you want the alignment. Can be "fasta", "phylip" and "nexus"
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).
return unaligned fasta files as output
Optional regular expression used to exclude some filenames from the list of detected files.
No return value, called for side effect of saving a correspondence table.