crosscut_assemble: Assemble a "resampled" bullet sequence

Description Usage Arguments

Description

This function assembles a sequence of length 'len' from a table (or database) of cycles created by 'crosscut_slice()' in the following way:

  1. Starting and ending "chunks" are chosen

  2. The remaining cycles in the sequence are sampled from the table until the full sequence has reached an appropriate length

  3. The full data is assembled from the cycles selected in the first two steps

  4. The sequence is trimmed (if too long) or padded with NA values (if too short) until it is the correct length

Usage

1
2
crosscut_assemble(len, df, df_summary = NULL, output_res = 0.645,
  show_plot = F, fill = T)

Arguments

len

target sequence length

df

data frame with columns id, sig, and type (boundary or otherwise). Can also be a dplyr tbl from a database. This data frame should have all sequence pieces which are to be resampled, and id should uniquely identify a sequence piece.

df_summary

(optional) summary of df, will be generated if it is not provided. Can be a dplyr tbl from a database. The summary table should have columns id, type, n (the length of the chunk), and not_na (the number of non-na pieces).

output_res

resolution of output crosscut in microns. Defaults to 0.645

show_plot

useful for debugging; requires ggplot2

fill

when the sequence has nearly len values, should it be padded? Otherwise, the returned sequence may differ slightly from the specified length.

...

additional arguments passed to 'cycle_draw()' function. May include ‘boundary_indicator' if type = ’boundary' is not used to denote a boundary chunk in df.


srvanderplas/bulletsamplr documentation built on June 10, 2021, 7:55 a.m.