diff --git a/Project.toml b/Project.toml index 0689744..adff472 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PopGenSims" uuid = "e670a858-c023-4621-870e-30d0f49b8322" authors = ["Pavel Dimens and contributors"] -version = "0.0.2" +version = "0.0.3" [deps] DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" @@ -12,11 +12,11 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" [compat] -DataFrames = "0.21" +DataFrames = "0.21, 0.22" InvertedIndices = "1.0" PooledArrays = "0.5" -PopGen = "0.0.3" -StaticArrays = "0.12" +StaticArrays = "0.12, 1.0" +PopGen = "0.0.3, 0.1, 0.4" StatsBase = "0.33" julia = "1.4" diff --git a/README.md b/README.md index 76ebc3b..0c391ea 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ ![logo](PopGenSims.png) +[![alt text](https://img.shields.io/badge/docs-stable-informational?style=for-the-badge&logo=Read%20The%20Docs&logoColor=white)](https://pdimens.github.io/PopGen.jl/docs/simulations/simulate_samples) ## Create population genetics simulations This package builds off of [PopGen.jl](http://github.com/pdimens/PopGen.jl) and -simulates offspring that would be generated under certain conditions. With this package you can simulate the offspring of specific individuals, simulate full-sibs, half-sibs, unrelated individuals, and parent-offspring pairs for use with PopGen.jl. +simulates offspring that would be generated under certain conditions. With this package you can simulate the offspring of specific individuals, simulate full-sibs, half-sibs, unrelated individuals, and parent-offspring pairs for use with PopGen.jl. You can also randomly generate samples given population-specific allele frequencies. ### Installation ```julia @@ -13,54 +14,4 @@ pkg(v1.5)> add "http://github.com/pdimens/PopGenSims.jl" ``` ### Usage -#### Import the package -``` -julia> using PopGenSims -``` - -#### Import the data -``` -# to use included dataset -julia> cats = nancycats() - -# to use your own data -julia> data = read_from("path/to/filename.ext", kwargs...); -``` - -#### Perform a cross -The `cross` function for a simple parental cross from individuals in the same `PopData` object follows the syntax -``` -cross(::PopData, parent1::String, parent2::String; n::Int) -``` -where `parent1` and `parent2` are strings of the names of the parents in the PopData, and the keyword `n` specifies the number of offspring you would like to simulate. - -##### example -``` -julia> f1 = cross(data, "sample1", "sample2", n = 100000) ; -``` - -#### Perform a backcross -This syntax uses the `Pair` notation of `PopData => Parent` to specify inputs. -``` -cross(PopData => "Parent1Name", PopData => "Parent2Name", n::Int, generation::String) -``` -where again `n` is a keyword argument for the number of offspring to produce, and `generation` is a keyword argument for the `population` identity to the assign the offspring. - -##### example -``` -julia> f2_backcross = cross(data => "sample1", f1 => "offspring_99", n = 100000, generation = "F2") ; - -# merge PopData objects -crossed_sims = append(data, f1) -``` - -Currently, `PopGenSims` can create crosses for: -- haploids (ploidy = 1) -- diploids (ploidy = 2) -- tetraploids (ploidy = 4) -- hexaploids (ploidy = 6) -- octaploids (ploidy = 8) - -To learn more about reading in data, see the docstring `?read_from` or read the [PopGen.jl docs section](https://pdimens.github.io/PopGen.jl/docs/io/file_import) on it. - -To learn more about crossing see their docstrings with `?cross` +Documentation for PopGenSims.jl has been integrated into [the PopGen.jl docs](https://pdimens.github.io/PopGen.jl/docs/simulations/simulate_samples) diff --git a/src/PopGenSims.jl b/src/PopGenSims.jl index 8a3d69b..cc466a0 100644 --- a/src/PopGenSims.jl +++ b/src/PopGenSims.jl @@ -9,7 +9,6 @@ using PopGen: get_genotypes, read_from, write_to, - nancycats, sort include("Cross.jl") @@ -18,4 +17,3 @@ include("Sibship.jl") include("Utils.jl") end -