binnedAFs {h5vc} | R Documentation

## Estimate allelic frequency distributions in bins along the genome

### Description

This function is used to give estimates of the ditribution of observed allelic freuqencies in a regions of the genome, use in conjunction with `h5dapply`

### Usage

    binnedAFs(data, sampledata, normalise = TRUE, binWidth = 0.05, minCov = 10, minCount = 2)

### Arguments

`data` | A `list` object returned by a call to `h5dapply` or `h5readBlock`.
`sampledata` | Sample metadata describing the cohort, can be extracted from an HDF5 tally file using the `getSampleData` function.
`normalise` | Boolean flag to specify whether the counts or percentages of observed allelic frequencies should be returned.
`binWidth` | Width of bins in allelic frequency space, defaults to 0.05.
`minCov` | Minimum required coverage for a position to be considered.
`minCount` | Minimum required number of mismatches for a position to be considered.

### Value

A matrix of AF bins times samples.

### Author(s)

Paul Theodor Pyl

### Examples

    library(h5vc)
    tallyFile <- system.file( "extdata", "example.tally.hfs5", package = "h5vcData" )
    sampleData <- getSampleData( tallyFile, "/ExampleStudy/16" )
    afs <- h5dapply(
      filename = tallyFile,
      group = "/ExampleStudy/16",
      names = c("Counts", "Coverages"),
      range = c(29e6, 29.05e6),
      blocksize = 1e4,
      FUN = binnedAFs,
      sampledata = sampleData
    )
    afs[[3]]

[Package h5vc version 2.14.0 Index]