View source: R/create_CNVMatrix.R
| create_CNVMatrix | R Documentation |
Takes an annotated CNV CSV file (output of annotate) and
reshapes it into a wide-format matrix where rows are samples, columns
are gene symbols, and values are mean segment means. Duplicate
sample-gene combinations are resolved by taking the mean.
create_CNVMatrix(input_file)
input_file |
Character. Path to the input CSV file containing
columns |
Duplicate Sample-GeneSymbol combinations are summarised
by taking their mean Segment_Mean before pivoting, avoiding
list-column issues in the output. This function is cancer-type agnostic.
A data frame in wide format with samples as rows and gene
symbols as columns. Missing values are represented as NA.
The matrix is also saved as a timestamped CSV file in the temporary
directory.
annot_file <- system.file("extdata", "annotated_cnv.csv",
package = "RiskyCNV")
cnv_mat <- create_CNVMatrix(annot_file)
dim(cnv_mat)
head(cnv_mat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.