Coder Social home page Coder Social logo

cri-iatlas / shiny-iatlas Goto Github PK

View Code? Open in Web Editor NEW
47.0 47.0 12.0 1.49 GB

An interactive web portal for exploring immuno-oncology data. This repo now superseded by iatlas-app

Home Page: https://www.cri-iatlas.org

License: Apache License 2.0

R 94.20% HTML 0.27% CSS 1.15% JavaScript 4.38%
cancer genomics immunology systems-biology

shiny-iatlas's People

Contributors

andrewelamb avatar gibbsdavidl avatar heimannch avatar jaeddy avatar shanebdavis avatar vthorsson avatar ychae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shiny-iatlas's Issues

Track feature matrix variable usage

It would be helpful to know all of the variables from the feature matrix that we’re actually using somewhere in the app. I’m wondering if it’d be possible to add something to load_data.R that could capture this information and store it in a log somewhere... Not exactly sure what this would look like.

Test "drilldown" with Shiny + crosstalk

Creating a separate issue for this rather than under #11, but that module would be a good place to test out ideas. I'm thinking as a simple first example*, we can try to take the boxplot for expression of a selected gene across immune subtypes; when a user "clicks" on the box for one of the subtypes, a new plot pops up (below or to the side) with a histogram/density plot showing the distribution of expression values for that gene in the specific subtype.

*A more realistic case might be to have a heatmap showing expression of all immunomodulator genes across subtypes, and when a user clicks on a row corresponding to a gene, the boxplot for that gene is what pops up... but the example above should be sufficient to help us learn the mechanics.

While we don't necessarily need to limit ourselves in any way while prototyping, we should try to keep track of what's possible with and without Shiny (as the former would be more generalizable to other applications).

Here are a number of references I've compiled that should help:

Create blogdown site to serve as iAtlas landing page

Site should be fairly minimal, with a link to the Shiny app, some summary information about the project/study, and maybe a handful of other relevant links. We can host the code (R Markdown, etc.) in a GitHub repo (e.g., "iatlas-website") under our CRI-iAtlas org and connect to our www.cri-iatlas.org domain.

Add TCGA barcode labels to plots

Modify tooltip info for scatterplot points, outlier points in violin plots, and any other plots that show per-individual values.

Rename repo, make public

At some point before we launch, we should rename this repo to something like shiny-iatlas or iatlas-shiny (and rename the folder iatlas-demo as well) — remove words like "prototyping" and "demo" :) We should also make the repo public and link to the code before we go live.

Improving variable selection for Kaplan Meier module

The current variable selection gives a set of possible pre-selected variable choices.
For the continuous variables, it would be better to select from among all possible variables,
The immune features modules might serve as an example , with

  fluidRow(
    optionsBox(
      width = 6,
      selectInput(
        ns("violin_y"),
        "Select violin plot y variable",
        choices = get_friendly_numeric_columns(),
        selected = "leukocyte_fraction"
      )
    )
  ),

Immumodulator Module: Use and display metadata categories

Allow more dynamic use of categorical variables: Gene Family, Super Category, Immune Checkpoint listed in immumodulator annotation spreadsheet. Possibilities

  • use a category as a variable category used in selection
  • display categories with visuals

Optimize data loading

Stick with local files for various tables and matrices for now (need to sort out various Google connections later). Try to load minimum amount of data needed, and use faster formats/packages (e.g., feather, fread).

Update module thumbnail images

For the main explorer page, image links were not intended to all be the same boxplot — need to update with screenshots from each module (or some representative vector art, if available...).

Review and edit Method READMEs

READMEs for methods were put together quickly and will need a go-through,

  • check for formatting, e.g. mangling of math symbols
  • preferably include actual references and not just citations

Standardize layout elements

For features like dashboard box elements, title panels, etc. that are used in a common way across modules, should create shared functions to enable consistent formatting. For example,

  • titleBox - customized box used for page titles
  • infoBox - customized box with descriptions/information
  • optionBox - customized box for containing Shiny options
  • plotBox - customized box to wrap interactive plot elements

These can all go in format.R for now.

Enable correlation plot layout for plotly scatterplots

Should include a (dashed?) diagonal line with slope = 1, intercept = 0 — not exactly sure how to add manual traces with plotly. Can also include the option to manually specify axis limits, for cases where equal ranges are desired.

Consolidate reusable functions and elements into helpers scripts

For example:

iatlas-demo/
├── helpers
    └── heatmap_widget.R

heatmap_widget.R would include the function heatmap_widget() that would take a set of inputs and options and return a heatmap object. All helper scripts would be sourced by global.R and functions would be available for any module UI or server functions.

Note: not exactly sure if this is best practice, but can't find good examples of how to handle this.

Specify B Cell Receptor Module

Identify what would go into a dedicated B Cell Receptor Repertoire Module. Include Ben Vincent in discussion about this.

More comprehensible terms for CIBERSORT aggregates

Would be best to find better labels for our four ways of displaying and working with CIBERSORT fractions.

The values are estimated by CIBERSORT (“Original” fraction), and various combinations of those estimates are provided, for example “Aggregate 1” corresponding to broader categories of cells, and “Aggregate 2” and “Aggregate 3” to finer categories.

Specify T Cell Receptor Module

Identify what would go into a dedicated T Cell Receptor Repertoire Module. Include Scott Brown and possibly others in the discussion.

Clean up tooltip formatting and info for all plots

Currently just using plotly default tooltips; should be able to control what information is presented in labels (as well as label formatting) either in the corresponding build_<plot-type>_df function or in the create_<plot-type> function.

Pre-compute concordance index values

For the Clinical Outcomes module, there are a number of different ways we’ll want to present concordance index for survival, in addition to the KM plots (see Figure 3 and S3 here). Based on emails from Tai-Hsien, he has some code for calculating CI, but I’m guessing this might still be slow to compute on the fly.

It might be helpful to build a tidy dataframe with columns sample_selection_choice, sample_category, variable_class, variable, ci that stores CI values for the combinations that we would want to plot. The relevant variable classes i think would just be immune signatures and cell types… for now at least.

Survival module small change

In the survival module.

We should make 2 the minimum value in:

      sliderInput(
        ns("divk"),
        "Divider",
        min = 0,
        max = 10,
        value = 2
      ),

This uses the R function 'cut' to create sample groups using continuous variables, which are then shown as individual lines in the plot. Certainly could use different methods too... like a 1-D kmeans clustering, or find an optimal cut point based on maximizing a T stat, or something.

Populate "Documentation" page

Can more or less mirror the information in the README for this repo (might even be able to load the md file directly...).

Finalize Shiny prototype layout

The Shiny app will initially be the initial version of the iAtlas portal on release (pre-April 5th, 2018). Need to settle on a more suitable overall layout for visualization panels and any other information we want to include.

Populate "Resources" page

Include links to relevant programs (CRI, NCI, TCGA), along with links to any data repositories that we can share (e.g., GDC, Synapse).

Refactor panels organization to follow Shiny modules approach

See slides here for more details:
https://github.com/daattali/shiny-training-rstudioconf-2018/blob/master/slides/05-modules.pdf

Basically, instead of

iatlas-demo/
├── global.R
├── panels
│   ├── panel-server-cellcontent.R
│   ├── panel-server-clonaldiversity.R
│   ├── panel-server-corrheatmap.R
│   ├── panel-server-survivalcurve.R
│   ├── panel-ui-cellcontent.R
│   ├── panel-ui-clonaldiversity.R
│   ├── panel-ui-corrheatmap.R
│   └── panel-ui-survivalcurve.R
├── server.R
└── ui.R

...we'd want something more like this:

iatlas-demo/
├── global.R
├── modules
│   ├── cellcontentmodule.R
│   ├── clonaldiversitymodule.R
│   ├── corrheatmapmodule.R
│   └── survivalcurvemodule.R
├── server.R
└── ui.R

Each module script would include a UI and server function — e.g., cellcontent_module_UI() and cellcontent_module() in cellcontentmodule.R. Module scripts would then be sourced in global.R and functions used in ui.R and server.R

Update documentation/readme

Need to add a note about Tai-Hsien's concordanceIndex package (along with installation instructions). Might be a few other items to clean up as well.

Update footer links

Links in portal footer currently don't go anywhere. Need to update accordingly.

Correlation plot - row names can be obscured

When drawing the correlation plot, the text for row labels is often obscured by the containing window. Most easily visible for longer labels, such as original , non-aggregated CIBERSORT values.

Create single function to load feature matrix data

Function load_data() (exact name TBD) should be stored in helpers/load_data.R— see #2 — and include all necessary logic to load the IRWG feature matrix and return the expected data frame. Might also want to include a local vs. remote option for loading data directly from BigQuery.

Add contributing guide

Put together outline of recommended practices / steps for building new modules, extending or modifying shared/core functions, etc., managing branches and pull requests, etc.

Add subtype summary module

This module would allow users to explore and visualize the distribution of subtype groups/labels across TCGA and within individual TCGA studies. This might also be a reasonable place to present violin/beeswarm plots summarizing the distribution of selected values (or related groups of values) across subtypes.

Update "About" page

Should be more directly focused on current implementation of the iAtlas portal: what information is included, what types of exploration are possible, how the modules are organized. Should also include a blurb about the IRWG and the PanImmune study (along with a reference/link to the publication). Finally, should include at least some forward looking vision about the portal: what other types of information and features will be included over time, etc.

Enable subsetting of TCGA subtypes by TCGA study/cancer type

To deal with our over-abundant “TCGA Subtype” problem, we could try the following: under the Select Sample Groups dropdown in the side panel, we can add a “conditional” dropdown for “TCGA Study”. That is, if “TCGA Subtype” is selected, then a second dropdown appears to select “TCGA Study”. the axis values for plotting would then be subsetted to the subtypes of the selected study/cancer. Presumably this would be achieved by modifying or adding to the various functions in load_data.R and transform.R.

Specify Correlation with Somatic Alteration Module

Identify what should go into correlation with somatic alteration module.

  • Driver Mutations. Include Eduard in discussions as needed.
  • Copy Number Alterations. Include Galen in discussions as needed.
  • Pathways. Include Farshad and Francisco in discussions as neede

Add immunomodulator / gene explorer module

Ideally would include some summary visualizations of cross-subtype and cross-study patterns (e.g., heatmaps, etc.) as well as ability to "drill down" and view underlying data and distributions. This link could be handy:
https://github.com/bborgesr/rstudio-conf-2018

It'd also be nice to think about framing this as a "Gene Explorer" module to allow for the possibility of more general use. For example, if someone wants to include this module in their feature to explore a pre-defined list of genes (analogous to our list of immunomodulator genes), they'd be able to use our module rather than create a new one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.