matsen / pplacer

Phylogenetic placement and downstream analysis
http://matsen.fredhutch.org/pplacer/
GNU General Public License v3.0
74 stars 18 forks source link

replace `--unweighted` with a one-parameter transform #211

Closed matsen closed 12 years ago

matsen commented 12 years ago

Analogous to the way the exponent works in fpd, I would like a --kappa flag defining an exponent that scales between a weighted and an unweighted version. The exponent will be named kappa. The end result will be a little different than what we were doing for unweighted, but oh well.

Given distal mass x, let y = x - (1-x). This is the usual transform specified in splitify.

Now, we would like to do a fractional exponentiation of y, but an issue is that values of x < 1/2 give negative values of y.

We just get around this by pulling out the sign:

sgn(y) |y|^kappa

Where sgn is just the sign function: http://en.wikipedia.org/wiki/Sgn

@cmccoy, could you please make an equivalent of alpha_shape for this function?

Stoked about this one.

matsen commented 12 years ago

And two special cases. When kappa=0 this should just be the sign function. When kappa=1 this should just be the usual splitification. These should be treated specially to keep from exponentiating by 1, for example.