added first line to all func to run from
This commit is contained in:
parent
48a85ede0c
commit
552c5e77aa
8 changed files with 13 additions and 8 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
|
}
|
||||||
}
|
|
|
@ -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 #
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/usr/bin/env Rscript
|
||||||
library(ggplot2)
|
library(ggplot2)
|
||||||
library(tidyverse)
|
library(tidyverse)
|
||||||
library(data.table)
|
library(data.table)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/usr/bin/env Rscript
|
||||||
setwd("~/git/LSHTM_analysis/scripts/functions/")
|
setwd("~/git/LSHTM_analysis/scripts/functions/")
|
||||||
getwd()
|
getwd()
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/usr/bin/env Rscript
|
||||||
getwd()
|
getwd()
|
||||||
setwd("~/git/LSHTM_analysis/scripts/functions/")
|
setwd("~/git/LSHTM_analysis/scripts/functions/")
|
||||||
getwd()
|
getwd()
|
||||||
|
@ -26,4 +27,4 @@ my_df = pd_df[[1]]
|
||||||
my_df_u = pd_df[[2]]
|
my_df_u = pd_df[[2]]
|
||||||
my_df_u_lig = pd_df[[3]]
|
my_df_u_lig = pd_df[[3]]
|
||||||
dup_muts = pd_df[[4]]
|
dup_muts = pd_df[[4]]
|
||||||
#===============================================================
|
#===============================================================
|
||||||
|
|
|
@ -102,8 +102,9 @@ 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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue