Creates a simple data frame containing chromosome information extracted from genomic window identifiers (matrix column names in "chr_start_end" format).
generate_mock_window_data(matrix_colnames)A data frame with one column:
chr: Character vector containing chromosome names extracted from input
This function creates a mock data frame containing chromosome information extracted from
the column names of a matrix. The column names are expected to be in the format
chromosome_start_end, and the function extracts the chromosome part to create the
chr column in the resulting data frame.
The function:
Splits each column name by "_"
Extracts the first element (chromosome name)
Creates a data frame with these chromosome names
if (FALSE) { # \dontrun{
col_names <- c("chr1_1000_2000", "chr1_2000_3000", "chr2_1000_2000")
window_data <- generate_mock_window_data(col_names)
# Returns data frame:
# chr
# 1 chr1
# 2 chr1
# 3 chr2
} # }