starting corr plots

This commit is contained in:
Tanushree Tunstall 2022-08-09 21:55:24 +01:00
parent cd86fcf8e8
commit a6d93b3fa8
2 changed files with 92 additions and 107 deletions

View file

@ -1,28 +1,7 @@
#!/usr/bin/env Rscript
#########################################################
# TASK: Script to format data for Correlation plots:
# corr_data_extract()
# INPUT:
# df: data with all parameters (my_use case)
# merged_df3 or merged_df2!?
# gene: [sanity check]
# drug: relates to a column name that will need to extracted
# ligand_dist_colname = LigDist_colname (variable from plotting_globals()
# colnames_to_extract = c("mutationinformation", "duet_affinity_change")
# display_colnames_key = c(mutationinformation = "MUT" , duet_affinity_change = "DUET")
# extract_scaled_cols = T or F, so that parameters with the _scaled suffix can be extracted.
# NOTE*: No formatting applied to these cols i.e display name
# RETURNS: DF
# containing all the columns required for generating downstream correlation plots
# TODO: ADD
#lineage_count_all
#lineage_count_unique
#my_df['lineage_proportion'] = my_df['lineage_count_unique']/my_df['lineage_count_all']
#my_df['dist_lineage_proportion'] = my_df['lineage_count_unique']/total_mtblineage_uc
##################################################################
# LigDist_colname #from globals: plotting_globals.R
@ -31,14 +10,11 @@
corr_data_extract <- function(df
, gene
, drug
#, ligand_dist_colname = LigDist_colname
, colnames_to_extract
, colnames_display_key
, extract_scaled_cols = F){
if ( missing(colnames_to_extract) || missing(colnames_display_key) ){
#if ( missing(colnames_to_extract) ){
cat("\n=========================================="
, "\nCORR PLOTS data: ALL params"
, "\n=========================================")