API
GeneticsMakie.findclosestgene
GeneticsMakie.findgene
GeneticsMakie.findgwasloci
GeneticsMakie.labelgenome
GeneticsMakie.mungesumstats!
GeneticsMakie.parsegtf!
GeneticsMakie.plotgenes!
GeneticsMakie.plotgenes!
GeneticsMakie.plotgwas!
GeneticsMakie.plotisoforms!
GeneticsMakie.plotld
GeneticsMakie.plotlocus!
GeneticsMakie.plotloops!
GeneticsMakie.plotqq!
GeneticsMakie.plotrg
GeneticsMakie.findclosestgene
— Methodfindclosestgene(chr::AbstractString, bp::Real, gencode::DataFrame; start::Bool, proteincoding::Bool)
-findclosestgene(df::DataFrame, gencode::DataFrame; start::Bool, proteincoding::Bool)
Find the closest gene(s) to a genomic coordinate or a list of genomic coordinates using gencode
.
Optionally, the closest gene can be defined from the gene start site using start
, and only protein coding genes can be considered using proteincoding
. The default start
and proteincoding
are false
.
GeneticsMakie.findgene
— Methodfindgene(gene::AbstractString, gencode::DataFrame)
Find chromosome, gene start, and gene stop sites for the gene
of interest.
GeneticsMakie.findgwasloci
— Methodfindgwasloci(gwas::DataFrame; p::Real)
-findgwasloci(gwas::Vector{DataFrame}; p::Real)
Find genome-wide significant loci for gwas
that are separated from each other by at least 1 Mb.
Alternatively, find genome-wide significant loci across multiple gwas
that are all separated by at least 1 Mb. p
determines the genome-wide significance threshold, which is 5e-8 by default.
GeneticsMakie.labelgenome
— Methodlabelgenome(g::GridPosition, chromosome::AbstractString, range1::Real, range2::Real)
Label g
with a given chromosome
and genomic range between range1
and range2
.
GeneticsMakie.mungesumstats!
— Methodmungesumstats!(gwas::DataFrame)
-mungesumstats!(gwas::Vector{DataFrame})
Munge gwas
by harmonizing the names of columns, their types, and P values, among others.
GeneticsMakie.parsegtf!
— Methodparsegtf!(gencode::DataFrame)
Parse gencode
by extracting gene_id
, gene_name
, gene_type
, transcript_id
, transcript_support_level
information from the info
column.
GeneticsMakie.plotgenes!
— Methodplotgenes!(ax::Axis, chromosome::AbstractString, range1::Real, range2::Real, gencode::DataFrame; kwargs)
+findclosestgene(df::DataFrame, gencode::DataFrame; start::Bool, proteincoding::Bool)
Find the closest gene(s) to a genomic coordinate or a list of genomic coordinates using gencode
.
Optionally, the closest gene can be defined from the gene start site using start
, and only protein coding genes can be considered using proteincoding
. The default start
and proteincoding
are false
.
GeneticsMakie.findgene
— Methodfindgene(gene::AbstractString, gencode::DataFrame)
Find chromosome, gene start, and gene stop sites for the gene
of interest.
GeneticsMakie.findgwasloci
— Methodfindgwasloci(gwas::DataFrame; p::Real)
+findgwasloci(gwas::Vector{DataFrame}; p::Real)
Find genome-wide significant loci for gwas
that are separated from each other by at least 1 Mb.
Alternatively, find genome-wide significant loci across multiple gwas
that are all separated by at least 1 Mb. p
determines the genome-wide significance threshold, which is 5e-8 by default.
GeneticsMakie.labelgenome
— Methodlabelgenome(g::GridPosition, chromosome::AbstractString, range1::Real, range2::Real)
Label g
with a given chromosome
and genomic range between range1
and range2
.
GeneticsMakie.mungesumstats!
— Methodmungesumstats!(gwas::DataFrame)
+mungesumstats!(gwas::Vector{DataFrame})
Munge gwas
by harmonizing the names of columns, their types, and P values, among others.
GeneticsMakie.parsegtf!
— Methodparsegtf!(gencode::DataFrame)
Parse gencode
by extracting gene_id
, gene_name
, gene_type
, transcript_id
, transcript_support_level
information from the info
column.
GeneticsMakie.plotgenes!
— Methodplotgenes!(ax::Axis, chromosome::AbstractString, range1::Real, range2::Real, gencode::DataFrame; kwargs)
plotgenes!(ax::Axis, chromosome::AbstractString, bp::Real, gencode::DataFrame; kwargs)
-plotgenes!(ax::Axis, gene::AbstractString, gencode::DataFrame; kwargs)
Plot collapsed gene bodies for genes within a given chromosome
and genomic range between range1
and range2
.
Alternatively, plot within a given chromosome
and a certain window
around a genomic coordinate bp
or plot within a certain window
around gene
.
Arguments
height::Real = 0.25
: the height of exons.genecolor = :royalblue
: the color of genes.textcolor = :black
: the color of gene labels.window::Real = 1e6
: the window aroundbp
orgene
.
GeneticsMakie.plotgenes!
— Methodplotgenes!(ax::Axis, chromosome::AbstractString, range1::Real, range2::Real, highlight::Tuple{AbstractVector, AbstractVector}, gencode::DataFrame; height::Real)
+plotgenes!(ax::Axis, gene::AbstractString, gencode::DataFrame; kwargs)
Plot collapsed gene bodies for genes within a given chromosome
and genomic range between range1
and range2
.
Alternatively, plot within a given chromosome
and a certain window
around a genomic coordinate bp
or plot within a certain window
around gene
.
Arguments
height::Real = 0.25
: the height of exons.genecolor = :royalblue
: the color of genes.textcolor = :black
: the color of gene labels.window::Real = 1e6
: the window aroundbp
orgene
.
GeneticsMakie.plotgenes!
— Methodplotgenes!(ax::Axis, chromosome::AbstractString, range1::Real, range2::Real, highlight::Tuple{AbstractVector, AbstractVector}, gencode::DataFrame; height::Real)
plotgenes!(ax::Axis, chromosome::AbstractString, bp::Real, highlight::Tuple{AbstractVector, AbstractVector}, gencode::DataFrame; window::Real, height::Real)
-plotgenes!(ax::Axis, gene::AbstractString, highlight::Tuple{AbstractVector, AbstractVector}, gencode::DataFrame; window::Real, height::Real)
Plot gene bodies with a vector of genes highlighted by a vector of colors via highlight
.
GeneticsMakie.plotgwas!
— Methodplotgwas!(ax::Axis, gwas::DataFrame; ymax::Real, p::Real, sigline::Bool, sigcolor::Bool, build = 37)
Plot gwas
results as a Manhattan plot.
Arguments
ymax::Real
: the maximum value for y axis.p::Real = 5e-8
: the genome-wide significance threshold.linecolor = :red2
: the color of genome-wide significance line, which can be turned off by setting tonothing
.scattercolor = "#4DB069"
: the color of genome-wide significant variants, which can be turned off by setting tonothing
.chromcolors = ["#0D0D66", "#7592C8"]
: the colors of even and odd chromosomes.build::Int = 37
: the human genome build.
GeneticsMakie.plotisoforms!
— Methodplotisoforms!(ax::Axis, gene::AbstractString, gencode::DataFrame; kwargs)
Plot each isoform of a given gene
on a separate row.
Arguments
orderby::Union{Nothing, AbstractVector{<:AbstractString}} = nothing
: the order of isoforms.highlight::Union{Nothing, Tuple{AbstractVector, AbstractVector}} = nothing
: isoforms to be highlighted and their colors.height::Real = 0.25
: the height of exons.isoformcolor = :royalblue
: the color of isoforms.textcolor = :black
: the color of isoform labels.text::Union{Bool, Symbol} = :top
: the position of isoform labels.
GeneticsMakie.plotld
— Methodplotld(LD::AbstractMatrix; kwargs)
-plotld!(ax::Axis, LD::AbstractMatrix; kwargs)
Heatmap of symmetric correlation matrix LD
with the diagonal elements on the x-axis.
Keyword arguments
threshold
: threshold below which values are ignored (default to1/9
)colormap
: colormap of values (default tocgrad(:Blues_9, 9, categorical = true)
)colorrange
: start and end points ofcolormap
(default to(0, 1)
)strokewidth
: width of outline around heatmap boxes (default to0
)
GeneticsMakie.plotlocus!
— Methodplotlocus!(ax::Axis, chromosome::AbstractString, range1::Real, range2::Real, gwas::DataFrame; kwargs)
+plotgenes!(ax::Axis, gene::AbstractString, highlight::Tuple{AbstractVector, AbstractVector}, gencode::DataFrame; window::Real, height::Real)
Plot gene bodies with a vector of genes highlighted by a vector of colors via highlight
.
GeneticsMakie.plotgwas!
— Methodplotgwas!(ax::Axis, gwas::DataFrame; ymax::Real, p::Real, sigline::Bool, sigcolor::Bool, build = 37)
Plot gwas
results as a Manhattan plot.
Arguments
ymax::Real
: the maximum value for y axis.p::Real = 5e-8
: the genome-wide significance threshold.linecolor = :red2
: the color of genome-wide significance line, which can be turned off by setting tonothing
.scattercolor = "#4DB069"
: the color of genome-wide significant variants, which can be turned off by setting tonothing
.chromcolors = ["#0D0D66", "#7592C8"]
: the colors of even and odd chromosomes.build::Int = 37
: the human genome build.
GeneticsMakie.plotisoforms!
— Methodplotisoforms!(ax::Axis, gene::AbstractString, gencode::DataFrame; kwargs)
Plot each isoform of a given gene
on a separate row.
Arguments
orderby::Union{Nothing, AbstractVector{<:AbstractString}} = nothing
: the order of isoforms.highlight::Union{Nothing, Tuple{AbstractVector, AbstractVector}} = nothing
: isoforms to be highlighted and their colors.height::Real = 0.25
: the height of exons.isoformcolor = :royalblue
: the color of isoforms.textcolor = :black
: the color of isoform labels.text::Union{Bool, Symbol} = :top
: the position of isoform labels.
GeneticsMakie.plotld
— Methodplotld(LD::AbstractMatrix; kwargs)
+plotld!(ax::Axis, LD::AbstractMatrix; kwargs)
Heatmap of symmetric correlation matrix LD
with the diagonal elements on the x-axis.
Keyword arguments
threshold
: threshold below which values are ignored (default to1/9
)colormap
: colormap of values (default tocgrad(:Blues_9, 9, categorical = true)
)colorrange
: start and end points ofcolormap
(default to(0, 1)
)strokewidth
: width of outline around heatmap boxes (default to0
)
GeneticsMakie.plotlocus!
— Methodplotlocus!(ax::Axis, chromosome::AbstractString, range1::Real, range2::Real, gwas::DataFrame; kwargs)
plotlocus!(ax::Axis, chromosome::AbstractString, bp::Real, gwas::DataFrame; kwargs)
-plotlocus!(ax::Axis, gene::AbstractString, gwas::DataFrame, gencode::DataFrame; kwargs)
Plot gwas
results within a given chromosome
and genomic range between range1
and range2
.
Alternatively, plot within a given chromosome
and a certain window
around a genomic coordinate bp
or plot within a certain window
around gene
.
Arguments
ld::Union{Nothing, SnpData, Tuple{SnpData, Union{AbstractString, Tuple{AbstractString, Int}}}} = nothing
: the reference panel for which LD is calculated.ymax::Real
: the maximum value for y axis.window::Real = 1e6
: the window aroundbp
orgene
.
GeneticsMakie.plotloops!
— Methodplotloops!(ax::Axis, chromosome::AbstractString, range1::Real, range2::Real, loopdf::DataFrame; kwargs)
+plotlocus!(ax::Axis, gene::AbstractString, gwas::DataFrame, gencode::DataFrame; kwargs)
Plot gwas
results within a given chromosome
and genomic range between range1
and range2
.
Alternatively, plot within a given chromosome
and a certain window
around a genomic coordinate bp
or plot within a certain window
around gene
.
Arguments
ld::Union{Nothing, SnpData, Tuple{SnpData, Union{AbstractString, Tuple{AbstractString, Int}}}} = nothing
: the reference panel for which LD is calculated.ymax::Real
: the maximum value for y axis.window::Real = 1e6
: the window aroundbp
orgene
.
GeneticsMakie.plotloops!
— Methodplotloops!(ax::Axis, chromosome::AbstractString, range1::Real, range2::Real, loopdf::DataFrame; kwargs)
plotloops!(ax::Axis, chromosome::AbstractString, bp::Real, loopdf::DataFrame; kwargs)
-plotloops!(ax::Axis, gene::AbstractString, loopdf::DataFrame, gencode::DataFrame; kwargs)
Plot loops present in loopdf
within a given chromosome
and genomic range between range1
and range2
.
Alternatively, plot within a given chromosome
and a certain window
around a genomic coordinate bp
or plot within a certain window
around gene
.
Arguments
ymax::Real = 102
: the maximum value for y axis.linewidth = 0.25
: the line width of the loops' arcs.colorarc = "#9658B2"
: the color of loops' arcs.colorend = ("#FFBB00", 0.5)
: the color of loops' ends.resolution = 1000
: plotresolution
points along x-axis within the given range.
GeneticsMakie.plotqq!
— Methodplotqq!(ax::Axis, gwas::DataFrame; kwargs)
-plotqq!(ax::Axis, P::AbstractVector; kwargs)
Plot QQ plot of P
values where the expected distribution is the uniform distribution.
Keyword arguments include xstep::Real
and ystep::Real
for x and y axes ticks step sizes.
GeneticsMakie.plotrg
— Methodplotrg(r::AbstractMatrix; kwargs)
-plotrg!(ax::Axis, r::AbstractMatrix; kwargs)
Correlation plot of matrix r
.
Keyword arguments
circle
: whether to draw cicles instead of rectangles (default totrue
)diagonal
: whether to visualize diagonal elements (default tofalse
)colormap
: colormap of values (default to:RdBu_10
)colorrange
: start and end points ofcolormap
(default to(-1, 1)
)strokewidth
: width of outline around surrounding boxes (default to0.5
)