Skip to content

Commit

Permalink
add method docstrings (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
biona001 committed Sep 1, 2020
1 parent 0b7eff5 commit 3dc53ec
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/MendelKinship.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ using StatsBase
export Kinship

"""
Kinship(control_file = ""; args...)
This is the wrapper function for the Kinship analysis option. Keyword options
should be specified in the control file.
"""
Expand Down Expand Up @@ -127,6 +129,8 @@ function Kinship(control_file = ""; args...)
end # function Kinship

"""
compare_kinships(genotyped_pedigree, genotyped_person, snpdata,person_frame, keyword)
This function orchestrates the comparison of theoretical
and empirical kinships including Fisher z-scores.
The results are placed in a dataframe.
Expand Down Expand Up @@ -269,6 +273,8 @@ function compare_kinships(genotyped_pedigree::Pedigree,
end # function compare_kinships

"""
theoretical_coefficients(pedigree::Pedigree, person::Person, keyword::Dict{AbstractString, Any}
This function orchestrates the computation via gene dropping
of the Kinship and Delta7 coefficients deterministically
and Jacquard's 9 identity coefficients stochastically.
Expand Down Expand Up @@ -362,6 +368,8 @@ function theoretical_coefficients(pedigree::Pedigree, person::Person,
end # function theoretical_coefficients

"""
kinship_matrix(pedigree::Pedigree, person::Person, ped::Int, xlinked::Bool)
This function recursively computes a kinship matrix for each pedigree.
Children must appear after parents. Each pedigree occurs in a block
demarked by its start and finish and is defined implicitly by
Expand Down Expand Up @@ -417,6 +425,8 @@ function kinship_matrix(pedigree::Pedigree, person::Person,
end # function kinship_matrix

"""
delta7_matrix(pedigree::Pedigree, person::Person, kinship::Matrix{Float64}, ped::Int)
This function computes the Delta7 matrix for non-inbred pedigrees.
Children must appear after parents. Each pedigree occurs in a block
and is defined implicitly by the provided fathers and mothers.
Expand Down Expand Up @@ -452,6 +462,8 @@ function delta7_matrix(pedigree::Pedigree, person::Person,
end # function delta7_matrix

"""
jacquard_coefficients(pedigree, person, ped::Int, replicates::Int, xlinked::Bool)
This function computes Jacquard's nine condensed identity
coefficients for each pedigree by simulation. Children
must appear after parents. A pedigree is defined implicitly
Expand Down Expand Up @@ -517,6 +529,8 @@ function jacquard_coefficients(pedigree::Pedigree, person::Person,
end # function jacquard_coefficients

"""
cotwin_extension!(x::Matrix{Float64}, pedigree::Pedigree, person::Person, ped::Int)
This function extends identity coefficients to co-twins.
"""
function cotwin_extension!(x::Matrix{Float64}, pedigree::Pedigree,
Expand All @@ -537,6 +551,8 @@ function cotwin_extension!(x::Matrix{Float64}, pedigree::Pedigree,
end # function cotwin_extension!

"""
identity_state(source1::Vector{Int}, source2::Vector{Int})
This function assigns one of the 9 condensed identity states
to two sourced genotypes. The integer n is the number of
unique genes among the 4 sampled genes.
Expand Down Expand Up @@ -588,6 +604,8 @@ end # function make_plot_pairs


"""
make_compare_plot(x::DataFrame, plot_pair::Vector{String})
This function composes the comparison plot using PlotlyJS.
"""
function make_compare_plot(x::DataFrame, plot_pair::Vector{String})
Expand All @@ -609,6 +627,8 @@ end # function make_compare_plot


"""
compute_fishers_z(x::DataFrame)
This function computes Fisher's atanh transform and standardizes.
"""
function compute_fishers_z(x::DataFrame)
Expand All @@ -622,6 +642,8 @@ end # function compute_fishers_z


"""
plot_fisher_z(x::DataFrame, plot_pair::Vector{String})
This function plots the transformed data using PlotlyJS.
"""
function plot_fisher_z(x::DataFrame, plot_pair::Vector{String})
Expand Down

0 comments on commit 3dc53ec

Please sign in to comment.