poseidon-framework / poseidon-analysis-hs

A tool to analyse genotype data (optionally in the poseidon data format)
MIT License
3 stars 0 forks source link

Option for excluding individual from its group when the individual is compared with the group #32

Open martynamolak opened 2 months ago

martynamolak commented 2 months ago

There are situations when one wants to calculate f-statistics between an individual and its own population, e.g.: F4(PopulationA, TestPopulation; Individual1FromPopulationA, Outgroup)

In such situations it might be useful (or might make more sense) to use PopulationA but with Individual1 excluded. I'm not sure whether this should be a default behavior but would certainly be a useful option. Specifying an ad hoc "PopulationA-minus-Individual1FromPopulationA" for each individual is of course an option but when one is estimating a lot of f-statistics and, particularly, when there is many individuals that one would like such estimates for, it ends up being fairly cumbersome.

If this would be a fairly easy option to introduce, it would be awesome to have it.

stschiff commented 2 months ago

Right. Thanks for adding this issue. I agree about the usefulness, but so far lack imagination for how the exact API could look so that users won't be surprised. Will think about it.

martynamolak commented 2 months ago

Don't you think that it actually could be a default behavior that whenever an individual is compared to its own population it gets excluded from the population? Then it wouldn't be confusing by there being more options to set up.

I mean every time you have fstats estimation, xerxes would first check whether the entities which are individuals are a part of any other entity that are populations or packages and if they are, turn this population/package into (population - individual) or (package - individual). That should also work in cases when there are more than one individual in the fstats. Eg.

fstats:

would turn be automatically processed into: fstats:

and:

fstats:

would turn be automatically processed into: fstats:

stschiff commented 1 month ago

Hmm, yes, I admit that sounds like a useful feature.