microbiome / mia

Microbiome analysis
https://microbiome.github.io/mia/
Artistic License 2.0
50 stars 27 forks source link

Adding CSS to transformAssay() function #610

Closed SHillman836 closed 1 month ago

SHillman836 commented 4 months ago

Can we add a CSS method to the transformAssay() function?

antagomir commented 4 months ago

Yes that would be useful as it is relatively common.

antagomir commented 4 months ago

Hmm i just realized that all transformations from vegan::decostand are avaliable via mia::transformAssay. First thing is to check if it is there. Second thing is to check if it could be added there if not yet there. Only last option to add in mia.

SHillman836 commented 4 months ago

Ok, it's definitely not possible with the transformAssay() function right now, https://rdrr.io/cran/vegan/man/decostand.html this also doesn't mention anything about CSS transformations either

antagomir commented 4 months ago

If we ask vegan guys it might take some time to get responses.

Or would you be able to provide a PR on this to mia?

SHillman836 commented 4 months ago

As in do you mean add the CSS method into mia? I can do yeah - I think my notebooks task is pretty much done

antagomir commented 4 months ago

Ok!

SHillman836 commented 4 months ago

Should I find a package that already does CSS and inherit down from that to add it? Or add it directly and code in the calculations?

SHillman836 commented 3 months ago

Hey @antagomir, so https://rdrr.io/cran/vegan/man/decostand.html definitely doesn't have any CSS method, which is how all the other methods in the transform assay function were done. Should I import the method from say the metagenomeSeq package, which was talked about in OMA Chapter 15?

And if I am importing from a different library, should I still put the method in transformAssay? Or include it on it's own as say a helper function or something?

antagomir commented 3 months ago

The CSS method should be relatively straightfwd to implement.

In such case, having our own implementation could help to minimize number of dependencies, which is important.

So I would first look at the possibility of implementing a fresh implementation and that should be validated by comparing with external ones.

SHillman836 commented 3 months ago

ok yeah will do

TuomasBorman commented 3 months ago

log10 method in transformAssay should give you idea how to implement it (log10 and log2 are implemented in mia). Similarly to this

https://github.com/microbiome/mia/blob/8b8f686cb90ce2c9eb7f8539eb14a229a8487a3c/R/transformCounts.R#L297

create .calc_css function that has all the needed functionality for CSS.

SHillman836 commented 3 months ago

thanks yeah just seen this now but that's what I've done. Doing biocmanager checks now then will push - I've added the method

Daenarys8 commented 1 month ago

marking this as completed.