View source: R/simulateReads.R
simulateReads | R Documentation |
Simulate single or paired end reads from any BSgenome-class object. These simulated reads can be mapped to the reference genome using any aligner to produce BAM files that can be used for mappability correction.
simulateReads(bsgenome, readLength, bamfile, file,
pairedEndFragmentLength = NULL, every.X.bp = 500)
bsgenome |
A BSgenome-class object containing the sequence of the reference genome. |
readLength |
The length in base pairs of the simulated reads that are written to file. |
bamfile |
A BAM file. This file is used to estimate the distribution of Phred quality scores. |
file |
The filename that is written to disk. The ending .fastq.gz will be appended. |
pairedEndFragmentLength |
If this option is specified, paired end reads with length |
every.X.bp |
Stepsize for simulating reads. A read fragment will be simulated every X bp. |
Reads are simulated by splitting the genome into reads with the specified readLength
.
A fastq.gz file is written to disk.
Aaron Taudt
## Get an example BAM file with single-cell-sequencing reads
bamfile <- system.file("extdata", "BB150803_IV_074.bam", package="AneuFinderData")
## Simulate 51bp reads for at a distance of every 5000bp
if (require(BSgenome.Mmusculus.UCSC.mm10)) {
simulateReads(BSgenome.Mmusculus.UCSC.mm10, bamfile=bamfile, readLength=51,
file=tempfile(), every.X.bp=5000)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.