Skip to content

Commit

Permalink
fix data loading method
Browse files Browse the repository at this point in the history
  • Loading branch information
ytakemon committed Mar 2, 2022
1 parent d16ae8b commit 6e9ddfb
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion R/GINI_screen.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ GINI_screen <- function(control_IDs = NULL, mutant_IDs = NULL, core_num = NULL,

# Load necessary data
dep <- dep_annot <- NULL # see: https://support.bioconductor.org/p/24756/
data(list = list("dep", "dep_annot"), envir = environment())
load("data/dep.rda", envir = environment())
load("data/dep_annot.rda", envir = environment())

# Check to see if enough samples were given after filtering:
Control_group_avail <- control_IDs[control_IDs %in% dep$DepMap_ID]
Expand Down
4 changes: 3 additions & 1 deletion R/extract_protein_expr.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ extract_protein_expr <- function(Input_samples = NULL, Input_genes = NULL){

# Load necessary data
protein_annot <- protein_nodup <- sample_annot <- NULL # see: https://support.bioconductor.org/p/24756/
data(list = list("protein_nodup", "protein_annot", "sample_annot"), envir = environment())
load("data/protein_nodup.rda", envir = environment())
load("data/protein_annot.rda", envir = environment())
load("data/sample_annot.rda", envir = environment())

# Check if inputs are recognized
if(!all(Input_samples %in% sample_annot$DepMap_ID)){
Expand Down
4 changes: 3 additions & 1 deletion R/extract_rna_expr.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ extract_rna_expr <- function(Input_samples = NULL, Input_genes = NULL){

# Load necessary data
CCLE_exp <- CCLE_exp_annot <- sample_annot <- NULL # see: https://support.bioconductor.org/p/24756/
data(list = list("CCLE_exp", "CCLE_exp_annot", "sample_annot"), envir = environment())
load("data/CCLE_exp.rda", envir = environment())
load("data/CCLE_exp_annot.rda", envir = environment())
load("data/sample_annot.rda", envir = environment())

# Check if inputs are recognized
if(!all(Input_samples %in% sample_annot$DepMap_ID)){
Expand Down
3 changes: 2 additions & 1 deletion R/get_names.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
get_GeneNameID <- function(GeneName){
# Load necessary data
dep_annot <- CCLE_exp_annot <- NULL # see: https://support.bioconductor.org/p/24756/
utils::data(list = list("dep_annot", "CCLE_exp_annot"), envir = environment())
load("data/dep_annot.rda", envir = environment())
load("data/CCLE_exp_annot.rda", envir = environment())

# For Hugo symbols/NCBI IDs - from dependency prob.
if(any(dep_annot$GeneNames %in% GeneName | dep_annot$GeneID %in% GeneName)){
Expand Down
2 changes: 1 addition & 1 deletion R/list_available_mutations.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ list_available_mutations <- function(Gene = NULL,

# Load necessary data
mut_calls <- NULL # see: https://support.bioconductor.org/p/24756/
data(list = list("mut_calls"), envir = environment())
load("data/mut_calls.rda", envir = environment())

# If Gene is provided look for mutations:
if(!is.null(Gene)){
Expand Down
6 changes: 5 additions & 1 deletion R/select_cell_lines.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ select_cell_lines <- function(Input_gene = NULL, Input_AA_change = NULL, Input_d

# Load necessary data
mut_calls <- copy_num_annot <- copy_num <- dep <- sample_annot <- NULL # see: https://support.bioconductor.org/p/24756/
data(list = list("mut_calls", "copy_num_annot", "copy_num", "dep", "sample_annot"), envir = environment())
load("data/mut_calls.rda", envir = environment())
load("data/copy_num_annot.rda", envir = environment())
load("data/copy_num.rda", envir = environment())
load("data/dep.rda", envir = environment())
load("data/sample_annot.rda", envir = environment())

# Check if input gene mutations exist
if(!any(mut_calls$Hugo_Symbol %in% Input_gene)|!any(copy_num_annot$GeneNames %in% Input_gene)){
Expand Down

0 comments on commit 6e9ddfb

Please sign in to comment.