Skip to content

Commit

Permalink
Merge pull request #14 from pdimens/dev
Browse files Browse the repository at this point in the history
merge dev into release
  • Loading branch information
pdimens committed Jan 7, 2021
2 parents 2f231df + 5a83d6c commit 48f2ece
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 58 deletions.
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PopGenSims"
uuid = "e670a858-c023-4621-870e-30d0f49b8322"
authors = ["Pavel Dimens <[email protected]> and contributors"]
version = "0.0.2"
version = "0.0.3"

[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand All @@ -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"

Expand Down
55 changes: 3 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
2 changes: 0 additions & 2 deletions src/PopGenSims.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ using PopGen:
get_genotypes,
read_from,
write_to,
nancycats,
sort

include("Cross.jl")
Expand All @@ -18,4 +17,3 @@ include("Sibship.jl")
include("Utils.jl")

end

0 comments on commit 48f2ece

Please sign in to comment.