plot_summariseSNP {geneNR} | R Documentation |
Plot SNP Distribution Across Chromosomes
Description
Creates a bar chart representing the distribution of SNPs across chromosomes. Allows customization of bar color, label size, and label color. Saves the plot to a user-specified directory or a temporary directory.
Usage
plot_summariseSNP(
snp_distribution,
file_name = "snp_bar_chart.jpeg",
output_dir = tempdir(),
bar_color = "lightblue",
label_size = 3,
label_color = "black"
)
Arguments
snp_distribution |
A data frame with columns |
file_name |
The name of the file to save the plot (default: "snp_bar_chart.jpeg"). |
output_dir |
The directory to save the file (default: |
bar_color |
The color of the bars (default: "lightblue"). |
label_size |
The size of the text labels on the bars (default: 3). |
label_color |
The color of the text labels on the bars (default: "black"). |
Value
A ggplot
object for the created bar chart.
Examples
demo_SNP <- system.file("extdata", "demo_SNP.hmp.txt", package = "geneNR")
data <- import_hmp(demo_SNP)
snp_distribution <- summariseSNP(data)
plot <- plot_summariseSNP(snp_distribution, bar_color = "skyblue",
label_size = 3, label_color = "red")
print(plot)
[Package geneNR version 2.0.1 Index]