Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to shiny and plot functions (solving several open issues) #143

Merged
merged 32 commits into from
Nov 10, 2017

Conversation

warrenmcg
Copy link
Collaborator

@warrenmcg warrenmcg commented Oct 20, 2017

Here is a list of issues solved and enhancements:
#124: this was due to a mistake in how shiny and the plots handled the new sleuth object API when its obj$gene_mode was TRUE. This is now fixed:

  • The error reporting is clearer when the user did not use extra_bootstrap_summary — and read_bootstrap_tpm if they want to see TPM) — which are essential for use with transcript view and gene view.
  • There was a bug which caused the bs_quants to still have est_counts as the label when the unit was scaled_reads_per_base. This is likely what was causing the problem for users who used the options above and still had an error. This is now fixed.
  • These changes also addressed plot_pca fails on gene_aggregated sleuth object #126, since now the plot functions make sure that the right unit is used depending on whether the sleuth object is in transcript mode or gene mode.

In addition to the above changes, several changes were made to the transcript view and gene view to accommodate when gene_mode is TRUE:

  • When obj$gene_mode is TRUE, the gene view on shiny now acts similarly to the old transcript view, where you can specify a gene ID and you'll get the bootstrap plot for that gene. It correctly can handle either TPM or scaled_reads_per_base. Similar to the gene view for transcripts, you can use alternative gene identifiers.
  • Also, when obj$gene_mode is TRUE, transcript view is now disabled (since there is no way to access normalized transcript data without rerunning sleuth prep). I couldn't figure out how to easily hide the tab, so the tab just shows a message.

In addition to #124, there were other issues handled in this pull request:

  • fixed the bug found in plot_qq doesn't plot highlighted point correctly #82 for plot_qq. Thanks to @a-slide for identifying the problem!
  • to solve error in plot_group_density function #66, enhanced plot_group_density to handle more than one covariate, and improved the error reporting for that function.
  • improved the sample heat map function to address Reorder samples for heat map #67 and Improvements for sample heatmap #87. This also led to improving the transcript heatmap function, which could not handle the scaled_reads_per_base unit if the object was in gene mode:
    • Both use the pheatmap package now
    • Both can annotate covariates from obj$samples_to_covariates
    • cluster samples in sample heat map and transcripts in transcript heat map
    • the plot functions now can take additional arguments to further customize the heat maps when not done in sleuth_live.

Remaining to-dos:

  • enhance shiny to handle the extra heatmap functionality.

Pascal Sturmfels and others added 29 commits August 30, 2016 14:32
+ Gene view adapts to whether `gene_mode` is `TRUE` or not.
+ Transcript view now displays a message if the sleuth object is in gene mode.
…en in gene mode

+ added 'gene_to_gene' function, analogous to 'transcripts_from_gene' function
+ added code to make sure the transcript version of gene viewer does not execute when in gene mode, and vice versa
+ switched to pheatmap package to produce the plot
+ add ability to cluster the rows and columns
+ add ability to annotate the columns with covariates
+ add 'scaled_reads_per_base' unit so gene mode can be used with this function
+ add option to cluster transcripts as well as samples
+ add ability to use a transformation function (not just a string)
+ add option to cluster targets for transcripts/gene heat map
+ add option to cluster by sample for sample heat map
+ add option to add annotations for all possible covariates for sample heat map
+ switch to use of pheatmap
+ add options to customize the color palette, with low-, medium-, and high-expression colors
+ add option to adjust x-axis angle, similar to sample heat map
+ add option to annotate covariates for the samples
+ add '...' option to customize the pheatmap (e.g. add transcript annotations)
@warrenmcg
Copy link
Collaborator Author

warrenmcg commented Oct 23, 2017

Additional note: I added in the sleuth_live documentation from the documentation branch. This will address issue #105.

R/plots.R Outdated
@@ -318,7 +318,7 @@ plot_pc_variance <- function(obj,
#' @param units either 'est_counts' ('scaled_reads_per_base' for gene_mode) or 'tpm'
#' @param trans a string pointing to a function to use for the transformation.
#' @param grouping a string from the columns of \code{sample_to_covariates} in
#' the sleuth object for which to group and color by
#' the sleuth object for which to group and color by. At this time,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you remember what you were going to type here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, whoops. This comment was originally going to say that "At this time, only one column can be used"; however, I implemented a version that can handle more than one column, as they exist in the table. You can revert this line back.

Copy link
Collaborator

@pimentel pimentel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, thanks!

R/sleuth.R Outdated
#' Get the \code{target_id} of a gene using other gene identifiers
#'
#' @param obj a \code{sleuth} object
#' @param test a character string denoting which beta to use
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self: remove extra documentation here

@pimentel pimentel merged commit 96fed31 into pachterlab:devel Nov 10, 2017
warrenmcg added a commit to warrenmcg/sleuth that referenced this pull request Mar 13, 2018
…ments

+ see pull request pachterlab#143 for details on the specific changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants