This function takes the segmentation data of multiple samples produced by any segment caller (mainly CNVkit) and generates a single BED file with all the segment information (chr/start/end/log2) with an additional column for sample ID. The default columns to select from original segmentation files are 1,2,3,5, which correspond to chr/start/end/log2 in CNVkit. Use argument cols_to_keep to select other columns if needed or if order is different from different segment callers.
1 2 3 4 5 6 7 8 9 | format_segment_data(
seg_file = "",
dir_segment = "",
pattern = "",
cols_to_keep = c("chr", "start", "end", "log2", "sample"),
output_dir = "",
output_name = "",
verbose = FALSE
)
|
seg_file |
REQUIRED Path/s to segmentation file/s. dir_segment and seg_file are mutually excluding. |
dir_segment |
REQUIRED Path to directory with segmentation files. |
pattern |
FALSE Pattern to use if directory for segmentation files is given. |
cols_to_keep |
[DEFAULT==c("chr","start","end","log2","sample"))] Columns to keep from original segmentation bed files [DEFAULT==c("chr","start","end","log2","sample"))]: R:DEFAULT==c(%22chr%22,%22start%22,%22end%22,%22log2%22,%22sample%22)) |
output_dir |
Path to the output directory. |
output_name |
Name of the file to output. |
verbose |
Enables progress messages. Default False. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.