Skip to contents

Takes the (non-boundary) features from dna_seg_input with sequences and makes a FASTA file from them.

Usage

dna_seg_to_fasta(
  dna_seg_input,
  output_path = NULL,
  id = "locus_id",
  file_names = NULL,
  unique_ids = FALSE,
  verbose = FALSE,
  ...
)

Arguments

dna_seg_input

Either a single dna_seg object or a list of dna_seg objects,

output_path

Path to the folder that will contain the output files.

id

The dna_seg column to use as the header for the FASTA sequences.

file_names

A character vector of file names to use. If provided, must be the same length as the amount of provided dna_seg objects.

unique_ids

Logical. If TRUE, all values in the column provided by id have to be unique. If FALSE it will use only the first sequence for each unique value of id.

verbose

Logical. If TRUE, report the time when it starts writing to the output file, as well as a potential warning when the id column has duplicate values.

...

Arguments to pass to fwrite.

Value

Returns nothing (invisible NULL).

Details

If output_path is left as NULL, the current working directory will be used instead.

Author

Mike Puijk

Examples

if (FALSE) { # \dontrun{
dna_seg_to_fasta(dna_seg_input = list(dna_seg1, dna_seg2), 
                 output_path = "path/to/output/folder")
} # }