Last updated: 2019-09-13
Checks: 6 0
Knit directory: ~/Box/RProjects/pair_con_select/
This reproducible R Markdown analysis was created with workflowr (version 1.3.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20190211)
was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: analysis/.Rhistory
Ignored: analysis/.Rproj.user/
Ignored: data/skmel28_sos1_mekq56p_vemurafenib.csv.sb-ea24b981-dvFz4V/
Untracked files:
Untracked: analysis/alk_luad_mutation_bias.Rmd
Untracked: analysis/analysis.Rproj
Untracked: code/alldata_compiler.R
Untracked: code/contab_maker.R
Untracked: code/mut_excl_genes_datapoints.R
Untracked: code/mut_excl_genes_generator.R
Untracked: code/quadratic_solver.R
Untracked: code/simresults_generator.R
Untracked: data/ALKATI_ccle.csv
Untracked: data/All_Data_V2.csv
Untracked: data/CCLE_NP24.2009_Drug_data_2015.02.24.csv
Untracked: data/alkati_growthcurvedata.csv
Untracked: data/alkati_growthcurvedata_popdoublings.csv
Untracked: data/alkati_melanoma_vemurafenib_figure_data.csv
Untracked: data/alkati_simulations_compiled_1000_12319.csv
Untracked: data/all_data.csv
Untracked: data/skmel28_sos1_mekq56p_vemurafenib.csv
Untracked: data/tcga_brca_expression/
Untracked: data/tcga_luad_expression/
Untracked: data/tcga_skcm_expression/
Untracked: docs/figure/Filteranalysis.Rmd/
Untracked: output/ alkati_subsamplesize_orval_fig1c.pdf
Untracked: output/alkati_ccle_tae684_plot.pdf
Untracked: output/alkati_filtercutoff_allfilters.csv
Untracked: output/alkati_luad_exonimbalance.pdf
Untracked: output/alkati_mtn_pval_fig2B.pdf
Untracked: output/alkati_skcm_exonimbalance.pdf
Untracked: output/alkati_subsamplesize_pval_fig.pdf
Untracked: output/alkati_subsamplesize_pval_fig1c.pdf
Untracked: output/all_data_luad.csv
Untracked: output/all_data_luad_egfr.csv
Untracked: output/all_data_skcm.csv
Untracked: output/baf3_alkati_figure_deltaadjusted_doublings.pdf
Untracked: output/baf3_barplot.pdf
Untracked: output/baf3_elisa_barplot.pdf
Untracked: output/egfr_luad_exonimbalance.pdf
Untracked: output/fig1c_3719_4.pdf
Untracked: output/fig1c_52219.pdf
Untracked: output/fig2b2_filtercutoff_atinras_totalalk.pdf
Untracked: output/fig2b_filtercutoff_atibraf.pdf
Untracked: output/fig2b_filtercutoff_atinras.pdf
Untracked: output/luad_alk_exon_expression.csv
Untracked: output/luad_egfr_exon_expression.csv
Untracked: output/melanoma_vemurafenib_fig.pdf
Untracked: output/melanoma_vemurafenib_fig_bottom.pdf
Untracked: output/melanoma_vemurafenib_fig_top.pdf
Untracked: output/skcm_alk_exon_expression.csv
Untracked: output/suppfig1..pdf
Untracked: output/suppfig1_52219.pdf
Untracked: suppfig1..pdf
Unstaged changes:
Modified: analysis/ALKATI_Filter_Cutoff_Analysis.Rmd
Modified: analysis/ALK_ExonImbalance_SKCM_Analysis.Rmd
Modified: analysis/TCGA_luad_data_parser.Rmd
Modified: analysis/alkati_cell_line_tae684_response.Rmd
Modified: analysis/baf3_alkati_transformations.Rmd
Modified: analysis/index.Rmd
Modified: analysis/pairwise_comparisons_conditional_selection_simulated_cohorts.Rmd
Deleted: analysis/practice.Rmd
Modified: analysis/tcga_luad_data_parser_egfr.Rmd
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the R Markdown and HTML files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view them.
File | Version | Author | Date | Message |
---|---|---|---|---|
Rmd | d79cb8f | haiderinam | 2019-09-13 | Adding ggplotly plots |
html | 2be2f98 | haiderinam | 2019-09-13 | Build site. |
Rmd | c158770 | haiderinam | 2019-09-13 | Published Analysis on our method applied to ALKATI and on how downsampling |
html | 6744c50 | haiderinam | 2019-03-06 | Build site. |
html | aff917b | haiderinam | 2019-02-20 | Build site. |
html | 0b5f5cb | haiderinam | 2019-02-19 | Build site. |
html | 4b082e4 | haiderinam | 2019-02-19 | Build site. |
html | 08e9438 | haiderinam | 2019-02-17 | Build site. |
html | dfdb600 | haiderinam | 2019-02-17 | Build site. |
Rmd | f8e2d5e | haiderinam | 2019-02-17 | Published Analysis on ALK expression levels #2 |
html | 0cad4ec | haiderinam | 2019-02-16 | Build site. |
Rmd | 257ca7e | haiderinam | 2019-02-16 | Published Analysis on ALK expression levels and initial mutual exclusivity data |
html | e9fd3ed | haiderinam | 2019-02-11 | Build site. |
Rmd | 3b773bf | haiderinam | 2019-02-11 | wflow_publish(all = T) |
html | 3b773bf | haiderinam | 2019-02-11 | wflow_publish(all = T) |
html | 5d432fb | haiderinam | 2019-02-11 | Build site. |
Rmd | 4c89be3 | haiderinam | 2019-02-11 | Publish the initial files for myproject |
nameposctrl1<-'BRAF'
#Positive control 1
nameposctrl2<-'NRAS'
#Oncogene in Question
namegene<-'ATI'
#Mutation Boolean (Y or N)
mtn<-'N'
#Name Mutation for Positive Ctrl 1
nameposctrl1mt<-'V600E'
#Name of Mutation for Positive Ctrl 2
nameposctrl2mt<-'Q61L'
alldata=read.csv("output/all_data_skcm.csv",sep=",",header=T,stringsAsFactors=F)
head(alldata)
X Patid mean_RPKM_1.19 mean_RPKM_20.29 Ratio20.29 mRNA_count
1 1 TCGA-BF-A1PU 0.62445977 1.24042009 1.986389 948
2 2 TCGA-BF-A1PV 0.02099345 0.15815619 7.533598 82
3 3 TCGA-BF-A1PX 0.01752838 0.09612414 5.483914 92
4 4 TCGA-BF-A1PZ 0.19874434 7.27553619 36.607514 2822
5 5 TCGA-BF-A1Q0 2.13353636 3.71661801 1.741999 2211
6 6 TCGA-BF-A3DJ 0.06244694 0.55656239 8.912565 281
BRAF NRAS RSEM_normalized ATI
1 V600E NaN 107.1429 0
2 NaN Q61L 8.9659 0
3 V600E NaN 14.5985 0
4 NaN Q61R 329.0810 1
5 NaN NaN 277.0434 0
6 V600E NaN 35.1542 0
###Not mutation specific
alldata_comp=alldata_compiler(alldata,nameposctrl1,nameposctrl2,namegene,'N',"N/A","N/A")[[2]]
head(alldata_comp)
X Patid Positive_Ctrl1 Positive_Ctrl2 genex rndmarray
1 1 TCGA-BF-A1PU 1 0 0 0
2 2 TCGA-BF-A1PV 0 1 0 1
3 3 TCGA-BF-A1PX 1 0 0 0
4 4 TCGA-BF-A1PZ 0 1 1 0
5 5 TCGA-BF-A1Q0 0 0 0 0
6 6 TCGA-BF-A3DJ 1 0 0 0
BRAF_NRAS=fisher.test(contab_maker(alldata_comp$Positive_Ctrl1,alldata_comp$Positive_Ctrl2,alldata_comp))$p.value
BRAF_NRAS_odds=fisher.test(contab_maker(alldata_comp$Positive_Ctrl1,alldata_comp$Positive_Ctrl2,alldata_comp))$estimate
BRAF_ATI=fisher.test(contab_maker(alldata_comp$Positive_Ctrl1,alldata_comp$genex,alldata_comp))$p.value
BRAF_ATI_odds=fisher.test(contab_maker(alldata_comp$Positive_Ctrl1,alldata_comp$genex,alldata_comp))$estimate
NRAS_ATI=fisher.test(contab_maker(alldata_comp$Positive_Ctrl2,alldata_comp$genex,alldata_comp))$p.value
NRAS_ATI_odds=fisher.test(contab_maker(alldata_comp$Positive_Ctrl2,alldata_comp$genex,alldata_comp))$estimate
Rndm_ATI=fisher.test(contab_maker(alldata_comp$rndmarray,alldata_comp$genex,alldata_comp))$p.value
Rndm_ATI_odds=fisher.test(contab_maker(alldata_comp$rndmarray,alldata_comp$genex,alldata_comp))$estimate
###Mutation specific
alldata_comp=alldata_compiler(alldata,nameposctrl1,nameposctrl2,namegene,'Y',"V600E","Q61L")[[2]]
head(alldata_comp)
X Patid Positive_Ctrl1 Positive_Ctrl2 genex rndmarray
1 1 TCGA-BF-A1PU 1 0 0 0
2 2 TCGA-BF-A1PV 0 1 0 1
3 3 TCGA-BF-A1PX 1 0 0 0
4 4 TCGA-BF-A1PZ 0 0 1 0
5 5 TCGA-BF-A1Q0 0 0 0 0
6 6 TCGA-BF-A3DJ 1 0 0 0
BRAF_NRAS_mtn=fisher.test(contab_maker(alldata_comp$Positive_Ctrl1,alldata_comp$Positive_Ctrl2,alldata_comp))$p.value
BRAF_NRAS_mtn_odds=fisher.test(contab_maker(alldata_comp$Positive_Ctrl1,alldata_comp$Positive_Ctrl2,alldata_comp))$estimate
BRAF_ATI_mtn=fisher.test(contab_maker(alldata_comp$Positive_Ctrl1,alldata_comp$genex,alldata_comp))$p.value
BRAF_ATI_mtn_odds=fisher.test(contab_maker(alldata_comp$Positive_Ctrl1,alldata_comp$genex,alldata_comp))$estimate
NRAS_ATI_mtn=fisher.test(contab_maker(alldata_comp$Positive_Ctrl2,alldata_comp$genex,alldata_comp))$p.value
NRAS_ATI_mtn_odds=fisher.test(contab_maker(alldata_comp$Positive_Ctrl2,alldata_comp$genex,alldata_comp))$estimate
Rndm_ATI_mtn=fisher.test(contab_maker(alldata_comp$rndmarray,alldata_comp$genex,alldata_comp))$p.value
Rndm_ATI_mtn_odds=fisher.test(contab_maker(alldata_comp$rndmarray,alldata_comp$genex,alldata_comp))$estimate
###Summarizing ME data in a table:
alkati_me_summary=data.frame(cbind(rbind(BRAF_ATI,BRAF_ATI_mtn,NRAS_ATI,NRAS_ATI_mtn,BRAF_NRAS,BRAF_NRAS_mtn,Rndm_ATI,Rndm_ATI_mtn),rbind(BRAF_ATI_odds,BRAF_ATI_mtn_odds,NRAS_ATI_odds,NRAS_ATI_mtn_odds,BRAF_NRAS_odds,BRAF_NRAS_mtn_odds,Rndm_ATI_odds,Rndm_ATI_mtn_odds)))
colnames(alkati_me_summary)=c("P.value","Odds.Ratio")
alkati_me_summary
P.value Odds.Ratio
BRAF_ATI 4.071283e-01 0.75313992
BRAF_ATI_mtn 6.033028e-01 0.78803106
NRAS_ATI 1.343398e-01 1.70083914
NRAS_ATI_mtn 3.627722e-01 1.76258457
BRAF_NRAS 2.024969e-29 0.02538251
BRAF_NRAS_mtn 8.315112e-03 0.00000000
Rndm_ATI 4.138644e-01 1.53645442
Rndm_ATI_mtn 4.610659e-02 2.38723915
nsubsamples=50 # maybe this can be removed and instead calculated later.
nsims<-100 #
#Positive control 1
nameposctrl1<-'BRAF'
#Positive control 1
nameposctrl2<-'NRAS'
#Oncogene in Question
namegene<-'ATI'
#Mutation Boolean (Y or N)
mtn<-'N'
#Name Mutation for Positive Ctrl 1
nameposctrl1mt<-'V600E'
#Name of Mutation for Positive Ctrl 2
nameposctrl2mt<-'Q61L'
alldata=read.csv("output/all_data_skcm.csv",sep=",",header=T,stringsAsFactors=F)
nexperiments=7
alldata_comp=alldata_compiler(alldata,nameposctrl1,nameposctrl2,namegene,mtn,"N/A","N/A")[[2]]
genex_replication_prop=alldata_compiler(alldata,nameposctrl1,nameposctrl2,namegene,mtn,"N/A","N/A")[[1]]
simresults_comb=data.frame()
for(subsample_number in c(seq(5,25,5))){
nsubsamples=subsample_number
simresults=simresults_generator(alldata_comp,7)
simresults_comb=rbind(simresults_comb,simresults) ##iterative rbind this is not the most efficient way to do this
}
simresults_concat=simresults_comb%>%
filter(exp_num%in%c(4))
# simresults_concat=simresults_comb
plotly=ggplot(simresults_concat,aes(x=factor(subsample_size),y=log10(p_val)))+
geom_boxplot()+
cleanup+
guides(fill=F)+
scale_y_continuous(name="log P-Value")+
scale_x_discrete(name="Subsample size")+
# scale_color_manual(values="#E78AC3")+
theme(plot.title = element_text(hjust=.5),
text = element_text(size=11,face="bold"),
axis.title = element_text(face="bold",size="12",color="black"),
axis.text=element_text(face="bold",size="11",color="black"))
ggplotly(plotly)
# font_import()
# windowsFonts(Arial = windowsFont("Arial"))
# ggsave("output/alkati_subsamplesize_pval_fig1c.pdf",width = 3,height = 2,units = "in",useDingbats=F)
max(simresults_concat$OR_val)
[1] 0.4594879
plotly=ggplot(simresults_concat,aes(x=factor(subsample_size),y=(OR_val)))+
geom_boxplot()+
cleanup+
guides(fill=F)+
scale_y_continuous(name="log OR")+
scale_x_discrete(name="Subsample size")+
# scale_color_manual(values="#E78AC3")+
theme(plot.title = element_text(hjust=.5),
text = element_text(size=12,face="bold"),
axis.title = element_text(face="bold",size="12",color="black"),
axis.text=element_text(face="bold",size="12",color="black"))
ggplotly(plotly)
# ggsave("output/alkati_subsamplesize_orval_fig1c.pdf",width = 3,height = 2,units = "in",useDingbats=F)
# geom_hline(yintercept=-1.59,size=1)
nsubsamples=12 # maybe this can be removed and instead calculated later.
nsims<-100 #
#Positive control 1
nameposctrl1<-'BRAF'
#Positive control 1
nameposctrl2<-'NRAS'
#Oncogene in Question
namegene<-'ATI'
#Mutation Boolean (Y or N)
mtn<-'Y'
#Name Mutation for Positive Ctrl 1
nameposctrl1mt<-'V600E'
#Name of Mutation for Positive Ctrl 2
nameposctrl2mt<-'Q61L'
alldata=read.csv("output/all_data_skcm.csv",sep=",",header=T,stringsAsFactors=F)
nexperiments=7
###For mutation
alldata_comp=alldata_compiler(alldata,nameposctrl1,nameposctrl2,namegene,mtn,nameposctrl1mt,nameposctrl2mt)[[2]]
genex_replication_prop=alldata_compiler(alldata,nameposctrl1,nameposctrl2,namegene,mtn,nameposctrl1mt,nameposctrl2mt)[[1]]
simresults=simresults_generator(alldata_comp,7)
simresults$mtn='Y'
####For no mutation
mtn='N'
alldata_comp=alldata_compiler(alldata,nameposctrl1,nameposctrl2,namegene,mtn,"N/A","N/A")[[2]]
genex_replication_prop=alldata_compiler(alldata,nameposctrl1,nameposctrl2,namegene,mtn,"N/A","N/A")[[1]]
simresults_nomtn=simresults_generator(alldata_comp,7)
simresults_nomtn$mtn='N'
simresults=rbind(simresults,simresults_nomtn)
simresults[simresults$exp_num==1,]$exp_name="BRAF & ALKATI"
simresults[simresults$exp_num==3,]$exp_name="NRAS & ALKATI"
simresults[simresults$exp_num==4,]$exp_name="BRAF & NRAS"
simresults$exp_name=factor(simresults$exp_name,levels=c("1","5","6","7","BRAF & ALKATI","NRAS & ALKATI","BRAF & NRAS"))
simresults$mtn_tag='N'
simresults[simresults$mtn=='Y',]$mtn_tag="Mutation-specific"
simresults[simresults$mtn=='N',]$mtn_tag="Non mutation-specific"
simresults$mtn_tag=factor(simresults$mtn_tag,levels=c("Non mutation-specific","Mutation-specific"))
simresults_concat=simresults%>%
filter(exp_num==c(1,3,4))
Warning in exp_num == c(1, 3, 4): longer object length is not a multiple of
shorter object length
plotly=ggplot(simresults_concat,aes(x=factor(exp_name),y=log10(p_val)))+
geom_boxplot(aes(fill=factor(exp_name)))+
facet_wrap(~factor(mtn_tag))+
cleanup+
guides(fill=F)+
scale_y_continuous(name="log P-Value",limits = c(NA,1.5))+
scale_x_discrete(name="Gene Pair")+
scale_fill_brewer(palette = "Set2",name="Gene Pair")+
theme(plot.title = element_text(hjust=.5),
text = element_text(size=12,face="bold"),
axis.title = element_text(face="bold",size="13",color="black"),
axis.text.x=element_text(angle=15,hjust=.5,vjust=.5),
axis.text=element_text(face="bold",size="9",color="black"))
ggplotly(plotly)
# ggsave("output/alkati_mtn_pval_fig2B.pdf",width = 6,height = 4,units = "in",useDingbats=F)
###Performing the KS. test on these to show that the distribtutions of BRAF NRAS and BRAF ALKATI/NRAS ALKATI are significantly different .
# Mutation-specific
brafati=simresults_concat%>%filter(mtn_tag=="Mutation-specific",exp_num==1)
nrasati=simresults_concat%>%filter(mtn_tag=="Mutation-specific",exp_num==3)
brafnras=simresults_concat%>%filter(mtn_tag=="Mutation-specific",exp_num==4)
ks.test(brafati$p_val,brafnras$p_val)$p.value
Warning in ks.test(brafati$p_val, brafnras$p_val): cannot compute exact p-
value with ties
[1] 2.607914e-13
ks.test(nrasati$p_val,brafnras$p_val)$p.value
Warning in ks.test(nrasati$p_val, brafnras$p_val): cannot compute exact p-
value with ties
[1] 1.71041e-11
ks.test(brafati$p_val,nrasati$p_val)$p.value
Warning in ks.test(brafati$p_val, nrasati$p_val): cannot compute exact p-
value with ties
[1] 0.06996336
# Non-mutation-specific
brafati=simresults_concat%>%filter(mtn_tag=="Non mutation-specific",exp_num==1)
nrasati=simresults_concat%>%filter(mtn_tag=="Non mutation-specific",exp_num==3)
brafnras=simresults_concat%>%filter(mtn_tag=="Non mutation-specific",exp_num==4)
ks.test(brafati$p_val,brafnras$p_val)$p.value
Warning in ks.test(brafati$p_val, brafnras$p_val): cannot compute exact p-
value with ties
[1] 9.325873e-15
ks.test(nrasati$p_val,brafnras$p_val)$p.value
Warning in ks.test(nrasati$p_val, brafnras$p_val): cannot compute exact p-
value with ties
[1] 9.325873e-15
ks.test(brafati$p_val,nrasati$p_val)$p.value
Warning in ks.test(brafati$p_val, nrasati$p_val): cannot compute exact p-
value with ties
[1] 0.02546396
sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] parallel grid stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] extrafont_0.17 ggsignif_0.5.0 usethis_1.5.0
[4] devtools_2.0.2 RColorBrewer_1.1-2 reshape2_1.4.3
[7] doParallel_1.0.14 iterators_1.0.10 foreach_1.4.4
[10] dplyr_0.8.1 VennDiagram_1.6.20 futile.logger_1.4.3
[13] workflowr_1.3.0 tictoc_1.0 knitr_1.23
[16] plotly_4.9.0 ggplot2_3.1.1
loaded via a namespace (and not attached):
[1] httr_1.4.0 pkgload_1.0.2 tidyr_0.8.3
[4] jsonlite_1.6 viridisLite_0.3.0 shiny_1.3.2
[7] assertthat_0.2.1 yaml_2.2.0 remotes_2.0.4
[10] sessioninfo_1.1.1 Rttf2pt1_1.3.7 pillar_1.4.1
[13] backports_1.1.4 glue_1.3.1 extrafontdb_1.0
[16] digest_0.6.19 promises_1.0.1 colorspace_1.4-1
[19] htmltools_0.3.6 httpuv_1.5.1 plyr_1.8.4
[22] pkgconfig_2.0.2 xtable_1.8-4 purrr_0.3.2
[25] scales_1.0.0 processx_3.3.1 whisker_0.3-2
[28] later_0.8.0 git2r_0.25.2 tibble_2.1.2
[31] withr_2.1.2 lazyeval_0.2.2 cli_1.1.0
[34] magrittr_1.5 crayon_1.3.4 mime_0.6
[37] memoise_1.1.0 evaluate_0.14 ps_1.3.0
[40] fs_1.3.1 pkgbuild_1.0.3 tools_3.5.2
[43] data.table_1.12.2 prettyunits_1.0.2 formatR_1.6
[46] stringr_1.4.0 munsell_0.5.0 lambda.r_1.2.3
[49] callr_3.2.0 compiler_3.5.2 rlang_0.3.4
[52] htmlwidgets_1.3 crosstalk_1.0.0 labeling_0.3
[55] rmarkdown_1.13 gtable_0.3.0 codetools_0.2-16
[58] R6_2.4.0 rprojroot_1.3-2 futile.options_1.0.1
[61] desc_1.2.0 stringi_1.4.3 Rcpp_1.0.1
[64] tidyselect_0.2.5 xfun_0.7