Skip to content

Commit

Permalink
compare two sbjs in dev and prod
Browse files Browse the repository at this point in the history
  • Loading branch information
skanwal committed Jul 15, 2024
1 parent 2498f59 commit 6f267d7
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions inst/scripts/compare_piedb.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,33 @@ require(here)
require(glue)
require(tibble)
require(tidyr)
require(DT)

SBJ04426_dev <- readr::read_csv("~/UMCCR/data/wts/RNAsum/reference_update_comp/SBJ04426/dev/genes.expr.perc.csv")
SBJ04426_pro <- readr::read_csv("~/UMCCR/data/wts/RNAsum/reference_update_comp/SBJ04426/pro/genes.expr.perc.csv")
SBJ04187_dev <- readr::read_csv("~/UMCCR/data/wts/RNAsum/reference_update_comp/SBJ04187/dev/genes.expr.perc.csv")
SBJ04187_pro <- readr::read_csv("~/UMCCR/data/wts/RNAsum/reference_update_comp/SBJ04187/pro/genes.expr.perc.csv")
cancer_genes <- readr::read_tsv("~/UMCCR/research/data/cancer_gene_list/somatic_panel-v24.03.0.tsv")
SBJ04426_dev <- readr::read_csv("../../data/wts/RNAsum/reference_update_comp/SBJ04426/dev/genes.expr.perc.csv")
SBJ04426_pro <- readr::read_csv("../../data/wts/RNAsum/reference_update_comp/SBJ04426/pro/genes.expr.perc.csv")
SBJ04187_dev <- readr::read_csv("../../data/wts/RNAsum/reference_update_comp/SBJ04187/dev/genes.expr.perc.csv")
SBJ04187_pro <- readr::read_csv("../../data/wts/RNAsum/reference_update_comp/SBJ04187/pro/genes.expr.perc.csv")
cancer_genes <- readr::read_tsv("../../research/data/cancer_gene_list/somatic_panel-v24.03.0.tsv")

# now explore expression differences in reference and patient columns
# between dev and prod.
SBJ04426_df <- dplyr::left_join(SBJ04426_dev, SBJ04426_pro, by = "Gene", suffix = c(".dev", ".pro")) |>
dplyr::mutate(
# Ref_equal = `KIRP (TCGA).dev` == `KIRP (TCGA).pro`,
# Ref_equal = `PANCAN (TCGA).dev` == `PANCAN (TCGA).pro`,
Ref_equal = `BRCA (TCGA).dev` == `BRCA (TCGA).pro`,
Pat_equal = Patient.dev == Patient.pro,
# Ref_diff = abs(`PANCAN (TCGA).dev` - `PANCAN (TCGA).pro`),
Ref_diff = abs(`BRCA (TCGA).dev` - `BRCA (TCGA).pro`),
Pat_diff = abs(Patient.dev - Patient.pro)
) |>
dplyr::select(Gene, contains("BRCA"), contains("PANCAN"), Ref_diff, contains("Patient"), Pat_diff, contains("equal")) |>
dplyr::filter(Pat_diff > 0) |>
dplyr::filter(Gene %in% cancer_genes$ensembl_gene_symbol) |>
dplyr::arrange(desc(Pat_diff)) |>
dplyr::arrange(desc(Ref_diff)) |>
datatable()

SBJ04187_df <- dplyr::left_join(SBJ04187_dev, SBJ04187_pro, by = "Gene", suffix = c(".dev", ".pro")) |>
dplyr::mutate(
Ref_equal = `BRCA (TCGA).dev` == `BRCA (TCGA).pro`,
Pat_equal = Patient.dev == Patient.pro,
# Ref_diff = abs(`PANCAN (TCGA).dev` - `PANCAN (TCGA).pro`),
Expand All @@ -31,4 +45,6 @@ SBJ04426_df <- dplyr::left_join(SBJ04426_dev, SBJ04426_pro, by = "Gene", suffix
datatable()

# plot Ref_diff values
hist(SBJ04426_df$Ref_diff, breaks = 100)
hist(SBJ04426_df[[1]]$data$Ref_diff, breaks = 100)


0 comments on commit 6f267d7

Please sign in to comment.