get_random_sequences_from_fasta: get_random_sequences_from_fasta

Description Usage Arguments Value Examples

View source: R/get_fasta_utils.R

Description

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

Usage

1
2
3
4
5
6
7
8
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 

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)


## End(Not run)

sethiyap/fastaR documentation built on June 16, 2020, 1:41 a.m.