write_reads: write sequencing reads to disk

Description Usage Arguments Details Value See Also Examples

Description

given a DNAStringSet representing simulated sequencing reads, write FASTA files to disk representing the simulated reads.

Usage

1
write_reads(reads, fname, readlen, paired = TRUE)

Arguments

reads

DNAStringSet representing sequencing reads

fname

file path/prefix specifying where sequencing reads should be written. Should not contain ".fasta" (this is appended automatically).

readlen

maximum length of the reads in reads.

paired

If TRUE, reads are assumed to be in pairs: i.e., read 1 and read 2 in reads are the left and right mate (respectively) of a read pair; same with read 3 and read 4, etc. The odd-numbered reads are written to fname_1.fasta and the even-numbered reads are written to fname_2.fasta. If FALSE, reads are assumed to be single-end and just one file, fname.fasta, is written.

Details

The get_reads function returns a DNAStringSet object representing sequencing reads that can be directly passed to write_reads. If output other than that from get_reads is used and paired is TRUE, make sure reads is ordered properly (i.e., that mate pairs appear together and that the left mate appears first).

Value

No return, but FASTA file(s) containing the sequences in reads are written to fname.fasta (if paired is FALSE) or fname_1.fasta and fname_2.fasta if paired is TRUE.

See Also

get_reads

Examples

1
2
3
4
library(Biostrings)
  data(srPhiX174) # pretend srPhiX174 represents a DNAStringSet of *reads*
  readlen = unique(width(srPhiX174)) #35
  write_reads(srPhiX174, fname='./srPhiX174', readlen=readlen, paired=FALSE)

alyssafrazee/polyester-release documentation built on May 12, 2019, 2:32 a.m.