Description Usage Arguments Details Value Examples
Convert aligned reads in .bam or .bed(.gz) format into read counts in equidistant windows.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | binReads(
file,
experiment.table = NULL,
ID = NULL,
assembly,
bamindex = file,
chromosomes = NULL,
pairedEndReads = FALSE,
min.mapq = 10,
remove.duplicate.reads = TRUE,
max.fragment.width = 1000,
blacklist = NULL,
binsizes = 1000,
stepsizes = binsizes/2,
reads.per.bin = NULL,
bins = NULL,
variable.width.reference = NULL,
use.bamsignals = TRUE,
format = NULL
)
|
file |
A file with aligned reads. Alternatively a |
experiment.table |
An |
ID |
Optional ID to select a row from the |
assembly |
Please see |
bamindex |
BAM index file. Can be specified without the .bai ending. If the index file does not exist it will be created and a warning is issued. |
chromosomes |
If only a subset of the chromosomes should be binned, specify them here. |
pairedEndReads |
Set to |
min.mapq |
Minimum mapping quality when importing from BAM files. Set |
remove.duplicate.reads |
A logical indicating whether or not duplicate reads should be removed. |
max.fragment.width |
Maximum allowed fragment length. This is to filter out erroneously wrong fragments due to mapping errors of paired end reads. |
blacklist |
A |
binsizes |
An integer vector specifying the bin sizes to use. |
stepsizes |
An integer vector specifying the step size. One number can be given for each element in |
reads.per.bin |
Approximate number of desired reads per bin. The bin size will be selected accordingly. |
bins |
A |
variable.width.reference |
A BAM file that is used as reference to produce variable width bins. See |
use.bamsignals |
If |
format |
One of |
Convert aligned reads from .bam or .bed(.gz) files into read counts in equidistant windows (bins). This function uses GenomicRanges::countOverlaps
to calculate the read counts, or alternatively bamsignals::bamProfile
if option use.bamsignals
is set (only effective for .bam files).
If only one bin size was specified for option binsizes
, the function returns a single GRanges-class
object with meta data column 'counts' that contains the read count. If multiple binsizes
were specified , the function returns a named list()
of GRanges-class objects.
1 2 3 4 5 6 7 8 9 10 11 | ## Get an example BAM file with ChIP-seq reads
file <- system.file("extdata", "euratrans",
"lv-H3K27me3-BN-male-bio2-tech1.bam",
package="chromstaRData")
## Bin the file into bin size 1000bp
data(rn4_chrominfo)
data(experiment_table)
binned <- binReads(file, experiment.table=experiment_table,
assembly=rn4_chrominfo, binsizes=1000,
stepsizes=500, chromosomes='chr12')
print(binned)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.