Skip to content
New issue

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

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

Already on GitHub? # to your account

Fancy Plots + QoL Updates #115

Merged
merged 11 commits into from
Aug 11, 2022
Merged

Fancy Plots + QoL Updates #115

merged 11 commits into from
Aug 11, 2022

Conversation

mattssca
Copy link
Contributor

@mattssca mattssca commented Aug 4, 2022

Pull Request Checklists

Important: When opening a pull request, keep only the applicable checklist and delete all other sections.

Checklist for all PRs

Required

  • I tested the new code for my use case (please provide a reproducible example of how you tested the new functionality)

  • I ensured all dplyr functions that commonly conflict with other packages are fully qualified.

This can be checked and addressed by running check_functions.pl and responding to the prompts. Test your code after you do this.

  • I generated the documentation and checked for errors relating to the new function (e.g. devtools::document()) and added NAMESPACE and all other modified files in the root directory and under man.

Optional but preferred with PRs

  • I updated and/or successfully knitted a vignette that relies on the modified code (which ones?)

Checklist for New Functions

Required

  • I documented my function using ROxygen style.)

  • All parameters for the function are described in the documentation and the function has a decriptive title.

Example:

#' Use GISTIC2.0 scores output to reproduce maftools::chromoplot with more flexibility
#'
#' @param scores output file scores.gistic from the run of GISTIC2.0
#' @param genes_to_label optional. Provide a data frame of genes to label (if mutated). The first 3 columns must contain chromosome, start, and end coordinates. Another required column must contain gene names and be named `gene`. (truncated for example)
#' @param cutoff optional. Used to determine which regions to color as aberrant. Must be float in the range [0-1]. (truncated for example)
  • My function uses a library that isn't already a dependency of GAMBLR and I made the package aware of this dependency using the function documentation import statment.

Example:

#' @return nothing
#' @export
#' @import tidyverse ggrepel

Checklist for changes to existing code

  • I added/removed arguments to a function and updated documentation for all changed/new arguments

  • I tested the new code for compatability with existing functionality in the Master branch (please provide a reprex of how you tested the original functionality)

@mattssca
Copy link
Contributor Author

mattssca commented Aug 4, 2022

This PR includes updates to a collection of fancy plots. The following revisions have been made.

  1. fancy_cnbar - Remove lines connecting the dots.

  2. fancy_ideogram - New parameter that allows the user to subset calls to regions specified in a bed-like format. For more info and how to use it, see the newly added parameters and descriptions.

  3. fancy_multisamp_ideogram - Add functionalities to highlight what's different (or shared) between samples. Adding a new parameter that calls cnvKompare if called correctly.

  4. fancy_circosplot - Circos plot now takes additional variant call sets. Previously it only plotted manta calls, but can now be run so that ssm calls are plotted (similarly to other fancy plotting functions).

  5. fancy_alignment_plot - Remove lines connecting the dots.

  6. fancy_qc_plot - Barplot has now been replaced with boxplot + jitter for visualizing QC metrics across different sample cohorts, pathologies, etc.

This PR also includes a few minor QoL updates. Including an update to cnvKompare to always retain the same columns in the returns (regardless if concordant or discordant calls are returned) as well as a hot-fix to collate_results (see issue 112).

Before review of this PR, I want to include one more commit I am working on as well as some more thorough testing of the updated plotting functions. I will call for reviewers when the PR is ready to be reviewed

@mattssca mattssca changed the title Cmattsson dev Fancy Plots + QoL Updates Aug 4, 2022
NAMESPACE Outdated
@@ -101,6 +101,7 @@ export(tidy_lymphgen)
export(web_initialize_gambl_site)
import(ComplexHeatmap)
import(DBI)
import(GenomicRanges)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please give an idea on what the GenomicRanges are used for? If it is just to overlap the coordinates, we can consider using the foverlaps and avoid adding another big-sized dependecy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, the GenomicRanges package is used for intersecting two bed-like files. I will revert this to using foverlaps as suggested above. Thanks!

R/viz.R Outdated
if(intersect_regions){
#filter CN states on intersecting regions
#transform regions to Granges objects
grl = GRanges(cn_states)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Alright, see it here now! Can we consider switching this to data.table::foverlaps()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I will do this. Good suggestion!

@mattssca mattssca requested a review from Kdreval August 10, 2022 17:49
data.table::setkey(regions_sub, chrom, start, end)

#intersect regions
intersect = data.table::foverlaps(incoming_cn, regions_sub, nomatch = 0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice addition 😄

@mattssca mattssca merged commit 5a07fbf into master Aug 11, 2022
@mattssca mattssca mentioned this pull request Jun 26, 2023
10 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants