added first line to all func to run from

This commit is contained in:
Tanushree Tunstall 2021-06-24 10:02:14 +01:00
parent 1c27bbff11
commit e822f9f690
8 changed files with 13 additions and 8 deletions

View file

@ -1,3 +1,4 @@
#!/usr/bin/env Rscript
library(ggplot2) library(ggplot2)
library(tidyverse) library(tidyverse)
library(data.table) library(data.table)
@ -18,5 +19,3 @@ aa_prop_bp <- function(plotdf
, name = leg_name) , name = leg_name)
return(mp) return(mp)
} }

View file

@ -1,3 +1,7 @@
#!/usr/bin/env Rscript
########################################################################
# TASK:calculate af and or for gwas data
########################################################################
my_afor <- function ( drug my_afor <- function ( drug
, gene , gene
, infile_master , infile_master

View file

@ -9,5 +9,4 @@ mychisq_or = function(dst_numeric, mut_numeric){
d = tab[1,1] d = tab[1,1]
if (d==0){ d<-0.5} if (d==0){ d<-0.5}
(a/b)/(c/d) (a/b)/(c/d)
} }

View file

@ -117,7 +117,6 @@ all_df = list(my_df, my_df_u, my_df_u_lig, dup_muts)
return(all_df) return(all_df)
} }
######################################################################## ########################################################################
# end of data extraction and cleaning for plots # # end of data extraction and cleaning for plots #
######################################################################## ########################################################################

View file

@ -1,3 +1,4 @@
#!/usr/bin/env Rscript
library(ggplot2) library(ggplot2)
library(tidyverse) library(tidyverse)
library(data.table) library(data.table)

View file

@ -1,3 +1,4 @@
#!/usr/bin/env Rscript
setwd("~/git/LSHTM_analysis/scripts/functions/") setwd("~/git/LSHTM_analysis/scripts/functions/")
getwd() getwd()
############################################################# #############################################################

View file

@ -1,3 +1,4 @@
#!/usr/bin/env Rscript
getwd() getwd()
setwd("~/git/LSHTM_analysis/scripts/functions/") setwd("~/git/LSHTM_analysis/scripts/functions/")
getwd() getwd()

View file

@ -104,6 +104,7 @@ plot_logo_multiple_muts = paste0(plotdir,"/", logo_multiple_muts)
# REASSIGNMENT # REASSIGNMENT
my_df = merged_df3 my_df = merged_df3
#%%%%%%%%%%%%%%%%%%%%%%%%%%%% #%%%%%%%%%%%%%%%%%%%%%%%%%%%%
colnames(my_df) colnames(my_df)
str(my_df) str(my_df)
@ -113,7 +114,7 @@ c1 = unique(my_df$position)
nrow(my_df) nrow(my_df)
# get freq count of positions so you can subset freq<1 # get freq count of positions so you can subset freq<1
require(data.table) #require(data.table)
setDT(my_df)[, mut_pos_occurrence := .N, by = .(position)] #189, 36 setDT(my_df)[, mut_pos_occurrence := .N, by = .(position)] #189, 36
table(my_df$position) table(my_df$position)