davidaknowles / leafcutter

Annotation-free quantification of RNA splicing. Yang I. Li, David A. Knowles, Jack Humphrey, Alvaro N. Barbeira, Scott P. Dickinson, Hae Kyung Im, Jonathan K. Pritchard
http://davidaknowles.github.io/leafcutter/
Apache License 2.0
208 stars 115 forks source link

Enhancement suggestions - leafcutter and leafviz results exports #70

Open drevansa opened 6 years ago

drevansa commented 6 years ago

Hello,

I have a few suggestions that you might consider/ reject for future development of leafcutter and leafviz applications relating to support for export of results from both leafcutter and leafviz.

Most of these requests are achievable with R scripting using the Rdata generated by leafviz prepare_results.R as input, but some leafcutter users may find this challenging.

1) Leafcutter - Results table

Would you consider the creation of a summary results table, which includes all the all differential splicing stats, that can be written out to a text file?

I have created a file from the Rdata clusters obejct, supplemented with stats from the cluster_significance_file, so that I can share results with non R-using colleagues.

You have provision on Leafviz shiny app for display of some of this data on the All clusters - Differential splicing events (clusters) table, but not all stats are reported and there is no direct means to export this.

2) Leafcutter and/ or Leafviz summary report

Could provision for export of the Rdata analysis summary report be added?

You provide a summary on the Leafviz shinny app but no download button is provided.

I generated reports from Rdata objects:

I exported to Word using R package ReporteRs, and Sweave to export to .pdf, but the install of all dependencies was a bit of a hassle - so might prove a little tricky for some users, but a text file should be straightforward?

3) Leafviz PCA Plot - colour by sample

You currently provide options to colour by covariate and by group.

It would be usefull if this could be extended to colour by sample. Of course, this would only be suitable for small scale studies, but would be usefull for outlier detection.

I did a hacky modification to your make_pca function from leafviz prepare_results.R and then plot locally using ggplot2 with the resulting pca object as input.

make_pca <- function(counts=ratios, meta){ dev <- apply( counts, MAR = 1, FUN = sd ) ## remove rows with 0 variance counts <- counts[ dev != 0, ] pca <- prcomp( t(counts), scale = TRUE ) importance <- signif( summary(pca)$importance[2,], digits = 2) * 100 pca <- as.data.frame(pca$x) pca$sample <- row.names(pca) pca <- merge(pca,meta, by = "sample") row.names(pca) <- pca$sample return(list( pca, importance)) } print("creating PCA") pca <- make_pca(ratios, meta)

4) Leafviz - Export all results

Would you consider enabling the export of all results as a batch for a list of genes? To download all leafviz tables and plots for a single gene of interest requires 7+ user actions.

All clusters page:

Summary page: no download available - save/ print page or page grab once per experiment

PCA page Save plot x how ever many plots you want to download once per experiment

This quickly becomes unmanageable, for example 100 genes requires a minimum of 502 user actions [without considering plot generation and download failures].

Your example brain dataset uploads almost 2000 genes.

I note that a .pdf file containing all Splicing event visualization plots (without tables) that have been downloaded individually via leafviz is written to the leafcutter install leafviz directory, but this still requires that each plot of interest is first manually exported (also, could this export be saved perhaps to the path of the Rdata upload rather than the install directory?).

Best wishes Drevansa

goldenflaw commented 6 years ago

Thank you Drevansa! We will consider these in the next release.

Best, Yang

On Sun, Jun 3, 2018 at 12:47 PM drevansa notifications@github.com wrote:

Hello,

I have a few suggestions that you might consider/ reject for future development of leafcutter and leafviz applications relating to support for export of results from both leafcutter and leafviz.

Most of these requests are achievable with R scripting using the Rdata generated by leafviz prepare_results.R as input, but some leafcutter users may find this challenging. 1) Leafcutter - Results table

Would you consider the creation of a summary results table, which includes all the all differential splicing stats, that can be written out to a text file?

I have created a file from the Rdata clusters obejct, supplemented with stats from the cluster_significance_file, so that I can share results with non R-using colleagues.

  • row number
  • clusterID
  • N
  • chr
  • start
  • end
  • gene
  • ensemblID
  • annotation
  • logr
  • df
  • p-value
  • q-value
  • coord (as string for genome browsers, e.g. IGV)

You have provision on Leafviz shiny app for display of some of this data on the All clusters - Differential splicing events (clusters) table, but not all stats are reported and there is no direct means to export this. 2) Leafcutter and/ or Leafviz summary report

Could provision for export of the Rdata analysis summary report be added?

You provide a summary on the Leafviz shinny app but no download button is provided.

I generated reports from Rdata objects:

  • code
  • annotation_code
  • sample_table
  • cluster_summary
  • intron_summary

I exported to Word using R package ReporteRs, and Sweave to export to .pdf, but the install of all dependencies was a bit of a hassle - so might prove a little tricky for some users, but a text file should be straightforward? 3) Leafviz PCA Plot - colour by sample

You currently provide options to colour by covariate and by group.

It would be usefull if this could be extended to colour by sample. Of course, this would only be suitable for small scale studies, but would be usefull for outlier detection.

I did a hacky modification to your make_pca function from leafviz prepare_results.R and then plot locally using ggplot2 with the resulting pca object as input.

make_pca <- function(counts=ratios, meta){ dev <- apply( counts, MAR = 1, FUN = sd )

remove rows with 0 variance

counts <- counts[ dev != 0, ] pca <- prcomp( t(counts), scale = TRUE ) importance <- signif( summary(pca)$importance[2,], digits = 2) * 100 pca <- as.data.frame(pca$x) pca$sample <- row.names(pca) pca <- merge(pca,meta, by = "sample") row.names(pca) <- pca$sample return(list( pca, importance)) } print("creating PCA") pca <- make_pca(ratios, meta) 4) Leafviz - Export all results

Would you consider enabling the export of all results as a batch for a list of genes? To download all leafviz tables and plots for a single gene of interest requires 7+ user actions.

All clusters page:

-

Differential splicing events (clusters) -- Stats (no download available) - save/ print page or page grab -- Input search term or click through table (no download available)

Splicing event visualization -- save plot with table (download) -- save plot without table (download)

Gene-level visualization -- save plot (download)

Summary page: no download available - save/ print page or page grab once per experiment

PCA page Save plot x how ever many plots you want to download once per experiment

This quickly becomes unmanageable, for example 100 genes requires a minimum of 502 user actions [without considering plot generation and download failures].

Your example brain dataset uploads almost 2000 genes.

I note that a .pdf file containing all Splicing event visualization plots (without tables) that have been downloaded individually via leafviz is written to the leafcutter install leafviz directory, but this still requires that each plot of interest is first manually exported (also, could this export be saved perhaps to the path of the Rdata upload rather than the install directory?).

Best wishes Drevansa

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/davidaknowles/leafcutter/issues/70, or mute the thread https://github.com/notifications/unsubscribe-auth/AE1piXkJDcbTlbyvppc2T_f7sRAdl2LCks5t5CFDgaJpZM4UYK8D .

afadda91 commented 4 years ago

yes would be great if the table in LeafViz can be exported and can the list can be prioritized based on PSI. We need to share these data with biologists. thank again for a great tool!

katagirya commented 4 years ago

@drevansa these are great suggestions here. I fully support your suggestions. I have had to figure out how to do some of the things you have highlighted. @jackhump do you have any updates about this? Thanks.

afadda1 commented 3 years ago

following up on this thread. How can I share the LeafViz results with colleagues? the webarchive file is grayed out for them

jackhump commented 3 years ago

Hi all,

This is something I've neglected for too long, my apologies. I now maintain a standalone Leafviz R package that works on Mac and Windows for users to work with the shiny.RData objects on their local machines.

I've put in two new functions:

export_tables writes the significant clusters and introns to TSV files.

make_report writes the summary table objects found in the summary tab to an HTML file.

the R package can be downloaded from github: https://github.com/jackhump/leafviz

@afadda1 please let me know if they work for you and whether you find them useful.

afadda1 commented 3 years ago

perfectly! thank you so much Jack