biosustain / shu

Multi-dimensional, trans-omics metabolic maps.
https://biosustain.github.io/shu
Apache License 2.0
44 stars 1 forks source link

Multiple columns per condition for boxpoints #47

Open carrascomj opened 8 months ago

carrascomj commented 8 months ago

Why

Feedback from people at UQ: we would like to have multiple columns to represent point estimates of different nature (transcriptomics/protemics) or multiple replicates for the same data and condition (or isozymes, etc.) for a particular reaction.

What

Given the following figure:

image (From Valgepea et al., 2018)

We would like the same but inverting rows and columns.

How

ggshu geom.boxpoint() would now also take a x aes that would identify the column. The API would be something like:

(
        ggshu.ggmap(
            df_reac,
            ggshu.aes(reaction="reaction", color="mM", condition="condition", x="isozyme"),
        )
        + ggshu.geom_boxpoint())
    )

shu would now accept a box_x field:

pub struct Data {
// ...
    /// Decide the column of the boxpoint.
    box_x: Option<Vec<String>>,
// ...
}

Then each entity with Aesthetics, GeomHist and Point<f32> should be spawned with a Column component containing Vec<Option<String>>. This would be accumulated per axis in the build_point_axes with a similar logic than that of conditions. plot_box_point will need to account for the new x coordinate.

As a nice to have, the tag of each column should be put on top of the column ($\pi/2$ if more than two letters), although immediate readability should not be prioritized in this case.