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 48a85ede0c
commit 552c5e77aa
8 changed files with 13 additions and 8 deletions

View file

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

View file

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

View file

@ -9,5 +9,4 @@ mychisq_or = function(dst_numeric, mut_numeric){
d = tab[1,1]
if (d==0){ d<-0.5}
(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)
}
########################################################################
# end of data extraction and cleaning for plots #
########################################################################

View file

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

View file

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

View file

@ -1,3 +1,4 @@
#!/usr/bin/env Rscript
getwd()
setwd("~/git/LSHTM_analysis/scripts/functions/")
getwd()
@ -26,4 +27,4 @@ my_df = pd_df[[1]]
my_df_u = pd_df[[2]]
my_df_u_lig = pd_df[[3]]
dup_muts = pd_df[[4]]
#===============================================================
#===============================================================

View file

@ -102,8 +102,9 @@ plot_logo_multiple_muts = paste0(plotdir,"/", logo_multiple_muts)
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# REASSIGNMENT
my_df = merged_df3
my_df = merged_df3
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%
colnames(my_df)
str(my_df)
@ -113,7 +114,7 @@ c1 = unique(my_df$position)
nrow(my_df)
# 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
table(my_df$position)