This function assembles a sequence of length 'len' from a table (or database) of cycles created by 'crosscut_slice()' in the following way:
Starting and ending "chunks" are chosen
The remaining cycles in the sequence are sampled from the table until the full sequence has reached an appropriate length
The full data is assembled from the cycles selected in the first two steps
The sequence is trimmed (if too long) or padded with NA values (if too short) until it is the correct length
1 2 | crosscut_assemble(len, df, df_summary = NULL, output_res = 0.645,
show_plot = F, fill = T)
|
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. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.