simulateReads {AneuFinder} | R Documentation

## Simulate reads from genome

### Description

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.

### Usage

    simulateReads(bsgenome, readLength, bamfile, file,
      pairedEndFragmentLength = NULL, every.X.bp = 500)

### Arguments

`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 `readLength` will be simulated coming from both ends of fragments of this size. NOT IMPLEMENTED YET.
`every.X.bp` | Stepsize for simulating reads. A read fragment will be simulated every X bp.

### Details

Reads are simulated by splitting the genome into reads with the specified `readLength`.

### Value

A fastq.gz file is written to disk.

### Author(s)

Aaron Taudt

### Examples

    ## 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)
    }

[Package AneuFinder version 1.12.1 Index]