VEuPathDB / microbiomeComputations

1 stars 0 forks source link

Add correlation function #45

Closed asizemore closed 11 months ago

asizemore commented 1 year ago

Resolves #33 Requires https://github.com/VEuPathDB/veupathUtils/pull/20

Adds a core correlation function that accepts data tables. Then there are other functions that accept abundance data and metadata that just do formatting really and pass the data to the core corr computation (say that 5 times fast!). Added spearman and pearson methods because we got both for free.

This PR also adds a SampleMetadata class

To Dos

I started making the toJSON changes, but realized that will require work in veupathutils. I think it'd be better if i made that a separate PR. This one is getting large anyways.

asizemore commented 1 year ago

a note to my future self: we're going to have a lot of different ways to use the correlation function. Some with metadata, sometimes with two assays, sometimes with one, sometmes with random genomics data, or just metadata. My current idea for how this should grow is to have one basic correlation function that takes exactly two data frames (or matrices whatevs) and does whatever correlation method. Then we have lots of correlation methods that do different validations and data wrangling based on the inputs, then eventually make two data.frames and send them to the basic correlation function. That way we're not crazy repeating code and can appropriately handle what to do with lots o' different inputs

asizemore commented 1 year ago

Update before i switch my brain to diff abund

asizemore commented 11 months ago

updated based on the feedback. Removed variables entirely, which will help us get things moving. In the future we need to revisit the conversation so that we can optimally handle dates. I expect i'll be back here in a month anyways so we can do that then after we learn a bit more about how it all works together.