Skip to content

Commit

Permalink
submissionChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
vicsanga committed Mar 13, 2023
1 parent b6e8220 commit 7169b24
Show file tree
Hide file tree
Showing 33 changed files with 792 additions and 972 deletions.
Binary file modified Postre_app.zip
Binary file not shown.
962 changes: 481 additions & 481 deletions Postre_app/.Rhistory

Large diffs are not rendered by default.

291 changes: 22 additions & 269 deletions Postre_app/app.R

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions Postre_app/functions/aux_functions_forGraphicalSummary.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
## Auxiliar Functions developed for Graphical Summary plotting
## Maybe this functions are only valid for Inversions And Translocations Between TADs
######################################################################################
#tagEnhancersLabel #varComesFromMainEnvironment,based on if NeoTad painted to avoid overlap of enhancers text

##NOTE: To place text labels, take as reference the center point of interest,
##since the label is centered over that coordinate

paintGene_WT_TAD<-function(tad_X_cord, tad_Y_cord, nEnh_initial_left, nEnh_initial_right, gene, gene_breakp_line_type, situation, patientResults){
paintGene_WT_TAD<-function(tad_X_cord, tad_Y_cord, nEnh_initial_left, nEnh_initial_right, gene, gene_breakp_line_type, situation, patientResults, tagEnhancersLabel){
########################################################
## Function to paint GENE WT TAD Initial representation
########################################################
Expand Down Expand Up @@ -349,10 +350,10 @@ paintGene_WT_TAD<-function(tad_X_cord, tad_Y_cord, nEnh_initial_left, nEnh_initi
y=enh_y_positions,a=0.1,col="#b2d235")

#enhancers Label
#text(x=enhXpos + 0.4, y=enh_y_positions[1]-3, label="enhancers", cex = 0.8)
#text(x=enhXpos + 0.4, y=enh_y_positions[1]-3, label=tagEnhancersLabel, cex = 0.8)
boxed.labels(x=enhXpos + 0.4, y=enh_y_positions[1]-distance_Yaxis_geneLabel
-distance_Yaxis_EnhGene,
labels = "enhancers", cex=0.8,
labels = tagEnhancersLabel, cex=0.8,
border = NA, bg ="white",
xpad=1,
ypad=1 #To allow the text to breath
Expand Down Expand Up @@ -389,10 +390,10 @@ paintGene_WT_TAD<-function(tad_X_cord, tad_Y_cord, nEnh_initial_left, nEnh_initi
y=enh_y_positions,a=0.1,col="#b2d235")

#enhancers Label
#text(x=enhXpos + 0.4, y=enh_y_positions[1]-3, label="enhancers", cex = 0.8)
#text(x=enhXpos + 0.4, y=enh_y_positions[1]-3, label=tagEnhancersLabel, cex = 0.8)
boxed.labels(x=enhXpos + 0.4, y=enh_y_positions[1]-distance_Yaxis_geneLabel
-distance_Yaxis_EnhGene,
labels = "enhancers", cex=0.8,
labels = tagEnhancersLabel, cex=0.8,
border = NA, bg ="white",
xpad=1,
ypad=1 #To allow the text to breath
Expand Down Expand Up @@ -447,7 +448,7 @@ paintGene_WT_TAD<-function(tad_X_cord, tad_Y_cord, nEnh_initial_left, nEnh_initi

}

paint_Enhancer_WT_Secondary_TAD<-function(tad_X_cord, tad_Y_cord, nEnh_other_domain, geneCenter,otherDomain_breakp_line_type, situation, geneBreakP_Position_respectToTSS, patientResults){
paint_Enhancer_WT_Secondary_TAD<-function(tad_X_cord, tad_Y_cord, nEnh_other_domain, geneCenter,otherDomain_breakp_line_type, situation, geneBreakP_Position_respectToTSS, patientResults, tagEnhancersLabel){

##geneCenter needs to be known to paint the arrow orientations, towards the left or right

Expand Down Expand Up @@ -805,10 +806,10 @@ paint_Enhancer_WT_Secondary_TAD<-function(tad_X_cord, tad_Y_cord, nEnh_other_dom
y=enh_y_positions,a=0.1,col="#b2d235")

#enhancers Label
#text(x=enhXpos + 0.4, y=-3, label="enhancers", cex = 0.8)
#text(x=enhXpos + 0.4, y=-3, label=tagEnhancersLabel, cex = 0.8)
boxed.labels(x=enhXpos + 0.4, y=enh_y_positions[1]
-distance_Yaxis_EnhLabel,
labels = "enhancers", cex=0.8,
labels = tagEnhancersLabel, cex=0.8,
border = NA, bg ="white",
xpad=1,
ypad=1.1 #To allow the text to breath
Expand Down
45 changes: 22 additions & 23 deletions Postre_app/functions/graphicalSummary_generation.R
Original file line number Diff line number Diff line change
Expand Up @@ -563,19 +563,22 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){
###Creating canvas for plotting
yAxisLim<-c(-50,30)

##tagEnhancersLabel to avoid enhancershancers when neoTAD painting, to avoid overlap

tagEnhancersLabel<-"enhancers"

##Defining xAxis Width
if((gene_mechanism == "LongRange_geneDuplication") && (SV_landing == "InterTAD")){
if(((gene_mechanism == "LongRange_geneDuplication") || (gene_mechanism == "Direct_LongRange_geneDuplication") ) && (SV_landing == "InterTAD")){
##xAxiss wider if NEO TAD because a third tad will be painted
##Usar un lienzo mas grande, due to NEO-TAD situation
xAxisLim<-c(-15,55)
tagEnhancersLabel<-"Enh."

}else{
xAxisLim<-c(0,40)
}




yPos_chr_WT<-13 ##variable to hold the position of the chr text in the WT situation in the Y axis

##Adjust image, to exclude spaces outside canvas (drawing area)
Expand Down Expand Up @@ -652,7 +655,7 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){
gene = gene,
gene_breakp_line_type = gene_breakp_line_type,
situation = situation,
patientResults = patientResults)
patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel)

geneCenter<-info_drawingGENE_TAD$geneCenter

Expand All @@ -676,7 +679,7 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){
otherDomain_breakp_line_type = otherDomain_breakp_line_type,
situation = situation,
geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS,
patientResults = patientResults)
patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel)

}else if(situation == "primaryTAD_Dextral"){
########################
Expand All @@ -696,7 +699,7 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){
gene = gene,
gene_breakp_line_type = gene_breakp_line_type,
situation = situation,
patientResults = patientResults)
patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel)

geneCenter<-info_drawingGENE_TAD$geneCenter

Expand All @@ -721,7 +724,7 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){
otherDomain_breakp_line_type = otherDomain_breakp_line_type,
situation = situation,
geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS,
patientResults = patientResults)
patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel)
}

}else if(situation == "primaryTAD_Central"){
Expand Down Expand Up @@ -751,7 +754,7 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){
gene = gene,
gene_breakp_line_type = gene_breakp_line_type,
situation = situation,
patientResults = patientResults)
patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel)

geneCenter<-info_drawingGENE_TAD$geneCenter

Expand Down Expand Up @@ -828,7 +831,7 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){
tad_XCoord_OnLeftSide = tad_XCoord_OnLeftSide,
tad_XCoord_OnRightSide = tad_XCoord_OnRightSide,
tad_YCoord_Rearrangements = tad_YCoord_Rearrangements,
geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS)
geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS, tagEnhancersLabel = tagEnhancersLabel)

#Paint SecondaryTAD SV re-arranged
#The one where the gene of interest is not located
Expand All @@ -846,7 +849,7 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){
tad_XCoord_OnLeftSide = tad_XCoord_OnLeftSide,
tad_XCoord_OnRightSide = tad_XCoord_OnRightSide,
tad_YCoord_Rearrangements = tad_YCoord_Rearrangements,
infoDrawing_gene_sv_tad = infoDrawing_gene_sv_tad)
infoDrawing_gene_sv_tad = infoDrawing_gene_sv_tad, tagEnhancersLabel = tagEnhancersLabel)

}else if(sv_type=="Deletion"){
##For Deletions, by long-range... so TAD disrupted... in any case intraTAD or betweenTADs only one TAD painted
Expand All @@ -863,7 +866,7 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){
info_drawingSecondaryTAD = info_drawingSecondaryTAD,
tad_X_cord = tad_XCoord_OnCenter ,
tad_YCoord_Rearrangements = tad_YCoord_Rearrangements,
geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS)
geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS, tagEnhancersLabel = tagEnhancersLabel)

}else if(sv_type == "Duplication"){

Expand Down Expand Up @@ -900,7 +903,7 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){
tad_X_cord = tad_XCoord_OnCenter ,
tad_YCoord_Rearrangements = tad_YCoord_Rearrangements,
geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS,
patientResults = patientResults)
patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel)

}else{
##Error, no concibo esta situacion ahora mismo
Expand All @@ -910,7 +913,7 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){


}
}else if(gene_mechanism == "LongRange_geneDuplication"){
}else if((gene_mechanism == "LongRange_geneDuplication") || (gene_mechanism == "Direct_LongRange_geneDuplication")){
##Here it either can occur, NeoTAD if SV interTAD or be intraTAD, but for sure gene Duplicated
##So two genes need to be painted

Expand Down Expand Up @@ -960,7 +963,7 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){
gene = gene,
gene_breakp_line_type = gene_breakp_line_type,
situation = situation,
patientResults = patientResults)
patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel)

geneCenter<-info_drawingGENE_TAD$geneCenter

Expand All @@ -982,7 +985,7 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){
otherDomain_breakp_line_type = otherDomain_breakp_line_type,
situation = situation,
geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS,
patientResults = patientResults)
patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel)

}else if(situation == "primaryTAD_Dextral"){
########################
Expand All @@ -1003,7 +1006,7 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){
gene = gene,
gene_breakp_line_type = gene_breakp_line_type,
situation = situation,
patientResults = patientResults)
patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel)

geneCenter<-info_drawingGENE_TAD$geneCenter

Expand All @@ -1026,7 +1029,7 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){
otherDomain_breakp_line_type = otherDomain_breakp_line_type,
situation = situation,
geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS,
patientResults = patientResults)
patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel)
}

########################
Expand All @@ -1045,7 +1048,7 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){
info_drawingSecondaryTAD = info_drawingSecondaryTAD,
tad_X_cord = tad_XCoord_OnCenter ,
tad_YCoord_Rearrangements = tad_YCoord_Rearrangements,
geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS)
geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS, tagEnhancersLabel = tagEnhancersLabel)



Expand All @@ -1059,13 +1062,9 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){



}else if((gene_mechanism == "Direct_geneDuplication") || (gene_mechanism == "Direct_LongRange_geneDuplication")){
}else if(gene_mechanism == "Direct_geneDuplication"){
##We paint two times only the gene, and enough...

##Direc_LongRange_geneDuplication
##Means that equal likely that upreg by enh dup, that by gene expression...This is sth tricky
##If this is the case, just paint the gene duplicated

paint_Gene_Duplicated(gene = gene,
xAxisLim = xAxisLim,
tad_X_cord = tad_XCoord_OnCenter,
Expand Down
25 changes: 24 additions & 1 deletion Postre_app/functions/heatmap_SummaryResults.R
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ heatmap_summaryResults<-function(patientResults, minRequiredScore, highScore){
##I'm going to apply same style as for heatmap numbers collapsible sections, so we are going to repeat the button classes
##And so on because we want them to look the same

##Adding heatmap numbers section
##Adding SV considered information
whole_html<-paste(whole_html,
"<div class='numbersHeatmap'>",
##The first class, collapsible_subsectionMainResults a secas, es para el estilo del boton, la segunda ,que integra el fenotipo para el responsiveness
Expand All @@ -601,10 +601,33 @@ heatmap_summaryResults<-function(patientResults, minRequiredScore, highScore){
patientInfo_html,
"</div>",
"</div>",
"<br>",
sep="",
collapse="")


##Adding Info for each of the cell types or tissues considered
whole_html<-paste(whole_html,
"<div class='numbersHeatmap'>",
##The first class, collapsible_subsectionMainResults a secas, es para el estilo del boton, la segunda ,que integra el fenotipo para el responsiveness
"<button type='button' class='collapsible_subsectionMainResults collapsible_subsectionMainResults_",
patientResults$patientInfo$Phenotype,
"'>",
"<span style='font-size:22px'>Cell Types/Tissues considered per Phenotype</span>",
"</button>",
"<div class='content_subsectionMainResults'>",
"If you want to know more about the different cell types/tissues considered for each phenotype, check the
<a href='Supplementary_Data_1.html' target='_blank'> Cell types/tissues per phenotype File </a>.",
"</div>",
"</div>",
"<br>",
sep="",
collapse="")





##########################################
## Creating gene-phase report section
##########################################
Expand Down
Loading

0 comments on commit 7169b24

Please sign in to comment.