Human Chromosome Karyotype Gene Plot using BioConductor
A Karyotype Gene Plot (or ideogram plot) is a visual representation of an entire genome, mapping the locations of specific genes, mutations, or data points directly onto the chromosomes. It allows you to see broad chromosomal abnormalities, gene distributions, or variations in a single, genome-wide view.
This example demonstrates how to locate specific genes within a genome and visualize them in a plot. Using the biomaRt Bioconductor package, we will automatically retrieve these gene coordinates from the Ensembl BioMart database. The resulting data frame will then be converted into a GRanges object using regioneR's toGRanges function. Because our target genome uses UCSC conventions, we will use seqlevelsStyle to adjust the chromosome naming format from Ensembl to UCSC. The example is based on the GRCh38 assembly (Homo sapiens (human) genome assembly (hg38) - Human Build 38 Organism), which aligns with the current version of BioMart.
Program Implementation
In this tutorial, I have used Google Colab Notebook for running the R program. Click here for interactive demo.
R Program
if (!require("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
}
if (!require("biomaRt", quietly = TRUE)) {
BiocManager::install("biomaRt")
}
if (!require("regioneR", quietly = TRUE)) {
BiocManager::install("regioneR")
}
if (!require("karyoploteR", quietly = TRUE)) {
BiocManager::install("karyoploteR")
}
library(biomaRt)
library(regioneR)
library(GenomeInfoDb)
library(karyoploteR)
ensembl <- useEnsembl(biomart = "ensembl", dataset = "hsapiens_gene_ensembl")
gene.symbols <- c("SPTLC3", "A2MP1", "MT1M", "GJB1", "ITIH3", "GSTM1", "HPD",
"RPL10L", "GMFG", "SERPINC1", "CMIP", "BASP1", "PI4KB",
"PHF3", "GOLGB1", "ZSWIM8", "MARK2", "ANKRD17")
bm_data <- getBM(attributes = c('chromosome_name', 'start_position',
'end_position', 'hgnc_symbol'),
filters = 'hgnc_symbol',
values = gene.symbols,
mart = ensembl)
genes <- toGRanges(bm_data)
genes$hgnc_symbol <- bm_data$hgnc_symbol
seqlevelsStyle(genes) <- "UCSC"
genes <- keepStandardChromosomes(genes, pruning.mode = "coarse")
group_A <- c("SPTLC3", "A2MP1", "MT1M", "GJB1", "ITIH3",
"GSTM1", "HPD", "RPL10L", "GMFG")
genes$marker_color <- ifelse(genes$hgnc_symbol %in% group_A, "blue", "darkred")
plot_params <- getDefaultPlotParams(plot.type = 2)
plot_params$ideogramheight <- 250
kp <- plotKaryotype(genome = "hg38", plot.params = plot_params,
labels.plotter = NULL)
kpAddChromosomeNames(kp, col = "darkgreen", cex = 1, font = 2, family = "serif")
kpPlotMarkers(kp, data = genes, labels = genes$hgnc_symbol,
text.orientation = "horizontal", r0 = 0, r1 = 1, cex = 0.5,
label.color = genes$marker_color,
line.color = genes$marker_color, adjust.label.position = FALSE)
List of Genes
The list of genes used in this program are SPTLC3, A2MP1, MT1M, GJB1, ITIH3, GSTM1, HPD, RPL10L, GMFG, SERPINC1, CMIP, BASP1, AP1G1, PI4KB, PHF3, GOLGB1, DENND4B, ZSWIM8, MARK2, and ANKRD17. Whereas, the genes SPTLC3, A2MP1, MT1M, GJB1, ITIH3, GSTM1, HPD, RPL10L, and GMFG are differentiated in color labels in the plot as up-regulated and remaining as down-regulated.
Comments
Post a Comment