combined msa and wt seq into 1 list so only list is passed as an arg for plotting ED plots

This commit is contained in:
Tanushree Tunstall 2022-02-15 08:31:58 +00:00
parent d38521e03a
commit 2274f01f23
5 changed files with 20 additions and 5 deletions

View file

@ -540,7 +540,7 @@ wideP_consurf <- function(plotdf
}
}else{
cat("\nNo annotation for xvar requested")
cat("\nNo annotation for additional ligands on xvar requested")
}
#==============================================
if (A_xvar_lig){

View file

@ -38,8 +38,9 @@
###########################################
LogoPlotMSA <- function(msaSeq_mut # chr vector
, msaSeq_wt # chr vector
#LogoPlotMSA <- function(msaSeq_mut # chr vector
# , msaSeq_wt # chr vector
LogoPlotMSA <- function(unified_msa
, logo_type = c("EDLogo") #"bits_pfm", "probability_pfm", "bits_raw", "probability_raw")
, EDScore_type = c("log") # see if this relevant, or source function should have it!
, bg_prob = NULL
@ -64,7 +65,12 @@ LogoPlotMSA <- function(msaSeq_mut # chr vector
)
{
# FIXME: Hack!
# msaSeq_mut=unified_msa[[1]]
# msaSeq_wt=unified_msa[[2]]
msaSeq_mut=unified_msa[['msa_seq']]
msaSeq_wt=unified_msa[['wt_seq']]
# Get PFM matrix for mut and wt MSA provided
data_ed = DataED_PFM(msaSeq_mut
, msaSeq_wt

View file

@ -65,6 +65,7 @@ LogoPlotCustomH <- function(plot_df
#################################
# Data processing for logo plot
#################################
if (rm_empty_y){
plot_df = plot_df[!is.na(plot_df[y_axis_colname]),]
cat("\nRemoving empty positions...\n")

View file

@ -54,7 +54,6 @@ LogoPlotSnps <- function(plot_df
############################################
# Data processing for logo plot for nsSNPS
############################################
setDT(plot_df)[, mut_pos_occurrence := .N, by = .(eval(parse(text=x_axis_colname)))]
table(plot_df[[x_axis_colname]])

View file

@ -49,3 +49,12 @@ head(msa2)
cat("\nLength of WT fasta:", nrow(msa2))
wt_seq = msa2$V1
head(wt_seq)
#===========================
# combine msa and wt seqs
#===========================
# unified_msa = list(msa_seq
# , wt_seq)
unified_msa = list(msa_seq = msa_seq
, wt_seq = wt_seq)