map_genes | R Documentation |
This function maps Ensembl gene IDs in DESeq2 differential expression results to target gene names using a provided gene mapping data frame.
map_genes(DE_Seq_Result, gene_mapping = gene_mapping_MMUL10)
DE_Seq_Result |
A data frame containing DESeq2 results, where row names are Ensembl gene IDs. |
gene_mapping |
A data frame with at least two columns: '"input"' (Ensembl IDs) and '"target"' (gene symbols). Default is 'gene_mapping_MMUL10'. |
The function:
Extracts Ensembl gene IDs from 'DE_Seq_Result' row names.
Merges DESeq2 results with 'gene_mapping' to retrieve corresponding gene symbols.
Assigns '"gene"' column values based on mapped names or retains Ensembl IDs if no match is found.
A data frame with an additional '"ensembl_ID"' column and a '"gene"' column containing mapped gene names. If no match is found in 'gene_mapping', the Ensembl ID is retained as the gene name.
## Not run:
# Example DESeq2 results (mock data)
DE_Seq_Result <- data.frame(log2FoldChange = c(1.5, -2.3, 0.8),
padj = c(0.01, 0.05, 0.2))
rownames(DE_Seq_Result) <- c("ENSG000001", "ENSG000002", "ENSG000003")
# Example gene mapping table
gene_mapping <- data.frame(input = c("ENSG000001", "ENSG000002"),
target = c("GeneA", "GeneB"))
# Run gene mapping
mapped_results <- map_genes(DE_Seq_Result, gene_mapping)
print(mapped_results)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.