Generate n-random sequences of pre-determined length from given input multi-fasta file

get_random_sequences_from_fasta(
  fasta_file,
  numberOfRandomSequences = 50,
  lengthOfRandomSequence = 100,
  write_bed = FALSE,
  write_outputfasta = FALSE,
  outfile = "randomSeq"
)

Arguments

fasta_file

Either a path or a connection to reference multi-fasta file, from which subset of sequences for given input feature is to be retrieved. In the sequence header: only string before first space and/or first colon (:) will be considered for further processes. **Important consideration when header have long names.

numberOfRandomSequences

Numeric, number of random sequences to be generated.

lengthOfRandomSequence

Numeric, length of random sequences.

write_bed

Logical, to return flank region as a output bed file, Default: FALSE

write_outputfasta

Logical, to return flank sequences as a output multi-fasta file, Default: FALSE

outfile

character vector, defining output file name, Default: 'flank_out'

Value

A ranges of random regions and respective random sequences.

Examples

if (FALSE) { ref_fasta <- system.file("exdata", "Sc_ref_genome.fasta", package = "fastaR") fastaR::get_random_sequences_from_fasta(fasta_file = ref_fasta, numberOfRandomSequences = 100, lengthOfRandomSequence = 500) }