# Current state of PopGen.jl

**URL:** <https://discourse.julialang.org/t/current-state-of-popgen-jl/41616>\
**Category:** Biology, Health, and Medicine\
**Created:** [June 17, 2020, 5:40pm UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616 "2020-06-17T17:40:49Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![pdimens](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdimens/32/15729_2.png) [@pdimens](https://discourse.julialang.org/u/pdimens)\
**Post date:** [June 17, 2020, 5:40pm UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/1 "2020-06-17T17:40:49Z")

</div>

Hello all,

For the past (I honestly don’t know how many) months, I’ve been writing and rewriting my fork of `PopGen.jl` ([found here](https://github.com/pdimens/PopGen.jl/tree/fstats)). The vast majority of the work involved was establishing a data structure and a million internal functions to facilitate common things that would need to be done for most kinds of analyses (e.g. allele frequency calculations).

Working on this package started as a passion-project to improve my Julia chops along with my understanding of the mathematical principals of population genetics, which I admit I’m not great at and have recruited Jason Selwyn to help with (great at math, not great at Julia). I just recently finished porting `basic.stats.` from the `hierfstat` package in R, and have been working on writing a series of helper functions to perform permutation tests for these F-statistics.

I’d hope to one day merge my fork of PopGen.jl into the BioJulia one, but I’d say it’s much too early for something like that. For the basic benchmarks that I’ve ran with what there currently is, PopGen.jl blows `hierfstat` and `adegenet` out of the water (see the docs), which is kind of reassuring, although it’s the basics. It would be great to have some extra eyes to look at what’s been done so far and suggest changes/improvements, especially if it pertains to anything fundamental like the `PopData` type itself or how genotypes are encoded. The `main` and `dev` branches are dated, b/c `fstat` is the one that I’m actively working on. My process is to make a branch for a particular task, when it’s done merge to `dev`, repeat, then make sure everything works in `dev` before merging with `main`.

Thanks!

Pavel

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [June 17, 2020, 7:09pm UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/2 "2020-06-17T19:09:37Z")

</div>

Rad! Might also be of interest to EcoJulia folks. I’m not sure this is still happening, and if it does it will likely be virtual, but you would likely be welcome to [join in this meetup](https://github.com/EcoJulia/SpatialEcology.jl/issues/49).

Re: the permutation / fstats, is that the same thing as PERMANOVA? I would really love to stop relying on RCall and vegan, but haven’t found the time to understand how that works well enough to port it.

---

<div class="post-metadata">

**Author:** ![pdimens](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdimens/32/15729_2.png) [@pdimens](https://discourse.julialang.org/u/pdimens)\
**Post date:** [June 17, 2020, 8:05pm UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/3 "2020-06-17T20:05:25Z")

</div>

That meet up looks awesome, thanks!

Regarding the permutations stuff, I’m not super clear on the math yet (why I rely on Jason!), but for now it’s a matter of calculating P-vals and confidence intervals for F statistics. Our ultimate goal with the permutations is to get a functional AMOVA. That being said, if you check out the `Permutations.jl` file in `src` I’ve written some reasonably-performant (I think) permutation methods for long-format data frames.

---

<div class="post-metadata">

**Author:** ![tomkXY](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomkxy/32/16374_2.png) [@tomkXY](https://discourse.julialang.org/u/tomkXY)\
**Post date:** [July 14, 2020, 12:16pm UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/4 "2020-07-14T12:16:51Z")

</div>

I’m willing to help on this if this project is still active and you need help with anything.

---

<div class="post-metadata">

**Author:** ![pdimens](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdimens/32/15729_2.png) [@pdimens](https://discourse.julialang.org/u/pdimens)\
**Post date:** [July 14, 2020, 12:28pm UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/5 "2020-07-14T12:28:06Z")

</div>

Oh yay! Thanks for your interest and offer! This project is 100% active and we can chat about details on the PopGen.jl slack 😁

---

<div class="post-metadata">

**Author:** ![pdimens](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdimens/32/15729_2.png) [@pdimens](https://discourse.julialang.org/u/pdimens)\
**Post date:** [July 14, 2020, 12:34pm UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/6 "2020-07-14T12:34:34Z")

</div>

Update:  
I’m working to get the package into the general registry and have all the fancy bits other packages seem to like CompatHelper and CI on the `main` and `dev` branches. Tests would be nice, but they aren’t a high priority atm. It’s nice to at least have a build test on `dev` bc I break stuff all the time (intentionally or not) and notices are nice.

Also, I’d like to invite anyone that’s interested to join the PopGen.jl slack group! [Slack](https://join.slack.com/t/popgenjl/shared_invite/zt-deam65n8-DuBs2z1oDtsbBuRplJW~Pg)

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [July 14, 2020, 3:23pm UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/7 "2020-07-14T15:23:58Z")

</div>

> [@pdimens](#):
>
> Also, I’d like to invite anyone that’s interested to join the PopGen.jl slack group!

Please no! I can’t take another slack workspace… Can’t you just make a channel on the julia slack (or better yet, zulip 😉)

 ![Screen Shot 2020-07-14 at 11.23.08 AM](https://global.discourse-cdn.com/julialang/original/3X/f/a/fa14a221b920702655780dc5b06e040b053ca77a.png)

---

<div class="post-metadata">

**Author:** ![pdimens](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdimens/32/15729_2.png) [@pdimens](https://discourse.julialang.org/u/pdimens)\
**Post date:** [July 14, 2020, 3:31pm UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/8 "2020-07-14T15:31:42Z")

</div>

@kevbonham but it has my github integrations ☹

Also, there’s so much activity on the Julia slack vs the activity at PopGen that our content will be cleared ~weekly. It’s been reeeeally hard for me to adopt tulip, probably bc the workspace is so big.

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [July 14, 2020, 3:35pm UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/9 "2020-07-14T15:35:19Z")

</div>

Fair enough 😆

---

<div class="post-metadata">

**Author:** ![tomkXY](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomkxy/32/16374_2.png) [@tomkXY](https://discourse.julialang.org/u/tomkXY)\
**Post date:** [July 15, 2020, 12:08am UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/10 "2020-07-15T00:08:16Z")

</div>

> Please no! I can’t take another slack workspace.

I have more than enough of these as well but I understand a dedicated one will be better. Feel free to poke me if I don’t respond in a while.

---

<div class="post-metadata">

**Author:** ![tomkXY](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomkxy/32/16374_2.png) [@tomkXY](https://discourse.julialang.org/u/tomkXY)\
**Post date:** [July 15, 2020, 12:49am UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/11 "2020-07-15T00:49:45Z")

</div>

By the way, the link to the repo is broken: [https://github.com/pdimens/PopGen.jl/](https://github.com/pdimens/PopGen.jl/)

[https://github.com/pdimens/PopGen.jl/projects](https://github.com/pdimens/PopGen.jl/projects)

---

<div class="post-metadata">

**Author:** ![pdimens](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdimens/32/15729_2.png) [@pdimens](https://discourse.julialang.org/u/pdimens)\
**Post date:** [July 15, 2020, 12:58am UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/12 "2020-07-15T00:58:14Z")

</div>

Oh oops. What a rookie mistake! Thanks for pointing that out.

---

<div class="post-metadata">

**Author:** ![SergeantMike67](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergeantmike67/32/25103_2.png) [@SergeantMike67](https://discourse.julialang.org/u/SergeantMike67)\
**Post date:** [September 21, 2020, 3:29pm UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/13 "2020-09-21T15:29:16Z")

</div>

I am also interested in assisting but am completely unsure of how I can help. I am a newbie to Julia and am trying to figure out the quirks and syntax.

---

<div class="post-metadata">

**Author:** ![pdimens](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdimens/32/15729_2.png) [@pdimens](https://discourse.julialang.org/u/pdimens)\
**Post date:** [September 21, 2020, 3:46pm UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/14 "2020-09-21T15:46:42Z")

</div>

@SergeantMike67 that’s great to hear! The one way to get started with Julia is to pick a basic thing to try to do and read the official docs to figure it out (my method). Another would be to have a read of [Ben Lauwens excellent Think Julia book](https://benlauwens.github.io/ThinkJulia.jl/latest/book.html).  
Once you get a bit more acquainted with the basics of navigating the language you can have a look at [the PopGen docs](https://pdimens.github.io/PopGen.jl/docs/) and try to go through the basic tutorial of loading in example data and manipulating/viewing `PopData` objects. The cool thing is that the package is now registered in `General`, so you can now install it with `]add PopGen` (all that info will be updated with the next release).

Once you get that far and are still interested, you can [join the Slack group](https://join.slack.com/t/popgenjl/shared_invite/zt-deam65n8-DuBs2z1oDtsbBuRplJW~Pg) and chat with us directly and we can figure out how your strengths can add to the package 🙂

Hopefully by the end of October Jason and I will have a big new release ready for everyone to play around with. It’s a bit of a spoiler, but the next release (`kinship` branch) will tidy up some methods, speed up some others, parallelize a bunch of things, introduce a **very** competitive suite of relatedness measures and come bundled with a new release of [PopGenSims.jl](https://github.com/pdimens/PopGenSims.jl) that will provide some awesome sibship simulations.

---

<div class="post-metadata">

**Author:** ![SergeantMike67](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergeantmike67/32/25103_2.png) [@SergeantMike67](https://discourse.julialang.org/u/SergeantMike67)\
**Post date:** [September 21, 2020, 4:20pm UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/15 "2020-09-21T16:20:23Z")

</div>

My dream is to come up with a RAD-seq package to use on my data. I am getting my feet wet with a Needleman\_Wunch algorithm to get the syntax down. I am not a virgin programmer having a lot of experience using VBA (mostly) and developing R routines so I am not coming at this with “Object Oriented? How do I get the plate into the computer and why do I have to orient the computer towards the plate?” stage. I’m more struggling with the Julia specific jargon.

---

<div class="post-metadata">

**Author:** ![pdimens](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdimens/32/15729_2.png) [@pdimens](https://discourse.julialang.org/u/pdimens)\
**Post date:** [September 21, 2020, 4:42pm UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/16 "2020-09-21T16:42:42Z")

</div>

Ah, that’s great. In that case Ben Lauwens book is a great read for better familiarity with Julia-specific things. The gulfsharks data provided in PopGen.jl is radseq SNP data, so the work Jason and I have been doing have been more or less intended for microsat/SNP things (more towards the latter).

---

<div class="post-metadata">

**Author:** ![SergeantMike67](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergeantmike67/32/25103_2.png) [@SergeantMike67](https://discourse.julialang.org/u/SergeantMike67)\
**Post date:** [September 21, 2020, 7:25pm UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/17 "2020-09-21T19:25:15Z")

</div>

I bought Ivo Balbaert and Adrian Salceanu’s book Julia 1.0 Programming Complete Reference Guide but thought about the Think Julia book but being a Grad Student I didn’t have a ton of cash to drop on books. I may still pick up Ben’s book.

---

<div class="post-metadata">

**Author:** ![pdimens](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdimens/32/15729_2.png) [@pdimens](https://discourse.julialang.org/u/pdimens)\
**Post date:** [September 21, 2020, 7:38pm UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/18 "2020-09-21T19:38:03Z")

</div>

The book is also available for free using the link I provided above

---

<div class="post-metadata">

**Author:** ![SergeantMike67](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergeantmike67/32/25103_2.png) [@SergeantMike67](https://discourse.julialang.org/u/SergeantMike67)\
**Post date:** [September 23, 2020, 12:41am UTC](https://discourse.julialang.org/t/current-state-of-popgen-jl/41616/19 "2020-09-23T00:41:48Z")

</div>

So I have joined the slack group. I have been going through the source code and get about 80% of it. Still getting hung up on some syntax. Now what I think I need is a tutorial on GitHub and all the little pockets that are there.
