From e78707067c1fdc6eed9b48b6b9b942c0ed3b9af0 Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Fri, 11 Jun 2021 13:25:02 +0100 Subject: [PATCH] saving work before converting to a function --- scripts/af_or_calcs.R | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/scripts/af_or_calcs.R b/scripts/af_or_calcs.R index f3971f4..a0f439d 100755 --- a/scripts/af_or_calcs.R +++ b/scripts/af_or_calcs.R @@ -71,10 +71,6 @@ cat(paste0('Output file with full path:', outfile_af_or)) ######################################################### raw_data_all = read.csv(infile_master, stringsAsFactors = F) -# building cols to extract -dr_muts_col = paste0('dr_mutations_', drug) -other_muts_col = paste0('other_mutations_', drug) - cat('Extracting columns based on variables:\n' , drug , '\n' @@ -217,22 +213,23 @@ pval_logistic = summary(model)$coefficients[2,4] print(paste0('logistic pval:', pval_logistic)) #===================================== -#OR calcs using the following 4 -#1) chisq.test -#2) fisher -#3) modified chisq.test -#4) logistic -#5) adjusted logistic? -#6) kinship (separate script) +# OR calcs using the following 4 +#1) logistic +#2) custom chisq.test +#3) fisher +#4) chisq.test +# adjusted logistic (NO good) +# kinship (separate script) #====================================== # TEST FOR a few muts: sapply and df -#=============================================== +#====================================== #snps <- gene_snps_unique[1:2]# reassign so you test with subset of muts snps <- gene_snps_unique -cat(paste0('Running calculations for:', length(snps), ' nssnps\n' -, 'gene: ', gene -, '\ndrug: ', drug )) +cat(paste0('Running calculations for:' + , length(snps), ' nssnps\n' + , 'gene: ', gene + , '\ndrug: ', drug )) # DV: 0 or 1 dst = raw_data[[drug]]