Skip to contents

Works by randomly varying the gaps between segments assuming that the gap number follow a Poisson process with rate given by the average sample gap length in the input splice. Durations of segments remain the same.

Usage

sample_gap_splice(splicing_dfr, v, num_splices, rejection_list = list())

Arguments

splicing_dfr

Splice object.

v

View object.

num_splices

number of random splices to generate.

rejection_list

list of Splice objects for rejection.

Value

list of splicing data.frames.

Details

Uses rejection sampling to avoid overlaps with the input segments and additional segments from a list of splices.

Examples

r1 <- get_sample_recording()
d1 <- get_duration_annotation_data(r1)
rv1 <- get_raw_view(r1, "Central", "", "Sitar")
splicing_df <- splice_time(d1, tier ='INTERACTION', comments = 'Mutual look and smile')
# Only first segment relevant for sample data
x <- sample_gap_splice(splicing_df[1,], rv1, num_splices = 10)
#> Accepted splices: 10