Last data update: 2014.03.03

R: Count reads in binding site intervals
dba.countR Documentation

Count reads in binding site intervals

Description

Counts reads in binding site intervals. Files must be one of bam, bed and gzip-compressed bed. File suffixes must be ".bam", ".bed", or ".bed.gz" respectively.

Usage

dba.count(DBA, peaks, minOverlap=2, score=DBA_SCORE_TMM_MINUS_FULL, bLog=FALSE,
          fragmentSize=DBA$config$fragmentSize, 
          summits, filter=0, bRemoveDuplicates=FALSE, bScaleControl=TRUE,
          mapQCth=DBA$config$mapQCth, 
          filterFun=max, 
          bCorPlot=DBA$config$bCorPlot, 
          bUseSummarizeOverlaps=FALSE, readFormat=DBA_READS_DEFAULT,
          bParallel=DBA$config$RunParallel) 

Arguments

DBA

DBA object

peaks

If GRanges, RangedData, dataframe, or matrix, this parameter contains the intervals to use for counting. If character string, it specifies a file containing the intervals to use (with the first three columns specifying chromosome, startpos, endpos).If missing or a mask, generates a consensus peakset using minOverlap parameter (after applying the mask if present). If NULL, the score, filter, and summits parameters are honored, updating the global binding matrix without re-counting in the cases of score and filter, and only counting after re-centering in the case of summits.

minOverlap

only include peaks in at least this many peaksets when generating consensus peakset (i.e. when peaks parameter is missing). If minOverlap is between zero and one, peak will be included from at least this proportion of peaksets.

score

which score to use in the binding affinity matrix. Note that all raw read counts are maintained for use by dba.analyze, regardless of how this is set. One of:

DBA_SCORE_READS raw read count for interval using only reads from ChIP
DBA_SCORE_READS_FOLD raw read count for interval from ChIP divided by read count for interval from control
DBA_SCORE_READS_MINUS raw read count for interval from ChIP minus read count for interval from control
DBA_SCORE_RPKM RPKM for interval using only reads from ChIP
DBA_SCORE_RPKM_FOLD RPKM for interval from ChIP divided by RPKM for interval from control
DBA_SCORE_TMM_READS_FULL TMM normalized (using edgeR), using ChIP read counts and Full Library size
DBA_SCORE_TMM_READS_EFFECTIVE TMM normalized (using edgeR), using ChIP read counts and Effective Library size
DBA_SCORE_TMM_MINUS_FULL TMM normalized (using edgeR), using ChIP read counts minus Control read counts and Full Library size
DBA_SCORE_TMM_MINUS_EFFECTIVE TMM normalized (using edgeR), using ChIP read counts minus Control read counts and Effective Library size
DBA_SCORE_TMM_READS_FULL_CPM same as DBA_SCORE_TMM_READS_FULL, but reporrted in counts-per-million.
DBA_SCORE_TMM_READS_EFFECTIVE_CPM same as DBA_SCORE_TMM_READS_EFFECTIVE, but reporrted in counts-per-million.
DBA_SCORE_TMM_MINUS_FULL_CPM same as DBA_SCORE_TMM_MINUS_FULL, but reporrted in counts-per-million.
DBA_SCORE_TMM_MINUS_EFFECTIVE_CPM Tsame as DBA_SCORE_TMM_MINUS_EFFECTIVE, but reporrted in counts-per-million.
DBA_SCORE_SUMMIT summit height (maximum read pileup value)
DBA_SCORE_SUMMIT_ADJ summit height (maximum read pileup value), normalized to relative library size
DBA_SCORE_SUMMIT_POS summit position (location of maximum read pileup)
bLog

logical indicating whether log2 of score should be used (only applies to DBA_SCORE_RPKM_FOLD and DBA_SCORE_READS_FOLD).

fragmentSize

This value will be used as the length of the reads. Each read will be extended from its endpoint along the appropriate strand by this many bases. If set to zero, the read size indicated in the BAM/BED file will be used. fragmentSize may also be a vector of values, one for each ChIP sample plus one for each unique Control library.

summits

if present, summit heights (read pileup) and locations will be calculated for each peak. The values can retrieved using dba.peakset. The summits can also be used as a read score in the global binding matrix (see score).

If the value of summits is TRUE (or 0), the summits will be calculated but the peaksets will be unaffected. If the value is greater than zero, all consensus peaks will be re-centered around a consensus summit, with the value of summits indicating how many base pairs to include upstream and downstream of the summit (so all consensus peaks will be of the same width, namely 2 * summits).

Note that if summits is greater than zero, the counting procedure will take twice as long, and bUseSummarizeOverlaps must be FALSE.

filter

value to use for filtering intervals with low read counts. Only intervals where at least one sample has a score at least this high will be included. If peaks is NULL, will remove sites from existing DBA object without recounting. If filter is a vector of values, dba.count will return a vector of the same length, indicating how many intervals will be retained for each specified filter level.

bRemoveDuplicates

logical indicating if duplicate reads (ones that map to exactly the same genomic position) should be removed. If TRUE, any location where multiple reads map will be counted as a single read. Note that if bLowMem is set, duplicates needs to have been already marked in all of the BAM files. The built-in counting code may not correctly handle certain cases when the bRemoveDuplicates paramter is set to TRUE. These cases include paried-end data and datasets where the read length may differ within a single BAM file. In these cases, see the bUseSummarizeOverlaps parameter.

bScaleControl

logical indicating if the Control reads should be scaled based on relative library sizes. If TRUE, and there are more reads in the Control library than in the ChIP library, the number of Control reads for each peak will be multiplied by a scaling factor determined by dividing the total number of reads in the ChIP library by the total number of reads in the Control library. If this value is not an integer, the number of Control reads for each peak will be the next highest integer.

mapQCth

for filtering by mapping quality (mapqc). Only alignments with mappig scores of at least this value will be included. Only applicable for bam files when bUseSummarizeOverlaps=FALSE (setting DBA$config$scanbamparam appropriately to filter on quality scores when using summarizeOverlaps.)

filterFun

function that will be invoked for each interval with a vector of scores for each sample. Returns a score that will be evaluated against the filter value (only intervals with a score at least as high as filter will be kept). Default is max, indicating that at least one sample should have a score of at least filter; other useful values include sum (indicating that all the scores added together should be at least filter) and mean (setting a minimum mean normalized count level). Users can supply their own function as well.

bCorPlot

logical indicating whether to plot a correlation heatmap for the counted data

bUseSummarizeOverlaps

logical indicating that summarizeOverlaps should be used for counting instead of the built-in counting code. This option is slower but uses the more standard counting function. If TRUE, all read files must be BAM (.bam extension), with associated index files (.bam.bai extension). The insertLength parameter must absent.

See notes for when the bRemoveDuplicates parameter is set to TRUE, where the built-in counting code may not correctly handle certain cases and bUseSummarizeOverlaps should be set to TRUE.

Five additional parameters for summarizeOverlaps may be specified in DBA$config:

DBA$config$yieldSize yieldSize indicating how many reads to process at one time; default is 5000000. The lower this value, the less memory will be used, but the more time it will take to complete the count operation.
DBA$config$intersectMode mode indicating which overlap algorithm to use; default is "IntersectionNotEmpty"
DBA$config$singleEnd logical indicating if reads are single end; default is TRUE
DBA$config$fragments logical indicating how unmatched reads are counted; default is FALSE
DBA$config$scanbamparam ScanBamParam object to pass to summarizeOverlaps. If present, bRemoveDuplicates is ignored.
readFormat

Specify the file type of the read files, over-riding the file extension. Possible values:

DBA_READS_DEFAULT use file extension (.bam, .bed, .bed.gz) to determine file type
DBA_READS_BAM assume the file type is BAM, regardless of the file extension
DBA_READS_BED assume the file type is BED (or zipped BED), regardless of the file extension.

Note that if readFormat is anything other than DBA_READS_DEFAULT, all the read files must be of the same file type.

bParallel

if TRUE, use multicore to get counts for each read file in parallel

Value

DBA object with binding affinity matrix based on read count scores.

Author(s)

Rory Stark and Gordon Brown

See Also

dba.analyze

Examples

# These won't run unless you have the reads available in a BAM or BED file
data(tamoxifen_peaks)
## Not run: tamoxifen <- dba.count(tamoxifen)


# Count using a peakset made up of only peaks in all responsive MCF7 replicates
data(tamoxifen_peaks)
mcf7Common <- dba.overlap(tamoxifen,tamoxifen$masks$MCF7&tamoxifen$masks$Responsive)
## Not run: tamoxifen <- dba.count(tamoxifen,peaks=mcf7Common$inAll)
tamoxifen

#First make consensus peaksets from each set of replicates, 
#then derive master consensus set for counting from those
data(tamoxifen_peaks)
tamoxifen <- dba.peakset(tamoxifen,consensus = -DBA_REPLICATE)
## Not run: tamoxifen <- dba.count(tamoxifen, peaks=tamoxifen$masks$Consensus)
tamoxifen

# Change binding affinity scores
data(tamoxifen_counts)
tamoxifen <- dba.count(tamoxifen,peaks=NULL,score=DBA_SCORE_READS)
dba.peakset(tamoxifen, bRetrieve=TRUE)
tamoxifen <- dba.count(tamoxifen,peaks=NULL,score=DBA_SCORE_RPKM_FOLD)
dba.peakset(tamoxifen, bRetrieve=TRUE)
tamoxifen <- dba.count(tamoxifen,peaks=NULL,score=DBA_SCORE_TMM_MINUS_FULL)
dba.peakset(tamoxifen, bRetrieve=TRUE)

# Plot effect of a range of filter values and then apply filter 
data(tamoxifen_counts)
rate.max <- dba.count(tamoxifen, peaks=NULL, filter=0:250)
rate.sum <- dba.count(tamoxifen, peaks=NULL, filter=0:250,filterFun=sum)
plot(0:250,rate.max/rate.max[1],type='l',xlab="Filter Value",ylab="Proportion Retained Sites")
lines(0:250,rate.sum/rate.sum[1],col=2)
tamoxifen <- dba.count(tamoxifen,peaks=NULL,filter=125,filterFun=sum)
tamoxifen

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DiffBind)
Loading required package: GenomicRanges
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: SummarizedExperiment
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.


> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/DiffBind/dba.count.Rd_%03d_medium.png", width=480, height=480)
> ### Name: dba.count
> ### Title: Count reads in binding site intervals
> ### Aliases: dba.count
> 
> ### ** Examples
> 
> # These won't run unless you have the reads available in a BAM or BED file
> data(tamoxifen_peaks)
> ## Not run: tamoxifen <- dba.count(tamoxifen)
> 
> 
> # Count using a peakset made up of only peaks in all responsive MCF7 replicates
> data(tamoxifen_peaks)
> mcf7Common <- dba.overlap(tamoxifen,tamoxifen$masks$MCF7&tamoxifen$masks$Responsive)
> ## Not run: tamoxifen <- dba.count(tamoxifen,peaks=mcf7Common$inAll)
> tamoxifen
11 Samples, 2845 sites in matrix (3795 total):
       ID Tissue Factor  Condition  Treatment Replicate Caller Intervals
1  BT4741  BT474     ER  Resistant Full-Media         1    bed      1080
2  BT4742  BT474     ER  Resistant Full-Media         2    bed      1122
3   MCF71   MCF7     ER Responsive Full-Media         1    bed      1556
4   MCF72   MCF7     ER Responsive Full-Media         2    bed      1046
5   MCF73   MCF7     ER Responsive Full-Media         3    bed      1339
6   T47D1   T47D     ER Responsive Full-Media         1    bed       527
7   T47D2   T47D     ER Responsive Full-Media         2    bed       373
8  MCF7r1   MCF7     ER  Resistant Full-Media         1    bed      1438
9  MCF7r2   MCF7     ER  Resistant Full-Media         2    bed       930
10  ZR751   ZR75     ER Responsive Full-Media         1    bed      2346
11  ZR752   ZR75     ER Responsive Full-Media         2    bed      2345
> 
> #First make consensus peaksets from each set of replicates, 
> #then derive master consensus set for counting from those
> data(tamoxifen_peaks)
> tamoxifen <- dba.peakset(tamoxifen,consensus = -DBA_REPLICATE)
Add consensus: BT474 Resistant
Add consensus: MCF7 Responsive
Add consensus: T47D Responsive
Add consensus: MCF7 Resistant
Add consensus: ZR75 Responsive
> ## Not run: tamoxifen <- dba.count(tamoxifen, peaks=tamoxifen$masks$Consensus)
> tamoxifen
16 Samples, 2845 sites in matrix (3795 total):
                ID Tissue Factor  Condition  Treatment Replicate Caller
1           BT4741  BT474     ER  Resistant Full-Media         1    bed
2           BT4742  BT474     ER  Resistant Full-Media         2    bed
3            MCF71   MCF7     ER Responsive Full-Media         1    bed
4            MCF72   MCF7     ER Responsive Full-Media         2    bed
5            MCF73   MCF7     ER Responsive Full-Media         3    bed
6            T47D1   T47D     ER Responsive Full-Media         1    bed
7            T47D2   T47D     ER Responsive Full-Media         2    bed
8           MCF7r1   MCF7     ER  Resistant Full-Media         1    bed
9           MCF7r2   MCF7     ER  Resistant Full-Media         2    bed
10           ZR751   ZR75     ER Responsive Full-Media         1    bed
11           ZR752   ZR75     ER Responsive Full-Media         2    bed
12 BT474:Resistant  BT474     ER  Resistant Full-Media       1-2    bed
13 MCF7:Responsive   MCF7     ER Responsive Full-Media     1-2-3    bed
14 T47D:Responsive   T47D     ER Responsive Full-Media       1-2    bed
15  MCF7:Resistant   MCF7     ER  Resistant Full-Media       1-2    bed
16 ZR75:Responsive   ZR75     ER Responsive Full-Media       1-2    bed
   Intervals
1       1080
2       1122
3       1556
4       1046
5       1339
6        527
7        373
8       1438
9        930
10      2346
11      2345
12       896
13      1215
14       318
15       879
16      1933
> 
> # Change binding affinity scores
> data(tamoxifen_counts)
> tamoxifen <- dba.count(tamoxifen,peaks=NULL,score=DBA_SCORE_READS)
> dba.peakset(tamoxifen, bRetrieve=TRUE)
GRanges object with 2845 ranges and 11 metadata columns:
       seqnames               ranges strand |    BT4741    BT4742     MCF71
          <Rle>            <IRanges>  <Rle> | <numeric> <numeric> <numeric>
     1    chr18     [ 90792,  91292]      * |        10        13         2
     2    chr18     [111344, 111844]      * |        67        57       234
     3    chr18     [150183, 150683]      * |        19        19        25
     4    chr18     [150751, 151251]      * |        17        15         9
     5    chr18     [189151, 189651]      * |        17        27        28
   ...      ...                  ...    ... .       ...       ...       ...
  2841    chr18 [77782579, 77783079]      * |        13         3         3
  2842    chr18 [77903161, 77903661]      * |         8        18         6
  2843    chr18 [77955335, 77955835]      * |        18        12        10
  2844    chr18 [77968174, 77968674]      * |        58        60        55
  2845    chr18 [77987568, 77988068]      * |        20         4        64
           MCF72     MCF73     T47D1     T47D2    MCF7r1    MCF7r2     ZR751
       <numeric> <numeric> <numeric> <numeric> <numeric> <numeric> <numeric>
     1         8         6         8        25         9         9        56
     2       131       197        48       118       146        97       124
     3        14        32         5        13        21        12        14
     4        12        10         4        18        32        25         8
     5        16        44         5        15        94        62        19
   ...       ...       ...       ...       ...       ...       ...       ...
  2841        14         6        12        17         7        11        22
  2842         8         7         6        30         9         3        30
  2843         6         8        15        22         5         7        32
  2844        43        56         8        36       103        53        50
  2845        45        47         8        18        53        17       190
           ZR752
       <numeric>
     1       119
     2       263
     3        45
     4        36
     5        58
   ...       ...
  2841        35
  2842        64
  2843        94
  2844       140
  2845       487
  -------
  seqinfo: 1 sequence from an unspecified genome; no seqlengths
> tamoxifen <- dba.count(tamoxifen,peaks=NULL,score=DBA_SCORE_RPKM_FOLD)
> dba.peakset(tamoxifen, bRetrieve=TRUE)
GRanges object with 2845 ranges and 11 metadata columns:
       seqnames               ranges strand |           BT4741
          <Rle>            <IRanges>  <Rle> |        <numeric>
     1    chr18     [ 90792,  91292]      * | 3.85140522416993
     2    chr18     [111344, 111844]      * | 2.24386217408161
     3    chr18     [150183, 150683]      * | 1.33048544107689
     4    chr18     [150751, 151251]      * | 1.30947777621778
     5    chr18     [189151, 189651]      * | 1.45497530690864
   ...      ...                  ...    ... .              ...
  2841    chr18 [77782579, 77783079]      * | 1.11262817587131
  2842    chr18 [77903161, 77903661]      * | 1.23244967173438
  2843    chr18 [77955335, 77955835]      * | 1.38650588070118
  2844    chr18 [77968174, 77968674]      * |  2.3513842421248
  2845    chr18 [77987568, 77988068]      * | 3.08112417933595
                  BT4742             MCF71            MCF72             MCF73
               <numeric>         <numeric>        <numeric>         <numeric>
     1  4.96800946807273  0.27630901561297  1.0418552716341 0.630367261243814
     2  1.89415745605449  11.2445755919017 5.93404524278552  7.19897683855254
     3  1.32017034815919  3.45386269516212 1.82324672535967  3.36195872663367
     4   1.1464637234014  1.98942491241338 2.50045265192184  1.68097936331684
     5   2.2929274468028  15.4733048743263 8.33484217307279  18.4907729964852
   ...               ...               ...              ...               ...
  2841 0.254769716311422 0.663141637471127 2.91719476057548   1.0085876179901
  2842  2.75151293616336 0.828927046838909  1.0418552716341 0.735428471451116
  2843  0.91717097872112   2.7630901561297 1.56278290745115  1.68097936331684
  2844  2.41360783873979  15.1969958587133 11.1999441700666  11.7668555432179
  2845 0.611447319147413  17.6837769992301 11.7208718058836  9.87575375948641
                   T47D1             T47D2            MCF7r1            MCF7r2
               <numeric>         <numeric>         <numeric>         <numeric>
     1 0.573795285667174 0.496783382315705  1.87582242078089  1.92476211259661
     2  3.78704888540335  2.57929932098314  5.85192464602585  3.98935737012544
     3 0.262989505930788 0.189440063123055  3.12637070130148  1.83310677390153
     4 0.631174814233891 0.786904877588076  3.70532823857953  2.97031190215526
     5 0.493105323620227 0.409846290410456  13.9942307582066   9.4710516651579
   ...               ...               ...               ...               ...
  2841  9.46762221350836  3.71593969972147 0.521061783550247 0.840173938038201
  2842  4.73381110675418   6.5575406465673  1.33987315770063 0.458276693475382
  2843  5.91726388344273  2.40443157040801  2.60530891775123  3.74259299671562
  2844  6.31174814233891  7.86904877588076  11.9265252679279  6.29706123256914
  2845  3.15587407116945  1.96726219397019  9.20542484272103  3.02971814019836
                  ZR751             ZR752
              <numeric>         <numeric>
     1 5.48343221084937  3.21167109462218
     2 1.94869769045176  1.13919529749074
     3 1.98012829836227  1.75427412731463
     4 0.84862641358383  1.05256447638878
     5 1.15170727557806 0.969027613183322
   ...              ...               ...
  2841 9.33489054942213  4.09330629706748
  2842 38.1881886112724  22.4547088296273
  2843 5.09175848150298  4.12254419918939
  2844 31.8234905093936  24.5598377824049
  2845 34.5512182673417  24.4094714286351
  -------
  seqinfo: 1 sequence from an unspecified genome; no seqlengths
> tamoxifen <- dba.count(tamoxifen,peaks=NULL,score=DBA_SCORE_TMM_MINUS_FULL)
> dba.peakset(tamoxifen, bRetrieve=TRUE)
GRanges object with 2845 ranges and 11 metadata columns:
       seqnames               ranges strand |           BT4741           BT4742
          <Rle>            <IRanges>  <Rle> |        <numeric>        <numeric>
     1    chr18     [ 90792,  91292]      * | 10.9959189675478 14.3160562999212
     2    chr18     [111344, 111844]      * | 60.4775543215126 44.2496285633928
     3    chr18     [150183, 150683]      * | 10.9959189675478 10.4116773090336
     4    chr18     [150751, 151251]      * | 9.62142909660428   6.507298318146
     5    chr18     [189151, 189651]      * | 10.9959189675478 23.4262739453256
   ...      ...                  ...    ... .              ...              ...
  2841    chr18 [77782579, 77783079]      * | 5.49795948377388  1.3014596636292
  2842    chr18 [77903161, 77903661]      * | 4.12346961283041 16.9189756271796
  2843    chr18 [77955335, 77955835]      * | 10.9959189675478  2.6029193272584
  2844    chr18 [77968174, 77968674]      * | 53.6051049667953 53.3598462087972
  2845    chr18 [77987568, 77988068]      * |  20.617348064152  1.3014596636292
                  MCF71            MCF72            MCF73            T47D1
              <numeric>        <numeric>        <numeric>        <numeric>
     1 2.00234962469803 2.30389422209818 1.46472358012645  3.0705569162303
     2 426.500470060681 248.820575986604 254.861902942002 116.681162816751
     3 34.0399436198665 13.8233653325891 35.1533659230348  3.0705569162303
     4 8.00939849879213 16.1272595546873 7.32361790063225  3.0705569162303
     5 52.0610902421488 32.2545191093745 61.5183903653109  3.0705569162303
   ...              ...              ...              ...              ...
  2841 2.00234962469803 20.7350479988836 1.46472358012645 33.7761260785333
  2842 2.00234962469803 2.30389422209818 1.46472358012645 15.3527845811515
  2843 12.0140977481882 4.60778844419636  5.8588943205058 39.9172399109939
  2844   102.1198308596 89.8518746618291 76.1656261665754 21.4938984136121
  2845 120.140977481882 94.4596631060254 62.9831139454373 18.4233414973818
                   T47D2           MCF7r1           MCF7r2             ZR751
               <numeric>        <numeric>        <numeric>         <numeric>
     1  10.3559392725067 6.52745423362031  8.9376958856263  20.6957753973601
     2  79.8886743879091 197.455490567015 160.878525941273  27.5943671964801
     3 0.739709948036195 22.8460898176711 11.1721198570329  2.75943671964801
     4  9.61622932447054 37.5328618433168 35.7507835425052 0.459906119941335
     5  5.17796963625337 141.972129581242 122.893318427362 0.919812239882669
   ...               ...              ...              ...               ...
  2841  11.8353591685791 1.63186355840508 2.23442397140658  8.73821627888536
  2842  21.4515884930497 3.26372711681016 2.23442397140658  13.3372774782987
  2843  14.7941989607239 4.89559067521524 11.1721198570329  11.4976529985334
  2844  25.8898481812668 153.395174490077 98.3146547418893  22.0754937571841
  2845  11.8353591685791 76.6975872450387 24.5786636854723  84.6227260692056
                  ZR752
              <numeric>
     1 17.5901612980478
     2 30.2019750589123
     3 5.97401704462002
     4 3.98267802974668
     5 6.13996196252613
   ...              ...
  2841 5.31023737299557
  2842  10.454529828085
  2843 14.2712629399256
  2844 22.9003986710434
  2845 79.6535605949336
  -------
  seqinfo: 1 sequence from an unspecified genome; no seqlengths
> 
> # Plot effect of a range of filter values and then apply filter 
> data(tamoxifen_counts)
> rate.max <- dba.count(tamoxifen, peaks=NULL, filter=0:250)
> rate.sum <- dba.count(tamoxifen, peaks=NULL, filter=0:250,filterFun=sum)
> plot(0:250,rate.max/rate.max[1],type='l',xlab="Filter Value",ylab="Proportion Retained Sites")
> lines(0:250,rate.sum/rate.sum[1],col=2)
> tamoxifen <- dba.count(tamoxifen,peaks=NULL,filter=125,filterFun=sum)
> tamoxifen
11 Samples, 2040 sites in matrix:
       ID Tissue Factor  Condition  Treatment Replicate Caller Intervals FRiP
1  BT4741  BT474     ER  Resistant Full-Media         1 counts      2040 0.15
2  BT4742  BT474     ER  Resistant Full-Media         2 counts      2040 0.13
3   MCF71   MCF7     ER Responsive Full-Media         1 counts      2040 0.26
4   MCF72   MCF7     ER Responsive Full-Media         2 counts      2040 0.16
5   MCF73   MCF7     ER Responsive Full-Media         3 counts      2040 0.22
6   T47D1   T47D     ER Responsive Full-Media         1 counts      2040 0.10
7   T47D2   T47D     ER Responsive Full-Media         2 counts      2040 0.05
8  MCF7r1   MCF7     ER  Resistant Full-Media         1 counts      2040 0.19
9  MCF7r2   MCF7     ER  Resistant Full-Media         2 counts      2040 0.12
10  ZR751   ZR75     ER Responsive Full-Media         1 counts      2040 0.29
11  ZR752   ZR75     ER Responsive Full-Media         2 counts      2040 0.19
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>