Learn R Programming

hiAnnotator (version 1.6.2)

makeChunks: Breaks two GRanges objects into chunks of N size.

Description

Given a query and subject GRanges objects, the function breaks query into chunks of N size where each chunk has a respective subject object filtered by seqnames present in the query chunk. This is a helper function used by one of the annotation function in 'See Also' section where each chunk is sent to a parallel node for processing.

Usage

makeChunks(sites.rd, features.rd, chunkSize = NULL)

Arguments

sites.rd
a GRanges object.
features.rd
a GRanges object.
chunkSize
number of rows to use per chunk of query. Default to length(sites.rd)/detectCores() or length(query)/getDoParWorkers() depending on parallel backend registered.

Value

  • a list of GRanges objects where each element is of length 2 representing query & subject chunks.

See Also

makeGRanges, doAnnotation, getNearestFeature, getSitesInFeature, getFeatureCounts.

Examples

Run this code
data(sites)
data(genes)
sites <- makeGRanges(sites,soloStart=TRUE)
genes <- makeGRanges(genes)
makeChunks(sites, genes)

Run the code above in your browser using DataLab