Get latest updated reactive array
I have a notebook where I define a set of genes using two different methods: 1) clicking on a dendrogram to select a cluster of genes or 2) zooming in or out to select the list of currently visible genes. These two types of interactions with Clustergrammer-GL reactively define two sets of arrays: dendro_gene_list
and viz_gene_list
. However, I would like to have a new array (gene_list
) that is defined by whichever list (dendro_gene_list
or viz_gene_list
) has been updated more recently.
This example seems to do something similar https://observablehq.com/@mbostock/linked-inputs but I’m unsure if this approach will work for my example.
For the time being, I might set up a selector for the user to choose between the two list types. This set of genes will be used for enrichment analysis via API calls.
Background on Purpose of Notebook
For reference, the purpose of the notebook is to help researchers understand the biological functions of differentially regulated genes after COVID-19 infection - e.g. we can use enrichment analysis to find pathways that are associated with a set of genes or transcription factors that might be responsible for up-regulation of these genes. We can for instance reorder genes based on their log2-fold-change and then zoom into the most up-regulated genes to selectively run enrichment analysis on these genes.