consurf plot: add debug option. logoP SNP: distance flame tiles
This commit is contained in:
parent
f2709f3992
commit
e498d46f8b
2 changed files with 230 additions and 219 deletions
|
@ -86,7 +86,8 @@ wideP_consurf <- function(plotdf
|
||||||
, tpos3 = 0
|
, tpos3 = 0
|
||||||
|
|
||||||
, default_gt_clr = "white"
|
, default_gt_clr = "white"
|
||||||
){
|
, debug=FALSE
|
||||||
|
){
|
||||||
|
|
||||||
if(missing(point_colours)){
|
if(missing(point_colours)){
|
||||||
temp_cols = colorRampPalette(c("seagreen", "sienna3"))(30)
|
temp_cols = colorRampPalette(c("seagreen", "sienna3"))(30)
|
||||||
|
@ -445,7 +446,7 @@ wideP_consurf <- function(plotdf
|
||||||
# out = g1
|
# out = g1
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
############################################################################################
|
############################################################################################
|
||||||
#==============================================
|
#==============================================
|
||||||
# x-axis: geom_tiles ~ active sites and others
|
# x-axis: geom_tiles ~ active sites and others
|
||||||
#==============================================
|
#==============================================
|
||||||
|
@ -460,10 +461,12 @@ wideP_consurf <- function(plotdf
|
||||||
if (all(!is.null(active_aa_pos) &&
|
if (all(!is.null(active_aa_pos) &&
|
||||||
!is.null(aa_pos_drug) &&
|
!is.null(aa_pos_drug) &&
|
||||||
!is.null(aa_pos_lig1) && !is.null(aa_pos_lig2) && !is.null(aa_pos_lig3))) {
|
!is.null(aa_pos_lig1) && !is.null(aa_pos_lig2) && !is.null(aa_pos_lig3))) {
|
||||||
|
if (debug){
|
||||||
cat("\n\nAnnotating xvar with active, drug binding, and Lig 1&2&3 sites")
|
cat("\n\nAnnotating xvar with active, drug binding, and Lig 1&2&3 sites")
|
||||||
cat("\nCreating column colours, column name:", aa_colour_colname3)
|
cat("\nCreating column colours, column name:", aa_colour_colname3)
|
||||||
|
|
||||||
cat("\nDoing Plot with 3 ligands")
|
cat("\nDoing Plot with 3 ligands")
|
||||||
|
}
|
||||||
out = out + geom_tile(aes(,tpos3
|
out = out + geom_tile(aes(,tpos3
|
||||||
, width = tW
|
, width = tW
|
||||||
, height = tH )
|
, height = tH )
|
||||||
|
@ -483,19 +486,22 @@ wideP_consurf <- function(plotdf
|
||||||
, fill = plotdf[[aa_colour_colname1]]
|
, fill = plotdf[[aa_colour_colname1]]
|
||||||
, colour = plotdf[[aa_colour_colname1]]
|
, colour = plotdf[[aa_colour_colname1]]
|
||||||
, linetype = "solid")
|
, linetype = "solid")
|
||||||
|
if (debug){
|
||||||
cat("\nDone Plot with 3 ligands")
|
cat("\nDone Plot with 3 ligands")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#---------------------
|
#---------------------
|
||||||
# Add2plot: 2 ligands
|
# Add2plot: 2 ligands
|
||||||
#---------------------
|
#---------------------
|
||||||
if (all(!is.null(active_aa_pos) &&
|
if (all(!is.null(active_aa_pos) &&
|
||||||
!is.null(aa_pos_drug) &&
|
!is.null(aa_pos_drug) &&
|
||||||
!is.null(aa_pos_lig1) && !is.null(aa_pos_lig2) && is.null(aa_pos_lig3))) {
|
!is.null(aa_pos_lig1) && !is.null(aa_pos_lig2) && is.null(aa_pos_lig3))) {
|
||||||
|
if (debug){
|
||||||
cat("\n\nAnnotating xvar with active, drug binding, and Lig 1&2 sites")
|
cat("\n\nAnnotating xvar with active, drug binding, and Lig 1&2 sites")
|
||||||
cat("\nCreating column colours, column name:", aa_colour_colname2)
|
cat("\nCreating column colours, column name:", aa_colour_colname2)
|
||||||
|
|
||||||
cat("\nDoing Plot with 2 ligands")
|
cat("\nDoing Plot with 2 ligands")
|
||||||
|
}
|
||||||
out = out +
|
out = out +
|
||||||
geom_tile(aes(, tpos2
|
geom_tile(aes(, tpos2
|
||||||
, width = tW
|
, width = tW
|
||||||
|
@ -509,9 +515,10 @@ wideP_consurf <- function(plotdf
|
||||||
, fill = plotdf[[aa_colour_colname1]]
|
, fill = plotdf[[aa_colour_colname1]]
|
||||||
, colour = plotdf[[aa_colour_colname1]]
|
, colour = plotdf[[aa_colour_colname1]]
|
||||||
, linetype = "solid")
|
, linetype = "solid")
|
||||||
|
if (debug){
|
||||||
cat("\nDone Plot with 2 ligands")
|
cat("\nDone Plot with 2 ligands")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#---------------------
|
#---------------------
|
||||||
# Add2plot: 1 ligand
|
# Add2plot: 1 ligand
|
||||||
|
@ -519,11 +526,12 @@ wideP_consurf <- function(plotdf
|
||||||
if (all(!is.null(active_aa_pos) &&
|
if (all(!is.null(active_aa_pos) &&
|
||||||
!is.null(aa_pos_drug) &&
|
!is.null(aa_pos_drug) &&
|
||||||
!is.null(aa_pos_lig1) && is.null(aa_pos_lig2) && is.null(aa_pos_lig3))) {
|
!is.null(aa_pos_lig1) && is.null(aa_pos_lig2) && is.null(aa_pos_lig3))) {
|
||||||
|
if (debug){
|
||||||
cat("\n\nAnnotating xvar with active, drug binding, and Lig 1 sites")
|
cat("\n\nAnnotating xvar with active, drug binding, and Lig 1 sites")
|
||||||
cat("\nCreating column colours, column name:", aa_colour_colname1)
|
cat("\nCreating column colours, column name:", aa_colour_colname1)
|
||||||
|
|
||||||
cat("\nDoing Plot with 1 ligands")
|
cat("\nDoing Plot with 1 ligands")
|
||||||
|
}
|
||||||
out = out +
|
out = out +
|
||||||
geom_tile(aes(, tpos1
|
geom_tile(aes(, tpos1
|
||||||
, width = tW
|
, width = tW
|
||||||
|
@ -546,20 +554,20 @@ wideP_consurf <- function(plotdf
|
||||||
is.null(aa_pos_lig1) &&
|
is.null(aa_pos_lig1) &&
|
||||||
is.null(aa_pos_lig2) &&
|
is.null(aa_pos_lig2) &&
|
||||||
is.null(aa_pos_lig3))) {
|
is.null(aa_pos_lig3))) {
|
||||||
|
if (debug){
|
||||||
cat("\n\nAnnotating xvar with active and drug binding sites")
|
cat("\n\nAnnotating xvar with active and drug binding sites")
|
||||||
cat("\nCreating column colours, column name:", aa_colour_colname)
|
cat("\nCreating column colours, column name:", aa_colour_colname)
|
||||||
cat("\nDoing Plot with 0 ligands: active and drug site only")
|
cat("\nDoing Plot with 0 ligands: active and drug site only")
|
||||||
|
}
|
||||||
out = out + geom_tile(aes(, tpos3
|
out = out + geom_tile(aes(, tpos3
|
||||||
, width = tW
|
, width = tW
|
||||||
, height = tH)
|
, height = tH)
|
||||||
, fill = plotdf[[aa_colour_colname]]
|
, fill = plotdf[[aa_colour_colname]]
|
||||||
, colour = plotdf[[aa_colour_colname]]
|
, colour = plotdf[[aa_colour_colname]]
|
||||||
, linetype = "solid")
|
, linetype = "solid")
|
||||||
|
if (debug){
|
||||||
cat("\nDone Plot with: Active and Drug sites")
|
cat("\nDone Plot with: Active and Drug sites")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
cat("\nNo annotation for additional ligands on xvar requested")
|
cat("\nNo annotation for additional ligands on xvar requested")
|
||||||
|
@ -609,8 +617,8 @@ wideP_consurf <- function(plotdf
|
||||||
# )
|
# )
|
||||||
# }
|
# }
|
||||||
#==============================================
|
#==============================================
|
||||||
return(out2)
|
return(out2)
|
||||||
#return(out2)
|
#return(out2)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,14 +117,16 @@ LogoPlotSnps <- function(plot_df
|
||||||
|
|
||||||
if (is.matrix(tab_mt)){
|
if (is.matrix(tab_mt)){
|
||||||
cat("\nPASS: Mutant matrix successfully created..."
|
cat("\nPASS: Mutant matrix successfully created..."
|
||||||
, "\nRownames of mutant matrix:", rownames(tab_mt)
|
#, "\nRownames of mutant matrix:", rownames(tab_mt)
|
||||||
, "\nColnames of mutant matrix:", colnames(tab_mt))
|
#, "\nColnames of mutant matrix:", colnames(tab_mt)
|
||||||
|
)
|
||||||
} else{
|
} else{
|
||||||
tab_mt = as.matrix(tab_mt, rownames = T)
|
tab_mt = as.matrix(tab_mt, rownames = T)
|
||||||
if (is.matrix(tab_mt)){
|
if (is.matrix(tab_mt)){
|
||||||
cat("\nCreating mutant matrix..."
|
cat("\nCreating mutant matrix..."
|
||||||
, "\nRownames of mutant matrix:", rownames(tab_mt)
|
#, "\nRownames of mutant matrix:", rownames(tab_mt)
|
||||||
, "\nColnames of mutant matrix:", colnames(tab_mt))
|
#, "\nColnames of mutant matrix:", colnames(tab_mt)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,8 +153,9 @@ LogoPlotSnps <- function(plot_df
|
||||||
, "\nDim of wt matrix:", dim(tab_wt)
|
, "\nDim of wt matrix:", dim(tab_wt)
|
||||||
, "\nDim of mutant matrix:", dim(tab_mt)
|
, "\nDim of mutant matrix:", dim(tab_mt)
|
||||||
, "\n"
|
, "\n"
|
||||||
, "\nRownames of mutant matrix:", rownames(tab_wt)
|
#, "\nRownames of mutant matrix:", rownames(tab_wt)
|
||||||
, "\nColnames of mutant matrix:", colnames(tab_wt))
|
#, "\nColnames of mutant matrix:", colnames(tab_wt)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
######################################
|
######################################
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue