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

Rmorin dev #45

Merged
merged 11 commits into from
Nov 30, 2021
Merged

Rmorin dev #45

merged 11 commits into from
Nov 30, 2021

Conversation

rdmorin
Copy link
Collaborator

@rdmorin rdmorin commented Nov 29, 2021

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)

@rdmorin
Copy link
Collaborator Author

rdmorin commented Nov 29, 2021

This adds a new function that depends on another (very subtly) forked github repo. It should only break for people if they try to use that new function.

@rdmorin rdmorin requested a review from Kdreval November 29, 2021 19:53
native_blacklist_path = paste0(config::get("project_base"),unix_group,"/",tool_name,"-",tool_version,"_",annotator_name,"-",annotator_version,"/level_3/variants_",genome_build,"_native_clean_blacklist.txt")
lifted_blacklist_path = paste0(config::get("project_base"),unix_group,"/",tool_name,"-",tool_version,"_",annotator_name,"-",annotator_version,"/level_3/variants_",genome_build, "_lifted_clean_blacklist.txt")
}else{
annotator_version="1.2"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just want to make sure: the annotator_version is conditional in the clustered flavour (so can be modified by user and is not necessarily 1.2), but here it is always set to 1.2, even if the user specifies say 1.1 when calling this function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was somewhat purposeful. It's mostly just providing a slightly more standardized way to construct the paths for the different file sets. I don't anticipate (or handle) other options for now.

# Merge the CN info to the corresponding MAF file, uses GAMBLR function
if(!missing(in_seg)){
if(missing(in_maf) & missing(in_seg)){
CN_new <- assign_cn_to_ssm(this_sample = sample_id,coding_only=coding_only,assume_diploid=assume_diploid,genes=genes)$maf
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this break in genes is missing, or maybe returns an empty object? I think this call here will supply an empty list, and the function assign_cn_to_ssm will get the genes argument of empty list, and might filter towards it returning 0 rows. Or is it disregarded when empty?

#' @export
#'
#' @examples
get_mutation_frequency_bin_matrix = function(regions,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This I think is just moved from utilities and otherwise is not modified?

geom_tile(data=windows_tallied,aes(x=window_start,y=sample_id,fill=n)) +
scale_fill_gradient(low = "orange", high = "red", na.value = NA) +
theme_cowplot() + scale_colour_manual(values=c(lg_cols,path_cols)) +
theme(axis.text.y=element_blank())
}
if(plot_type != "none"){
print(p)
Copy link
Collaborator

Choose a reason for hiding this comment

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

just noticed it - can we return here instead of print? This way, plot will be accessible as object and then can be modified using any ggplot + statements

these_samples_metadata = these_samples_metadata %>% dplyr::rename("patient_id"=patient_colname)
both_vaf_all = full_join(t1_pair_mafdat,t2_pair_mafdat,by=c("patient_id","Start_Position")) %>%
dplyr::select(patient_id,HGVSp_Short.x,Hugo_Symbol.x,Hugo_Symbol.y,Tumor_Sample_Barcode.x,
Tumor_Sample_Barcode.y,HGVSp_Short.y,vaf.x,vaf.y,hot_spot.x,hot_spot.y) %>%
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think both the maf1 and maf2 should be annotated here - should we add a stop message, or handle it automatically within this function? I can take care of that in my next PR

@Kdreval Kdreval merged commit 0545e51 into master Nov 30, 2021
# 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