mia icon indicating copy to clipboard operation
mia copied to clipboard

altExp support for meltAssay

Open antagomir opened this issue 2 years ago • 2 comments

It is not possible to choose altExp for meltAssay currently.

One can however call meltAssay(altExp(tse, ...)) to do this for any altExp. Perhaps this is enough and there is no need to complicate the function?

An example could be added on the manpage, however as there have been questions about it.

antagomir avatar Feb 20 '23 13:02 antagomir

altExp mechanism seems to work routinely also in transformCounts even though it is not defined in that function (i.e. it just works because the function implementation knows how to pass this argument further and make the selection; see transformCounts source code for an example).

library(mia)
data(GlobalPatterns)
tse <- GlobalPatterns
altExps(tse) <- splitByRanks(tse)
transformCounts(tse, assay.type="counts", method="relabundance", altexp="Genus")

For consistency let us make sure it works this way also for meltAssay.

Importantly, it should be (?) possible to add this implicitly by doing similar programming than in transformCounts, instead of explicitly declaring altexp as a function argument. Inspect the transformCounts source code on how to do this.

antagomir avatar Jul 19 '23 13:07 antagomir

@ake123 I suggest you try, ask @TuomasBorman if you bump into problems.

antagomir avatar Jul 19 '23 14:07 antagomir

This is solved!

ake123 avatar Jul 03 '24 07:07 ake123