Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ytakemon committed Jun 3, 2024
1 parent 2367c93 commit 593dfff
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
8 changes: 4 additions & 4 deletions R/Append_perm_pval.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#' @title Appends permutation adjusted p-value
#'
#' @description Randomly samples dependency probabilities from a given mutant and control group screened.
#' @description Appends permutation adjusted p-values to new column.
#'
#' @param p_value dataframe, Output from GI_screen(), Default: NULL
#' @param perm_pvalues dataframe, Output from GI_screen_perms(), Default: NULL
#' @param GI_screen_res dataframe, Output from GI_screen(), Default: NULL
#' @param perms dataframe, Output from Pval_perm_adjust(), Default: NULL
#'
#' @return A vector of adjusted p-values
#' @return A dataframe with permutation adjusted p-values appeneded as a new column named Pval_perm_adj.
#'
#' @details P-values are adjusted based on permuted random sampled background data.
#' @md
Expand Down
6 changes: 5 additions & 1 deletion R/list_cancer_type.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,15 @@ list_cancer_subtypes <- function(input_disease, data_dir) {
load(paste0(data_dir, "/sample_annot.rda"), envir = environment())

# Main
sample_annot %>%
res <- sample_annot %>%
dplyr::filter(.data$disease %in% input_disease) %>%
dplyr::pull(.data$disease_subtype) %>%
unique

# Message:
message("See sample_annot.rda in your data directory for a complist list of cell line annotation.")

# result
return(res)

}
16 changes: 8 additions & 8 deletions R/select_cell_lines.R
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ select_cell_lines <- function(input_gene = NULL, input_aa_change = NULL, input_d
.data$GT == "1|1" ~ "Hom_mut",
TRUE ~ "Het_Mut"),
AC_Variant = paste0(.data$VariantInfo," ", .data$AC_Variant)) %>% # are there any with 0 contribution from reference?
dplyr::rename(Chromosome = Chrom, Start_position = Pos) %>%
dplyr::select(.data$DepMap_ID, .data$Hugo_Symbol, .data$Chromosome, .data$Start_position, .data$Ref:.data$EntrezGeneID, AC_Variant) %>%
dplyr::rename(Chromosome = .data$Chrom, Start_position = .data$Pos) %>%
dplyr::select(.data$DepMap_ID, .data$Hugo_Symbol, .data$Chromosome, .data$Start_position, .data$Ref:.data$EntrezGeneID, .data$AC_Variant) %>%
dplyr::arrange(.data$Start_position) %>%
dplyr::distinct()
}
Expand Down Expand Up @@ -301,16 +301,16 @@ select_cell_lines <- function(input_gene = NULL, input_aa_change = NULL, input_d
# If post23Q
temp_dels <- target_mut %>%
dplyr:: filter(
LikelyLoF) %>%
.data$LikelyLoF) %>%
dplyr::distinct()

if(any(str_detect(temp_dels$VariantInfo, "splice"))){
no_splice <- temp_dels %>%
dplyr::filter(!str_detect(VariantInfo, "splice"))
dplyr::filter(!str_detect(.data$VariantInfo, "splice"))

del_splice <- temp_dels %>%
dplyr::filter(str_detect(VariantInfo, "splice"),
VariantType != "SNV")
dplyr::filter(str_detect(.data$VariantInfo, "splice"),
.data$VariantType != "SNV")
mut_dels <- dplyr::bind_rows(no_splice, del_splice) %>%
distinct()
} else{
Expand Down Expand Up @@ -343,9 +343,9 @@ select_cell_lines <- function(input_gene = NULL, input_aa_change = NULL, input_d
dplyr::filter(.data$n > 1)
} else {
multi_mut_dels <- mut_dels %>%
dplyr::select(.data$DepMap_ID, Start_position, .data$GT) %>%
dplyr::select(.data$DepMap_ID, .data$Start_position, .data$GT) %>%
dplyr::filter(.data$GT != "1|1") %>%
dplyr::select(.data$DepMap_ID, Start_position) %>%
dplyr::select(.data$DepMap_ID, .data$Start_position) %>%
dplyr::distinct() %>%
dplyr::add_count(.data$DepMap_ID) %>%
dplyr::filter(.data$n > 1)
Expand Down
8 changes: 4 additions & 4 deletions man/Append_perm_pval.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test-list_cancer_types.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ test_that("Test that list_available_cancer_types works", {
expect_equal(length(res1), 33)

# To list all subtypes
res2 <- list_cancer_subtypes("Lung Cancer", data_dir = dir)
res2 <- list_cancer_subtypes(input_disease = "Lung Cancer", data_dir = dir)
expect_equal(length(res2), 11)
})

0 comments on commit 593dfff

Please sign in to comment.