morinlab / GAMBLR

Set of standardized functions to operate with genomic data
https://morinlab.github.io/GAMBLR/
MIT License
3 stars 2 forks source link

updates to shm analyses #24

Closed rdmorin closed 3 years ago

rdmorin commented 3 years ago

Pull Request Checklists

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

Checklist for all PRs

Required

collated_meta = collate_results() %>% mutate(manual_BCL2_sv=ifelse(manual_BCL2_sv=="0","FAIL",manual_BCL2_sv))
#some_meta = get_gambl_metadata(case_set = "DLBCL-unembargoed")
some_meta = get_gambl_metadata() %>% dplyr::filter(pathology %in% c("FL","DLBCL","BL","CLL","MCL"))

some_meta = left_join(some_meta,collated_meta)
extra_anno = read_tsv("/projects/rmorin/projects/gambl-repos/gambl-kdreval/etc/subgroups.txt") %>% rename("sample_id"="Tumor_Sample_Barcode")

#some_meta = left_join(some_meta,extra_anno) %>% dplyr::filter(!is.na(genetic_subgroup))
some_meta = left_join(some_meta,extra_anno) %>% dplyr::mutate(genetic_subgroup = ifelse(is.na(genetic_subgroup),pathology,genetic_subgroup))
some_regions = grch37_ashm_regions %>% dplyr::filter(!gene %in% c("IGLL5","MYC"))
col_list = map_metadata_to_colours(as_vector = F,these_samples_metadata = some_meta,
                                   metadataColumns = c("bcl2_ba","manta_BCL2_sv",
                                                       "lymphgen","pathology","manual_BCL2_sv"))
#add a custom colour for genetic subgroup
lg_cols = get_gambl_colours("lymphgen")
fl_cols = get_gambl_colours("FL")
bl_cols = get_gambl_colours("BL")
lg_cols = c(lg_cols,fl_cols,bl_cols)
col_list[["genetic_subgroup"]] = c(lg_cols,path_cols)
GAMBLR::get_mutation_frequency_bin_matrix(these_samples_metadata = some_meta,
                                  cluster_rows_heatmap = FALSE,
                                  regions_df = some_regions,
                                  customColourColumns=col_list,
                                  sortByColumns = c("genetic_subgroup","pathology","manta_BCL2_sv","bcl2_ba","manual_BCL2_sv"),
                                  metadataColumns=
                                    c("genetic_subgroup","bcl2_ba","manta_BCL2_sv","manual_BCL2_sv","lymphgen","pathology"))

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

Optional but preferred with PRs

Checklist for New Functions

Required

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)

Example:

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

Checklist for changes to existing code

rdmorin commented 3 years ago

I just realized I need to add actual descriptive documentation to the new functions. I'll take care of that before merging.