Skip to content

Commit

Permalink
Merge pull request #65 from QuackenbushLab/prom-methylation-doc-fix
Browse files Browse the repository at this point in the history
Updated docs on probe-to-gene mapping
  • Loading branch information
katehoffshutta authored Feb 28, 2025
2 parents 376c144 + 20d1f77 commit d111091
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
15 changes: 3 additions & 12 deletions R/NetworkDataCompanion.R
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ NetworkDataCompanion=setRefClass("NetworkDataCompanion",

# Function to map to probes to a gene-level measurement
# probe_gene_map is in the format output from the mapProbesToGenes function
# genesOfInterest is a character vector, one gene per entry
# not all genesOfInterest need to be in probe_gene_map, but if none are, then this is meaningless
probeToMeanPromoterMethylation = function(methylation_betas,
probe_gene_map,
Expand Down Expand Up @@ -331,12 +332,6 @@ NetworkDataCompanion=setRefClass("NetworkDataCompanion",
data.frame(check.names=F)
}

# ## split the probe map to a long form where there are multiple genes mapped to the same probe
# mappedBetasLong = mappedBetas %>%
# separate_rows(geneNames, sep = ";") %>%
# drop_na(geneNames) %>%
# data.frame(check.names = F)

## map probe-level methylation to the mean for each gene
betaMeans = mappedBetasLong %>%
group_by(geneNames) %>%
Expand Down Expand Up @@ -375,12 +370,8 @@ NetworkDataCompanion=setRefClass("NetworkDataCompanion",
# map methylation to gene level
# methylation betas should be samples in rows
# and CGs in columns
# luad for testing
# methylation_betas = fread("~/Desktop/tcga_luad_methylations.txt",data.table=F)
# row.names(methylation_betas) = methylation_betas$probeID
# array = "450k"

row.names(methylation_betas) = methylation_betas$probeID

row.names(methylation_betas) = methylation_betas$probeID

geneLevelMeth = methylation_betas %>%
dplyr::select(-probeID) %>%
Expand Down
4 changes: 3 additions & 1 deletion man/probeToMeanPromoterMethylation.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
\arguments{
\item{methylation_betas}{A data frame of methylation beta values, with CGs in rows and samples in columns. The first column must be "probeID" and contain the Illumina probeIDs matching the probe_gene_map argument or a subset thereof.}
\item{probe_gene_map}{Output from mapProbesToGenes, or otherwise a bespoke matrix with four columns: probeID, geneName, ensemblID, distToTSS.}
\item{genesOfInterest}{Character vector of gene names for which mean promoter methylation should be calculated.}
\item{genesOfInterest}{Character vector of gene names for which mean promoter methylation should be calculated.
Note that each entry in the vector should contain only one gene and that gene should not be repeated in the entry; e.g., \code{c("ASMTL","CRLF2")} is a correct input while \code{c("ASMTL;ASMTL", "CRLF2")} will fail to find probes mapping to ASMTL.
This could happen, for example, if you pull a column of genes from a resource that combines splice variants with a semicolon.}
}

\value{Matrix of samples in rows and genes in columns. row.names stores sample names and colnames stores gene names.
Expand Down

0 comments on commit d111091

Please sign in to comment.