long_to_wide_freq_ready: Convert data in long format to wide format...

Description Usage Arguments Value

View source: R/EvoFreq_funcs.R

Description

Convert data in long format to wide format long_to_wide_freq_ready Converts long data frame to wide format used by evofreq.

Usage

1
2
3
long_to_wide_freq_ready(edges_df, long_pop_sizes_df, time_col_name,
  clone_col_name, parent_col_name, size_col_name,
  fill_gaps_in_size = FALSE)

Arguments

edges_df

Dataframe with 2 columns, where each row defines relation between each clone and their parent. One column contains the clone ids, and the other contains the id of that clone's parent.

long_pop_sizes_df

Dataframe with 3 columns, one containing the clone id, one containing the time points, and one containing the size of the clone at that time point. There must be a size for each clone at every time point, so it did not exist, it's size is 0.

time_col_name

String that specifies which column in long_pop_sizes_df contains the timepoint information

clone_col_name

String that specifies which column in in edges_df contains the names of the clones. I.e. the "to" node in a graph

parent_col_name

String that specifies which column in in edges_df contains the names of the parents of the descendent clone in the edges_df with colname clone_col_name. #I.e. the "from" node in a graph

size_col_name

String that specifies which column in long_pop_sizes_df contains the size of each clone for the corresponding timepoint and clone in long_pop_sizes_df

fill_gaps_in_size

Boolean specificing if gaps in sizes over time should be filled in, assuming linear changes.

Value

List containing: wide_size_df, a dataframe of the sizes in wide format, where each row contains the sizes over time for a single clone; parents, a vector containing the parent id for each clone in clones; clones, a vector of clones ids correspond to each row in wide_size_df


MathOnco/EvoFreq documentation built on Jan. 26, 2022, 7:31 p.m.