Title: | Manhattan, Q-Q, and PCA Plots using 'ggplot2' |
---|---|
Description: | Generate Manhattan, Q-Q, and PCA plots from GWAS and PCA results using 'ggplot2'. |
Authors: | Lindokuhle Nkambule [aut, cre] |
Maintainer: | Lindokuhle Nkambule <[email protected]> |
License: | MIT + file LICENCE |
Version: | 0.3.0 |
Built: | 2024-11-08 03:11:58 UTC |
Source: | https://github.com/lindonkambule/gwars |
A package for creating Manhattan, Q-Q, and PCA plots for GWAS data.
Lindokuhle Nkambule [email protected]
Useful links:
Creates a Karyotype plot
karyotype_plot( data, density.col = c("darkgreen", "yellow", "red"), window.size = 1e+06, title = NULL )
karyotype_plot( data, density.col = c("darkgreen", "yellow", "red"), window.size = 1e+06, title = NULL )
data |
A data.frame with "CHR" and "BP"columns. |
density.col |
A character vector with colors to use for gradients. |
window.size |
A double precision numeric value indicating the window size. |
title |
A string denoting the title to use for the plot. Default is 'Manhattan Plot' |
Creates a SNP Karyotype or Density plot from an R dataframe with "CHR" and "BP" columns.
A SNP Karyotype plot.
Lindokuhle Nkambule
karyotype_plot(gwasData)
karyotype_plot(gwasData)
Creates a Manhattan plot
man_plot( data, chromCol = c("gray44", "black"), genomewideline = -log10(5e-08), suggestiveline = -log10(1e-05), chromosome = "ALL", annotatePval = FALSE, annotateSNP = NULL, annotateCol = "red", highlight = NULL, highlightCol = "green3", title = NULL )
man_plot( data, chromCol = c("gray44", "black"), genomewideline = -log10(5e-08), suggestiveline = -log10(1e-05), chromosome = "ALL", annotatePval = FALSE, annotateSNP = NULL, annotateCol = "red", highlight = NULL, highlightCol = "green3", title = NULL )
data |
PLINK assoc output, tab-delimited, or a data.frame with "SNP", "CHR", "BP", and "P" columns. |
chromCol |
A character vector indicating which colors to alternate for the chromosomes. |
genomewideline |
Where to draw the "genome-wide significant" line. Default -log10(5e-8). Set to FALSE or F to disable |
suggestiveline |
Where to draw the "suggestive" line. Default -log10(1e-5). Set to FALSE or F to disable. |
chromosome |
An integer indicating which chromosome to plot. Default is "ALL". |
annotatePval |
If set, SNPs with p-value less than or equal to this p-value will be annotated on the plot. |
annotateSNP |
A character vector of SNPs in your dataset to annotate. If some of the SNPs are not in your dataset, gwaRs will throw a warning message. |
annotateCol |
A string denoting the color to use for the annotations. |
highlight |
A character vector of SNPs in the dataset to highlight. If some of the SNPs are not in your dataset, gwaRs will throw a warning message. Default is NULL. |
highlightCol |
A string denoting the color to use to highlight the SNPs. |
title |
A string denoting the title to use for the plot. Default is 'Manhattan Plot' |
Creates a Manhattan plot from PLINK assoc output (or any tab-delimited file or data frame with "SNP", "CHR", "BP", and "P" columns).
A Manhattan plot.
Lindokuhle Nkambule
man_plot(gwasData)
man_plot(gwasData)
Creates a Mirrored Manhattan Plot for two traits
mirrored_man_plot( data, trait1 = NULL, trait2 = NULL, trait1_chromCols = c("gray66", "grey36"), trait2_chromCols = c("steelblue1", "steelblue4"), xlab = "Genomic Position (chromosome)", title = "Manhattan Plot", annotate_trait1_pval = FALSE, annotate_trait1_color = "red", annotate_trait2_pval = FALSE, annotate_trait2_color = "red", annotateSNP = NULL, annotateSNPcolor = "red", highlight = NULL, highlightcolor = "green3", genomewideline_trait1 = NULL, genomewideline_trait2 = NULL, genomewideline_type = "dashed", genomewideline_color = "red", suggestiveline_trait1 = NULL, suggestiveline_trait2 = NULL, suggestiveline_type = "dashed", suggestiveline_color = "blue" )
mirrored_man_plot( data, trait1 = NULL, trait2 = NULL, trait1_chromCols = c("gray66", "grey36"), trait2_chromCols = c("steelblue1", "steelblue4"), xlab = "Genomic Position (chromosome)", title = "Manhattan Plot", annotate_trait1_pval = FALSE, annotate_trait1_color = "red", annotate_trait2_pval = FALSE, annotate_trait2_color = "red", annotateSNP = NULL, annotateSNPcolor = "red", highlight = NULL, highlightcolor = "green3", genomewideline_trait1 = NULL, genomewideline_trait2 = NULL, genomewideline_type = "dashed", genomewideline_color = "red", suggestiveline_trait1 = NULL, suggestiveline_trait2 = NULL, suggestiveline_type = "dashed", suggestiveline_color = "blue" )
data |
A tab-delimited or data frame with the compulsory columns: "CHR", "SNP", "BP", "P", "Trait". |
trait1 |
A character string of the trait1 as it appears in the input data. |
trait2 |
A character string of the trait2 as it appears in the input data. |
trait1_chromCols |
A character vector indicating which colors to alternate for trait1 chromosomes. |
trait2_chromCols |
A character vector indicating which colors to alternate for trait2 chromosomes. |
xlab |
A character string to be used as the x-axis label. |
title |
A character string to be used as the plot title |
annotate_trait1_pval |
If set, trait1 SNPs with p-value less than or equal to this p-value will be annotated on the plot. |
annotate_trait1_color |
A character string indicating the color to be used for annotating trait1 SNPs by p-value |
annotate_trait2_pval |
If set, trait2 SNPs with p-value less than or equal to this p-value will be annotated on the plot. |
annotate_trait2_color |
A character string indicating the color to be used for annotating trait2 SNPs by p-value |
annotateSNP |
A character vector of SNPs in your dataset to annotate. If some of the SNPs are not in your dataset, gwaRs will throw a warning message. |
annotateSNPcolor |
A character string denoting the color to use for the annotations. |
highlight |
A character vector of SNPs in the dataset to highlight. If some of the SNPs are not in your dataset, gwaRs will throw a warning message. Default is NULL. |
highlightcolor |
A character string denoting the color to use to highlight the SNPs. |
genomewideline_trait1 |
Where to draw the "genome-wide significant" line for trait1 |
genomewideline_trait2 |
Where to draw the "genome-wide significant" line for trait2 |
genomewideline_type |
A character string denoting the type of line to be used for the "genome-wide significant" line. This is the same for both traits. Default is dashed. |
genomewideline_color |
A character string denoting the color to be used for the "genome-wide significant" line. This is the same for both traits. Default is red. |
suggestiveline_trait1 |
Where to draw the "suggestive" line for trait1. |
suggestiveline_trait2 |
Where to draw the "suggestive" line for trait2. |
suggestiveline_type |
A character string denoting the type of line to be used for the "suggestive" line. This is the same for both traits. Default is dashed |
suggestiveline_color |
A character string denoting the color to be used for the "suggestive" line. This is the same for both traits. Default is blue. |
Create a Mirrored Manhattan Plot from a tab-delimited file or data frame with the compulsory columns: "CHR", "SNP", "BP", "P", "Trait" .
A Mirrored Manhattan plot for two traits.
Lindokuhle Nkambule
## Not run: mirrored_man_plot(inputData) ## End(Not run)
## Not run: mirrored_man_plot(inputData) ## End(Not run)
Creates a PCA plot
pca_plot( data, xComponent = "PC1", yComponent = "PC2", legendPos = "right", soft = "PLINK", colPalette = "Accent", title = NULL )
pca_plot( data, xComponent = "PC1", yComponent = "PC2", legendPos = "right", soft = "PLINK", colPalette = "Accent", title = NULL )
data |
PLINK pca or EIGENSTRAT smartpca output, (or any tab-delimited file or data.frame with the same format as PLINK pca or EIGENSTRAT smartpca output) |
xComponent |
A character vector indicating the principal component value to use for the x-axis. Default is "PC1" |
yComponent |
A character vector indicating the principal component value to use for the x-axis. Default is "PC2" |
legendPos |
A character vector indicating the legend position. Default is "right". |
soft |
A character vector indicating the software output format. Default is "PLINK". If you have a tab-delimited file or data.frame with the same format as EIGENSTRAT output, use "EIGENSTRAT" |
colPalette |
A character vector indicating the color palette to use. Default is "Accent". |
title |
A string denoting the title to use for the plot. Default is 'PCA Plot' |
Creates a PCA plot from PLINK pca output, EIGENSTRAT smartpca, (or any tab-delimited file or data.frame with the same format as PLINK pca or EIGENSTRAT smartpca output).
A PCA plot.
Lindokuhle Nkambule
pca_plot(pcaData)
pca_plot(pcaData)
Creates a Q-Q plot
qq_plot( data, point_col = "black", diag_col = "red", diag_line = "solid", title = NULL )
qq_plot( data, point_col = "black", diag_col = "red", diag_line = "solid", title = NULL )
data |
PLINK assoc output, tab-delimited, or a data.frame with "P" column. |
point_col |
A character vector indicating the color to use for the SNP p-values. Default is "black". |
diag_col |
A character vector indicating the color to use for the diagonal line. Default is "red". |
diag_line |
A character vector indicating the line type to use for the diagonal line. Default is "solid". |
title |
A string denoting the title to use for the plot. Default is 'Q-Q Plot' |
Creates a Q-Q plot from PLINK assoc output (or any tab-delimited file or data frame with "P" column).
A Q-Q plot.
Lindokuhle Nkambule
qq_plot(gwasData)
qq_plot(gwasData)