From f244741e83f0c6f4b1524432b7569fb053555746 Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Mon, 15 Aug 2022 21:29:16 +0100 Subject: [PATCH] added Lin_count.R --- scripts/plotting/plotting_thesis/Lin_count.R | 48 ++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 scripts/plotting/plotting_thesis/Lin_count.R diff --git a/scripts/plotting/plotting_thesis/Lin_count.R b/scripts/plotting/plotting_thesis/Lin_count.R new file mode 100644 index 0000000..1129d5f --- /dev/null +++ b/scripts/plotting/plotting_thesis/Lin_count.R @@ -0,0 +1,48 @@ +#============= +# Data: Input +#============== +#source("~/git/LSHTM_analysis/config/alr.R") +#source("~/git/LSHTM_analysis/config/embb.R") +#source("~/git/LSHTM_analysis/config/gid.R") +#source("~/git/LSHTM_analysis/config/katg.R") +#source("~/git/LSHTM_analysis/config/pnca.R") +source("~/git/LSHTM_analysis/config/rpob.R") + +source("~/git/LSHTM_analysis/scripts/plotting/get_plotting_dfs.R") +source("~/git/LSHTM_analysis/scripts/plotting/plotting_colnames.R") + +########################################################### +class(merged_df2) +foo = as.data.frame(colnames(merged_df2)) + +cols_to_subset = c('mutationinformation' + , 'snp_frequency' + , 'pos_count' + , 'position' + , 'lineage' + , "sensitivity" + #, 'lineage_multimode' + , 'dst' + , 'dst2' + #, 'dst_multimode' + #, 'dst_multimode_all' + , 'dst_mode') + +my_df = merged_df2[ ,cols_to_subset] + +cat("\nTotal samples for ALL lineages", tolower(gene),":", nrow(my_df)) +cat("\nTotal muts in ALL lineages", tolower(gene),":" + , length(unique(my_df$mutationinformation))) + +sel_lineages1 = c("LBOV", "") +my_df2 = my_df[!my_df$lineage%in%sel_lineages1,] +table(my_df2$lineage) +sel_lineages2 = c("L1", "L2", "L3", "L4") +my_df2 = my_df2[my_df2$lineage%in%sel_lineages2,] +cat("\nTotal samples for L1-L4", tolower(gene),":", nrow(my_df2)) +cat("\nTotal muts for L1-L4", tolower(gene),":" + , length(unique(my_df2$mutationinformation))) + +table(my_df2$lineage) +table(my_df2$lineage,my_df2$sensitivity) + \ No newline at end of file