Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tp53_nf1_score module (3/11) #106

Merged
merged 9 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions analyses/tp53_nf1_score/00-tp53-nf1-alterations.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ keep_columns <- c("Chromosome",
"Tumor_Sample_Barcode",
"Hugo_Symbol")

tumoronly_snv <- data.table::fread(snvTumorOnlyFile, select = keep_columns) %>%
tumoronly_snv <- data.table::fread(snvTumorOnlyFile, select = keep_columns, tmpdir = scratch_dir) %>%
dplyr::rename("Kids_First_Biospecimen_ID" = "Tumor_Sample_Barcode")

consensus_snv <- data.table::fread(snvConsensusFile, select = keep_columns) %>%
consensus_snv <- data.table::fread(snvConsensusFile, select = keep_columns, tmpdir = scratch_dir) %>%
dplyr::rename("Kids_First_Biospecimen_ID" = "Tumor_Sample_Barcode") %>%
bind_rows(tumoronly_snv)

Expand Down Expand Up @@ -126,7 +126,7 @@ tp53_coding <- coding_consensus_snv %>%
# subset to TP53 cnv loss and format to tp53_coding file format
tp53_loss<-cnvConsensus %>%
filter(gene_symbol == "TP53",
status == "Loss") %>%
status == "loss") %>%
dplyr::rename("Tumor_Sample_Barcode" = "Kids_First_Biospecimen_ID",
"Variant_Classification" = "status",
"Hugo_Symbol" = "gene_symbol")
Expand All @@ -145,7 +145,7 @@ nf1_coding <- coding_consensus_snv %>%
# subset to NF1 loss and format to nf1_coding file format
nf1_loss<-cnvConsensus %>%
filter(gene_symbol == "NF1",
status == "Loss") %>%
status == "loss") %>%
dplyr::rename("Tumor_Sample_Barcode" = "Kids_First_Biospecimen_ID",
"Variant_Classification" = "status",
"Hugo_Symbol" = "gene_symbol")
Expand Down
42 changes: 21 additions & 21 deletions analyses/tp53_nf1_score/02-qc-rna_expression_score.nb.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion analyses/tp53_nf1_score/03-tp53-cnv-loss-domain.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ annotated_cn <- data.frame(
) %>%
dplyr::distinct() %>%
# select loss that overlaps the TP53 core domains
dplyr::filter(status=="Loss") %>%
dplyr::filter(status=="loss") %>%
dplyr::group_by(biospecimen_id,copy_number) %>%
# summarise domain NAME per biospecimen_id TP53 loss
dplyr::summarise(
Expand Down
38 changes: 19 additions & 19 deletions analyses/tp53_nf1_score/03-tp53-cnv-loss-domain.nb.html

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion analyses/tp53_nf1_score/04-tp53-sv-loss.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ library("tidyverse")

# rootdir
root_dir <- rprojroot::find_root(rprojroot::has_dir(".git"))
scratch_dir <- file.path(root_dir, "scratch")
data_dir <- file.path(root_dir, "data")
results_dir <- file.path(
root_dir,
Expand All @@ -40,7 +41,7 @@ if (!dir.exists(results_dir)) {
### Input files
```{r}
putative_onco_fusion <- read_rds(file.path(data_dir, "Hope-fusion-putative-oncogenic.rds"))
manta_sv <- data.table::fread(file.path(data_dir, "Hope-sv-manta.tsv.gz"))
manta_sv <- data.table::fread(file.path(data_dir, "Hope-sv-manta.tsv.gz"), tmpdir = scratch_dir)
rna_expr <- readRDS(file.path(data_dir, "Hope-and-CPTAC-GBM-gene-expression-rsem-tpm-collapsed.rds"))
clinical<-read_tsv(file.path(data_dir,"Hope-GBM-histologies-base.tsv"))

Expand Down
51 changes: 27 additions & 24 deletions analyses/tp53_nf1_score/04-tp53-sv-loss.nb.html

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion analyses/tp53_nf1_score/05-tp53-altered-annotation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ library("broom")

# rootdir
root_dir <- rprojroot::find_root(rprojroot::has_dir(".git"))
scratch_dir <- file.path(root_dir, "scratch")
data_dir <- file.path(root_dir, "data")

input_dir <- file.path(root_dir,
Expand Down Expand Up @@ -133,7 +134,8 @@ consensus_tp53_snv_indel <- data.table::fread(
"Variant_Classification",
"Tumor_Sample_Barcode",
"SYMBOL",
"HGVSp_Short")) %>%
"HGVSp_Short"),
tmpdir = scratch_dir) %>%
rename("Kids_First_Biospecimen_ID" = "Tumor_Sample_Barcode") %>%
rename(Hugo_Symbol = SYMBOL) %>%
filter(Hugo_Symbol == "TP53") %>%
Expand Down
139 changes: 77 additions & 62 deletions analyses/tp53_nf1_score/05-tp53-altered-annotation.nb.html

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions analyses/tp53_nf1_score/06-evaluate-classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ def get_roc_plot(scores_df, gene, outputfilename, color):
sample_status, sample_score, drop_intermediate=False
)
precision_pbta, recall_pbta, _ = precision_recall_curve(sample_status, sample_score)
auroc_pbta = roc_auc_score(sample_status, sample_score)
try:
auroc_pbta = roc_auc_score(sample_status, sample_score)
except ValueError:
auroc_pbta = 0
aupr_pbta = average_precision_score(sample_status, sample_score)

# Obtain Shuffled Metrics
Expand All @@ -161,7 +164,10 @@ def get_roc_plot(scores_df, gene, outputfilename, color):
precision_shuff, recall_shuff, _ = precision_recall_curve(
sample_status, shuffle_score
)
auroc_shuff = roc_auc_score(sample_status, shuffle_score)
try:
auroc_shuff = roc_auc_score(sample_status, shuffle_score)
except ValueError:
auroc_shuff = 0
aupr_shuff = average_precision_score(sample_status, shuffle_score)

roc_df = (
Expand Down
Binary file modified analyses/tp53_nf1_score/__pycache__/utils.cpython-310.pyc
Binary file not shown.
Binary file removed analyses/tp53_nf1_score/plots/HR_DGM.png
Binary file not shown.
Binary file not shown.
Binary file removed analyses/tp53_nf1_score/plots/HR_HGG_WT.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed analyses/tp53_nf1_score/plots/KM_binned_age.pdf
Binary file not shown.
Binary file removed analyses/tp53_nf1_score/plots/KM_binned_tp53.pdf
Binary file not shown.
Binary file removed analyses/tp53_nf1_score/plots/KM_broad_mol.pdf
Binary file not shown.
Binary file not shown.
Binary file removed analyses/tp53_nf1_score/plots/KM_race.pdf
Binary file not shown.
Binary file removed analyses/tp53_nf1_score/plots/KM_reported_gender.pdf
Binary file not shown.
Binary file modified analyses/tp53_nf1_score/plots/exome_capture_TP53_roc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed analyses/tp53_nf1_score/plots/polya_TP53_roc.png
Binary file not shown.
Binary file modified analyses/tp53_nf1_score/plots/polya_stranded_TP53_roc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified analyses/tp53_nf1_score/plots/stranded_TP53_roc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
102 changes: 51 additions & 51 deletions analyses/tp53_nf1_score/results/TP53_NF1_snv_alteration.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,33 @@ chr17 7667335 7667335 + 3'Flank BS_E4N5C9JF TP53
chr17 7674221 7674221 + Missense_Mutation BS_E4N5C9JF TP53
chr17 7674894 7674894 + Nonsense_Mutation BS_WPCBK1EG TP53
chr17 7673718 7673803 + Frame_Shift_Del BS_JZ40GV74 TP53
chr17 7535526 7676778 NA Loss BS_46TXYD8H TP53
chr17 113850 18444459 NA Loss BS_P0QJ1QAH TP53
chr17 7013006 7682675 NA Loss BS_DFTX5Q9V TP53
chr17 342848 21288960 NA Loss BS_823V5X6Z TP53
chr17 2884630 11599420 NA Loss BS_JZ40GV74 TP53
chr17 127638 21882826 NA Loss BS_GCG2PKQA TP53
chr17 7672479 7673490 NA Loss BS_81SVXT4D TP53
chr17 3307018 7893426 NA Loss BS_80078QDG TP53
chr17 110880 18444888 NA Loss BS_85Q5P8GF TP53
chr17 7555845 8037810 NA Loss BS_WJB33V17 TP53
chr17 7475776 7784832 NA Loss BS_3NX3RBCX TP53
chr17 5488076 7985784 NA Loss BS_96S0VQBN TP53
chr17 139198 14929426 NA Loss BS_QJ58E1KY TP53
chr17 317504 21290368 NA Loss BS_823V5X6Z TP53
chr17 7660784 7663541 NA Loss BS_Y4CC9PKT TP53
chr17 141841 14443995 NA Loss BS_QJ58E1KY TP53
chr17 7558144 7784832 NA Loss BS_3NX3RBCX TP53
chr17 3489788 7892680 NA Loss BS_80078QDG TP53
chr17 2884630 12145490 NA Loss BS_JZ40GV74 TP53
chr17 7159864 8348466 NA Loss BS_3J4X955P TP53
chr17 6194429 7719421 NA Loss BS_3S64YXFJ TP53
chr17 7425418 7682675 NA Loss BS_DFTX5Q9V TP53
chr17 5489640 7984220 NA Loss BS_96S0VQBN TP53
chr17 7043484 8403276 NA Loss BS_KYVZWYMS TP53
chr17 315744 21289950 NA Loss BS_P0QJ1QAH TP53
chr17 317592 21290544 NA Loss BS_85Q5P8GF TP53
chr17 316056 21291234 NA Loss BS_GCG2PKQA TP53
chr17 7535526 7676778 NA loss BS_46TXYD8H TP53
chr17 113850 18444459 NA loss BS_P0QJ1QAH TP53
chr17 7013006 7682675 NA loss BS_DFTX5Q9V TP53
chr17 342848 21288960 NA loss BS_823V5X6Z TP53
chr17 2884630 11599420 NA loss BS_JZ40GV74 TP53
chr17 127638 21882826 NA loss BS_GCG2PKQA TP53
chr17 7672479 7673490 NA loss BS_81SVXT4D TP53
chr17 3307018 7893426 NA loss BS_80078QDG TP53
chr17 110880 18444888 NA loss BS_85Q5P8GF TP53
chr17 7555845 8037810 NA loss BS_WJB33V17 TP53
chr17 7475776 7784832 NA loss BS_3NX3RBCX TP53
chr17 5488076 7985784 NA loss BS_96S0VQBN TP53
chr17 139198 14929426 NA loss BS_QJ58E1KY TP53
chr17 317504 21290368 NA loss BS_823V5X6Z TP53
chr17 7660784 7663541 NA loss BS_Y4CC9PKT TP53
chr17 141841 14443995 NA loss BS_QJ58E1KY TP53
chr17 7558144 7784832 NA loss BS_3NX3RBCX TP53
chr17 3489788 7892680 NA loss BS_80078QDG TP53
chr17 2884630 12145490 NA loss BS_JZ40GV74 TP53
chr17 7159864 8348466 NA loss BS_3J4X955P TP53
chr17 6194429 7719421 NA loss BS_3S64YXFJ TP53
chr17 7425418 7682675 NA loss BS_DFTX5Q9V TP53
chr17 5489640 7984220 NA loss BS_96S0VQBN TP53
chr17 7043484 8403276 NA loss BS_KYVZWYMS TP53
chr17 315744 21289950 NA loss BS_P0QJ1QAH TP53
chr17 317592 21290544 NA loss BS_85Q5P8GF TP53
chr17 316056 21291234 NA loss BS_GCG2PKQA TP53
chr17 31258363 31258372 + Frame_Shift_Del BS_QQP17PDQ NF1
chr17 31327591 31327593 + In_Frame_Del BS_FAZBX8AS NF1
chr17 31201486 31201486 + Splice_Site BS_79NQJZ09 NF1
Expand Down Expand Up @@ -154,29 +154,28 @@ chr17 31327591 31327593 + In_Frame_Del BS_FAZBX8AS NF1
chr17 31235963 31235963 + Nonsense_Mutation BS_B9QP40ER NF1
chr17 31258363 31258372 + Frame_Shift_Del BS_QQP17PDQ NF1
chr17 31169985 31169985 + Nonsense_Mutation BS_KYVZWYMS NF1
chr17 31080704 31385312 NA Loss BS_HBSA5CW2 NF1
chr17 30712374 31403295 NA Loss BS_AYPBAHJ6 NF1
chr17 29571542 31720689 NA Loss BS_DFTX5Q9V NF1
chr17 26561920 32615616 NA Loss BS_823V5X6Z NF1
chr17 30951410 31108735 NA Loss BS_JZ40GV74 NF1
chr17 31108735 31605070 NA Loss BS_JZ40GV74 NF1
chr17 23512743 32996449 NA Loss BS_GCG2PKQA NF1
chr17 31047576 31458000 NA Loss BS_ASGBEHAX NF1
chr17 31146709 31478770 NA Loss BS_1WY6405N NF1
chr17 30085242 31692045 NA Loss BS_WJB33V17 NF1
chr17 26783064 42907788 NA Loss BS_AYPBAHJ6 NF1
chr17 26951936 36152512 NA Loss BS_823V5X6Z NF1
chr17 31033464 31458000 NA Loss BS_ASGBEHAX NF1
chr17 27516273 31234093 NA Loss BS_QJ58E1KY NF1
chr17 31234093 31402364 NA Loss BS_QJ58E1KY NF1
chr17 31147092 31479153 NA Loss BS_1WY6405N NF1
chr17 30982875 31104675 NA Loss BS_JZ40GV74 NF1
chr17 31104675 31604055 NA Loss BS_JZ40GV74 NF1
chr17 30488458 31753722 NA Loss BS_DFTX5Q9V NF1
chr17 26966160 45573735 NA Loss BS_3HXCGJ4J NF1
chr17 30396520 31754324 NA Loss BS_KYVZWYMS NF1
chr17 26966060 32996449 NA Loss BS_GCG2PKQA NF1
NA NA NA NA NA BS_J4E9SW51 No_TP53_NF1_alt
chr17 31080704 31385312 NA loss BS_HBSA5CW2 NF1
chr17 30712374 31403295 NA loss BS_AYPBAHJ6 NF1
chr17 29571542 31720689 NA loss BS_DFTX5Q9V NF1
chr17 26561920 32615616 NA loss BS_823V5X6Z NF1
chr17 30951410 31108735 NA loss BS_JZ40GV74 NF1
chr17 31108735 31605070 NA loss BS_JZ40GV74 NF1
chr17 23512743 32996449 NA loss BS_GCG2PKQA NF1
chr17 31047576 31458000 NA loss BS_ASGBEHAX NF1
chr17 31146709 31478770 NA loss BS_1WY6405N NF1
chr17 30085242 31692045 NA loss BS_WJB33V17 NF1
chr17 26783064 42907788 NA loss BS_AYPBAHJ6 NF1
chr17 26951936 36152512 NA loss BS_823V5X6Z NF1
chr17 31033464 31458000 NA loss BS_ASGBEHAX NF1
chr17 27516273 31234093 NA loss BS_QJ58E1KY NF1
chr17 31234093 31402364 NA loss BS_QJ58E1KY NF1
chr17 31147092 31479153 NA loss BS_1WY6405N NF1
chr17 30982875 31104675 NA loss BS_JZ40GV74 NF1
chr17 31104675 31604055 NA loss BS_JZ40GV74 NF1
chr17 30488458 31753722 NA loss BS_DFTX5Q9V NF1
chr17 26966160 45573735 NA loss BS_3HXCGJ4J NF1
chr17 30396520 31754324 NA loss BS_KYVZWYMS NF1
chr17 26966060 32996449 NA loss BS_GCG2PKQA NF1
NA NA NA NA NA BS_D7PRJEMD No_TP53_NF1_alt
NA NA NA NA NA BS_7P378T0E No_TP53_NF1_alt
NA NA NA NA NA BS_9DM8H1RX No_TP53_NF1_alt
Expand All @@ -192,7 +191,6 @@ NA NA NA NA NA BS_00TRPEQX No_TP53_NF1_alt
NA NA NA NA NA BS_A0NBZQPH No_TP53_NF1_alt
NA NA NA NA NA BS_QWS88QXE No_TP53_NF1_alt
NA NA NA NA NA BS_V3X7YF5J No_TP53_NF1_alt
NA NA NA NA NA BS_ABZ3BK38 No_TP53_NF1_alt
NA NA NA NA NA BS_NJFK43N3 No_TP53_NF1_alt
NA NA NA NA NA BS_KAD49R68 No_TP53_NF1_alt
NA NA NA NA NA BS_F064HMTP No_TP53_NF1_alt
Expand All @@ -213,3 +211,5 @@ NA NA NA NA NA BS_742CDKAS No_TP53_NF1_alt
NA NA NA NA NA BS_SG37096X No_TP53_NF1_alt
NA NA NA NA NA BS_7ZM4PG53 No_TP53_NF1_alt
NA NA NA NA NA BS_4MGT61BX No_TP53_NF1_alt
NA NA NA NA NA BS_J4E9SW51 No_TP53_NF1_alt
NA NA NA NA NA BS_ABZ3BK38 No_TP53_NF1_alt
Loading