fasta.cutter: Cuts pieces of a fixed length and a random position for all...

Description Usage Arguments Value Author(s) Examples

View source: R/FastaUtils_functions.R

Description

This function cuts pieces of sequences of a fixed length ('read.length') either by sampling randomly a multi-fasta file or by selecting an equal number of pieces from each sequence within a multi-fasta file.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
fasta.cutter(
  infile = NULL,
  sampling.type = "none",
  total.reads = NULL,
  read.length = NULL,
  file.out = NULL,
  replacement = FALSE,
  meanlog = 0,
  sdlog = 1
)

Arguments

infile

Multi-Fasta file.

sampling.type

Sampling type: select a fixed pieces from each sequence ('none', default), performs a uniform random sampling ('uniform') or a sampling based on a lognormal distribution. In the first case the total number of pieces has to be multiple of the number of sequences.

total.reads

Total number of pieces.

read.length

Length of te pieces to be cut.

file.out

Path to output file.

replacement

Logical for using or not (default) sampling of sequences with replacement. Only applies if 'sampling.type=T'.

meanlog, sdlog

mean and standard deviation of the distribution on the log scale with default values of 0 and 1 respectively.

Value

Writes a fasta file with the selected sequences and a tab-delimites file with the sequence name and the start and end position of the cut. This file gets the 'file.out' names and adds '.info' at the end.

Author(s)

Guillem Salazar <salazar@icm.csic.es>

Examples

1
fasta.cutter(infile="http://greengenes.lbl.gov/Data/JD_Tutorial/UnAligSeq24606.txt",sampling.type="uniform",file.out="out.fasta",total.reads=15,read.length=20)

GuillemSalazar/FastaUtils documentation built on June 9, 2021, 7:26 p.m.