fixed source to contain plotting cols and pos_count correctly
This commit is contained in:
parent
4147a6b90f
commit
13999a477d
6 changed files with 66 additions and 39 deletions
|
@ -41,7 +41,7 @@ geneL_ppi2 = c("alr", "embb", "katg", "rpob")
|
|||
|
||||
combining_dfs_plotting <- function( my_df_u
|
||||
, gene_metadata
|
||||
, gene # ADDED
|
||||
#, gene # ADDED
|
||||
, lig_dist_colname = ''
|
||||
, lig_dist_cutoff = ''){
|
||||
|
||||
|
@ -686,8 +686,11 @@ combining_dfs_plotting <- function( my_df_u
|
|||
min( merged_df3['avg_lig_affinity_scaled']); max( merged_df3['avg_lig_affinity_scaled'])
|
||||
|
||||
###################################################################
|
||||
# Rectify pos_count column in merged_df3
|
||||
# The one in merged_df2 is correct
|
||||
#--------------------------------------------
|
||||
# merged_df3: Rectify pos_count column
|
||||
# Rename existing pos_count colum to reflect
|
||||
# that it is correct according to merged_df2
|
||||
#--------------------------------------------
|
||||
|
||||
nc_pc_CHANGE = which(colnames(merged_df3)== "pos_count"); nc_pc_CHANGE
|
||||
colnames(merged_df3)[nc_pc_CHANGE] = "df2_pos_count_all"
|
||||
|
@ -707,16 +710,25 @@ combining_dfs_plotting <- function( my_df_u
|
|||
nc_change = which(colnames(merged_df3) == "n")
|
||||
colnames(merged_df3)[nc_change] <- "pos_count"
|
||||
class(merged_df3)
|
||||
|
||||
####################################################################
|
||||
#-------------------------------------------------
|
||||
# merged_df2: Rename existing pos_count
|
||||
# column to df2_pos_count_all like in above df
|
||||
#-------------------------------------------------
|
||||
nc_pc_CHANGE_df2 = which(colnames(merged_df2)== "pos_count"); nc_pc_CHANGE_df2
|
||||
colnames(merged_df2)[nc_pc_CHANGE_df2] = "df2_pos_count_all"
|
||||
head(merged_df2$pos_count)
|
||||
head(merged_df2$df2_pos_count_all)
|
||||
|
||||
####################################################################
|
||||
# ADD: distance to Nucleic acid column for na genes
|
||||
|
||||
|
||||
# already done in plotting_data
|
||||
####################################################################
|
||||
#TODO
|
||||
# Choose few columns to return as plot_df
|
||||
|
||||
|
||||
|
||||
merged_df3 = merged_df3[, colnames(merged_df3)%in%c(plotting_cols, "pos_count", "df2_pos_count_all")]
|
||||
merged_df2 = merged_df2[, colnames(merged_df2)%in%c(plotting_cols, "df2_pos_count_all")]
|
||||
|
||||
####################################################################
|
||||
return(list( merged_df2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue