Skip to contents

The inverse of flattenTupleRanges: ranges are grouped by the identity tuple they carry and returned to template's elements, so the collection's class, its per-element payloads and its collection-level slots all survive a plyranges round trip.

Usage

nestTupleRanges(flat, template)

Arguments

flat

A GRanges produced by flattenTupleRanges (possibly filtered or mutated).

template

The collection it came from, supplying the tuple grid, the payload columns and the slots.

Value

An object of template's class.

Details

A tuple with no surviving ranges becomes an empty element rather than being dropped, so the collection keeps its shape and its metadata stays aligned.

Examples

data(qtlFineMappingExample)
flat <- flattenTupleRanges(qtlFineMappingExample)
nestTupleRanges(flat, qtlFineMappingExample)
#> QtlFineMappingResult: 1 entries
#>   1 studies, 1 contexts, 1 traits, 1 methods
#>   LD sketch: NULL (individual-level fit)