From 2137fe62fd2b234920d12e44f0b5075cc9af170d Mon Sep 17 00:00:00 2001 From: jalavery Date: Wed, 17 Jul 2024 11:27:21 -0400 Subject: [PATCH] documentation for summarize_by_patient --- NAMESPACE | 1 + man/summarize_by_patient.Rd | 40 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 man/summarize_by_patient.Rd diff --git a/NAMESPACE b/NAMESPACE index 64912381..03b10abe 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -32,6 +32,7 @@ export(specify_impact_panels) export(subset_by_frequency) export(subset_by_panel) export(summarize_by_gene) +export(summarize_by_patient) export(tbl_genomic) export(which_impact_panel) import(ComplexHeatmap) diff --git a/man/summarize_by_patient.Rd b/man/summarize_by_patient.Rd new file mode 100644 index 00000000..b36e0303 --- /dev/null +++ b/man/summarize_by_patient.Rd @@ -0,0 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/summarize-by-patient.R +\name{summarize_by_patient} +\alias{summarize_by_patient} +\title{Simplify binary matrix to one column per patient that counts any alteration +type across all samples as 1} +\usage{ +summarize_by_patient(gene_binary, other_vars = NULL) +} +\arguments{ +\item{gene_binary}{a 0/1 matrix of gene alterations} + +\item{other_vars}{One or more column names (quoted or unquoted) in data to be retained +in resulting data frame. Default is NULL.} +} +\value{ +a binary matrix with a row for each sample and one column per gene +} +\description{ +This will reduce the number of columns in your binary matrix, and the +resulting data frame will have only 1 col per gene, as opposed to separate +columns for mutation/cna/fusion. +} +\details{ +Note that if samples to the same patient were sequenced on different panels, +any indication of an alteration is counted as an alteration, but the absence +of an alteration is only defined when all sequencing panels included the gene +and indicated that it was not altered. +} +\examples{ +samples <- unique(gnomeR::mutations$sampleId)[1:10] +gene_binary <- create_gene_binary( + samples = samples, mutation = mutations, cna = cna, + mut_type = "somatic_only", + include_silent = FALSE, + specify_panel = "IMPACT341" +) \%>\% + summarize_by_patient() + +}