writeFASTQ: Write read sequences and qualities to a FASTQ formatted file

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/nucSim.R

Description

This is intended to produce the final output of the simulation by providing a fastq file that may then be used in an analysis pipeline.

Usage

1
writeFASTQ(read, quality, name, file, append = FALSE)

Arguments

read

List of read sequences.

quality

List of read quality scores.

name

Read names.

file

File name. If this is “” results will be printed to the standard output connection.

append

Logical indicating the reads should be appended to an existing file.

Details

The first three arguments should have the same length but will be recycled if necessary.

Value

Called for its side effect.

Author(s)

Peter Humburg

See Also

readSequence, readQualitySample, writeReads

Examples

1
2
3
4
5
6
7
8
9
set.seed(1)

## generate sequence read and quality
quality <- paste(sample(unlist(strsplit(rawToChar(as.raw(33:126)),"")), 
	36, replace = TRUE), collapse="")
read <- paste(sample(c("A", "C", "G", "T"), 36, replace = TRUE), collapse = "")

## write a fastq record
writeFASTQ(read, quality, "read_1", file="")

ChIPsim documentation built on Nov. 8, 2020, 8:09 p.m.