diff --git a/Postre_app.zip b/Postre_app.zip index 4b09d75..f4ec443 100644 Binary files a/Postre_app.zip and b/Postre_app.zip differ diff --git a/Postre_app/app.R b/Postre_app/app.R index f4cbfba..b9e52a5 100644 --- a/Postre_app/app.R +++ b/Postre_app/app.R @@ -803,6 +803,7 @@ server <- function(input, output, session){ } ##If there is an error the following instruction will not be terminated + # browser() patientResults_singlePhenoPrediction<-masterWrapperSinglePrediction(patientInfo = patientData , minScore = minScore, highScore = highScore, runMode = runMode_single, user_tadMapInfo = user_tadMapInfo, diff --git a/Postre_app/functions/aux_functions_forGraphicalSummary.R b/Postre_app/functions/aux_functions_forGraphicalSummary.R index 128f123..2b8fbcc 100644 --- a/Postre_app/functions/aux_functions_forGraphicalSummary.R +++ b/Postre_app/functions/aux_functions_forGraphicalSummary.R @@ -924,7 +924,319 @@ paint_SV_labels<-function(sv_type, xAxisLim, yAxisPos){ } +paintGene_WT_TAD_intraTADdupWithEnh<-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 + ######################################################## + + + enh_y_positions<-rep.int(x=tad_Y_cord[1], times = 4) + + ## Let's mantain color codes by TAD position + ## If TAD is on the left blue or whatever we choos 1, if it is on the right orange or whatever we choose 2 + ## Regardless whether it is the gene or the secondary domain TAD + ## In order not to confound the user if > 1 gene is affected + ##For central tads... all of them paint in kind of orange... not to confound...consider for future + if(situation == "primaryTAD_Central"){ + colorTAD<-"#9999ff" + }else if(tad_X_cord[1]<20){ + colorTAD<-"#acdfeb" ##originally blueish + }else if(tad_X_cord[1]>20){ + colorTAD<-"#e5edb2" ##oranginally orangeish + } + + + ##Painting TAD + polygon(tad_X_cord, tad_Y_cord, col = colorTAD, border = "#ffffff") + + ##Defining some gene features required to plot it + #And for other calculations of breakpoint and enhs locations + x_space<-c(tad_X_cord[1],tad_X_cord[2]) + + x_space_start<-x_space[1] + x_space_end<-x_space[2] + + #gene position at the center -0.5 (since we provide the left coord over which the gene is painted) + genePos<-(x_space_start + (x_space_end-x_space_start)/2)-0.5##o coger el centro del TAD con TAD3 y restarle 0.5 ya que mide 1 + + #genePos<-tad_X_cord[1]+4.5 + geneSize<-1 + geneCenter<-genePos + geneSize/2 + gene_X_cord<-c(genePos, genePos+geneSize, genePos+geneSize, genePos) + gene_Y_cord<-c(tad_Y_cord[1]-1,tad_Y_cord[1]-1,tad_Y_cord[1]+1,tad_Y_cord[1]+1) + + + ######################################### + ## Defining coordinates breakpoint line + ## And additional relevant variables + ######################################### + enhNumbersSize<-0.8 + + distanceBreakpFromGene<-0.3 ##Distance breakpoint from the gene, when the breakpoint is between the gene & enh + + distanceEnhFromGene<-1.5 ##Distance between the enhancers and the gene + + distanceBreakpFromEnh<-0.3 ##Distance breakpoint from enhancers when the breakpoint located between enh and TAD border + + sizeEnhRegion<-1##Touching this will not really affect enh size, because created regardless of this + + distance_Yaxis_geneLabel<-2 + distance_Yaxis_EnhGene<-2 + distance_Yaxis_EnhLabel_EnhNumber<-1.3 + + ############## + ## I think I do not need the primary TAD info situation + + ##Important to have in mind the TAD info situation if it is tad central... we paint two breakpoints there + + if(situation == "primaryTAD_Central"){ + ########################################################################### + ## ONE TAD IS GOING TO BE PAINTED, so in the current TAD representation + ## TWO BREAKPOINTS will be displayed + ## It is due to the fact that both ,or none, breakpoint directly touch the TAD + ## This is going to occur for Deletions And Duplications + ########################################################################### + + breakPos<-c(0,0) + + ##Defining left coord + if(gene_breakp_line_type$LeftBreakp=="beforeTSS_duplic_all"){ + + breakPos[1]<-genePos-distanceEnhFromGene-distanceBreakpFromEnh ##Just Before Enhancers + + }else if(gene_breakp_line_type$LeftBreakp=="beforeTSS_duplic_some"){ + + breakPos[1]<-genePos-distanceEnhFromGene+0.5 ##In the middle of Enh + + }else if(gene_breakp_line_type$LeftBreakp=="beforeTSS_duplic_none"){ + + breakPos[1]<-genePos - distanceBreakpFromGene + + } + + #Defining right coord + + if(gene_breakp_line_type$RightBreakp=="afterTSS_duplic_all"){ + + breakPos[2]<-genePos + distanceEnhFromGene + sizeEnhRegion + distanceBreakpFromEnh##After Enh + + }else if(gene_breakp_line_type$RightBreakp=="afterTSS_duplic_some"){ + breakPos[2]<-genePos + distanceEnhFromGene + sizeEnhRegion/2 ##In the middle of Enh + + }else if(gene_breakp_line_type$RightBreakp=="afterTSS_duplic_none"){ + + breakPos[2]<-gene_X_cord[2] + distanceBreakpFromGene ##Before Enh + + } + + } + + ######################### + ##Painting breakpoint/s + ######################### + nIterations<-0##labels only painted on the last iteration + for(targetBreakpoint in breakPos){ + #print(targetBreakpoint) + nIterations<-nIterations + 1 + + ##Defining Breakpoint position + breakp_x_coord<-c(targetBreakpoint, targetBreakpoint)##Tad central point for gene broken + breakp_y_coord<-c(tad_Y_cord[1]-7, tad_Y_cord[3]+3) + + ############################ + ##Painting Breakpoint LINES + breakpointColor<-"brown3" + lines(x=breakp_x_coord, + y=breakp_y_coord, + col=breakpointColor, + lwd=2, + lty=3) + + ################################# + ## Painting breakpoint Labels + if(nIterations==length(breakPos)){ + ##So we are on the last iteration, let's paint the LABELS + ############################ + ##Painting breakpoint labels + ############################# + #If they are >1 & super close, paint just "Breakpoints", in the middle of the breakpoints space + if(length(breakPos)>1){ + if(abs(breakPos[2]-breakPos[1])<5){ + + ##Using min() because smaller coord can be on any pos + breakLabelPosition<-(min(breakPos)+abs(breakPos[2]-breakPos[1])/2) ##Midpoint breakpoint lines + + #Breakpoint label + ##Boxed labels: xpad,ypad arguments, used to expand the box beyond the text + boxed.labels(x=breakLabelPosition, y=breakp_y_coord[1] - 1,labels = "Breakpoints", cex=0.8, border = NA, bg ="white", + xpad=1, + ypad=2, ##To allow the text to breathe + col=breakpointColor + ) + + }else{ + ##Paint both labels + for(targetBreakpoint in breakPos){ + ##Defining Breakpoint position + breakp_y_coord<-c(tad_Y_cord[1]-7, tad_Y_cord[3]+3) + + boxed.labels(x=targetBreakpoint, y=breakp_y_coord[1] - 1,labels = "Breakpoint", cex=0.8, border = NA, bg ="white", + xpad=1, + ypad=2, ##To allow the text to breathe + col=breakpointColor + ) + } + } + }else if(length(breakPos)==1){ + ## JUST ONE BREAKPOINT PAINTED. + #Breakpoint label + ##Boxed labels: xpad,ypad arguments, used to expand the box beyond the text + boxed.labels(x=targetBreakpoint, y=breakp_y_coord[1] - 1,labels = "Breakpoint", cex=0.8, border = NA, bg ="white", + xpad=1, + ypad=2, ##To allow the text to breathe + col=breakpointColor + ) + } + } + + } + + #TAD label + # text(x=tad_X_cord[3], y=tad_Y_cord[1]+10, label="TAD", cex = 1.5) + boxed.labels(x=tad_X_cord[3], y=tad_Y_cord[1]+10,labels = "TAD", cex=1.5, + border = NA, bg =NA, xpad=1, ypad = 2 ) + + ###Adding black line below TAD + lines(x = c(tad_X_cord[1]-3,tad_X_cord[2]+3), + y=c(tad_Y_cord[1],tad_Y_cord[1]), + col="black", lwd=2, lty=1) + + + ################### + #Adding gene body + polygon(gene_X_cord, gene_Y_cord, col = "#0e3d61") + + #gene Label + ##I want it to overlay the breakpoint line + # https://stackoverflow.com/questions/45366243/text-labels-with-background-colour-in-r + boxed.labels(x=tad_X_cord[3], y=tad_Y_cord[1]-distance_Yaxis_geneLabel, + labels = gene, cex=0.8, border = NA, bg ="white", + xpad=1, + ypad=2##To allow the text to breathe + ) + # text(x=tad_X_cord[3], y=tad_Y_cord[1]-2, label=gene, cex = 0.8) + + ##Adding enhancers + + ############################## + ####To the Right side gene Position + if(nEnh_initial_right>0){ + ##So there is at least 1 enh + enhXpos<-genePos+distanceEnhFromGene##left margin of the enh cluster + enh_x_positions<-c(enhXpos,enhXpos+0.3,enhXpos+0.6, enhXpos+0.9) + + draw.ellipse(x=enh_x_positions, + y=enh_y_positions,a=0.1,col="#b2d235") + + #enhancers Label + #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 = tagEnhancersLabel, cex=0.8, + border = NA, bg ="white", + xpad=1, + ypad=1 #To allow the text to breath + ) + #Nr of enhancers + #text(x=enhXpos + 0.4, y=enh_y_positions[1]-4, label=paste0("n=",nEnh_initial_right), cex=enhNumbersSize) + boxed.labels(x=enhXpos + 0.4, y=enh_y_positions[1]-distance_Yaxis_geneLabel + -distance_Yaxis_EnhGene + -distance_Yaxis_EnhLabel_EnhNumber, + labels = paste0("n=",nEnh_initial_right), cex=enhNumbersSize, + border = NA, bg ="white", + xpad=1, + ypad=1 #To allow the text to breath + ) + + ##enhancers horizontal line over them + lines(x = c(enh_x_positions[1]-0.1, + enh_x_positions[length(enh_x_positions)]+0.1), + y = c(enh_y_positions[1] + 2,enh_y_positions[1] + 2), + lwd=1.5) + + curvedarrow(from = c(enhXpos+0.5,enh_y_positions[1]+2), to = c(geneCenter#+0.25 + ,enh_y_positions[1]+2), + arr.pos = 0, arr.type="T", arr.col = "black")##before angle=40 + } + + ############################# + ####To the Left side gene Position + if(nEnh_initial_left>0){ + enhXpos<-genePos-distanceEnhFromGene##left margin of the enh cluster + enh_x_positions<-c(enhXpos,enhXpos+0.3,enhXpos+0.6, enhXpos+0.9) + + draw.ellipse(x=enh_x_positions, + y=enh_y_positions,a=0.1,col="#b2d235") + + #enhancers Label + #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 = tagEnhancersLabel, cex=0.8, + border = NA, bg ="white", + xpad=1, + ypad=1 #To allow the text to breath + ) + + #Nr of enhancers + #text(x=enhXpos + 0.4, y=enh_y_positions[1]-4, label=paste0("n=",nEnh_initial_left), cex=enhNumbersSize) + boxed.labels(x=enhXpos + 0.4, y=enh_y_positions[1]-distance_Yaxis_geneLabel + -distance_Yaxis_EnhGene + -distance_Yaxis_EnhLabel_EnhNumber, + labels = paste0("n=",nEnh_initial_left), cex=enhNumbersSize, + border = NA, bg ="white", + xpad=1, + ypad=1 #To allow the text to breath + ) + + ##enhancers horizontal line over them + lines(x = c(enh_x_positions[1]-0.1, + enh_x_positions[length(enh_x_positions)]+0.1), + y = c(enh_y_positions[1]+2,enh_y_positions[1]+2), + lwd=1.5) + + ##arr type in T shape and in 0 pos to be placed at the beginning and hence hidden + #we will color afterwards a triangle over the gene, to deal with an external function bug + curvedarrow(from = c(enhXpos+0.5,enh_y_positions[1]+2), to = c(geneCenter #-0.25 + ,enh_y_positions[1]+2), + arr.pos = 0, arr.type="T", curve = -1, arr.col = "black" ) + + } + + ################################################################################## + ##Adding Triangle Shape over gene, if it has any enh, to represent the arrow end + ################################################################################## + if((nEnh_initial_left>0)|| (nEnh_initial_right>0)){ + triangle_X_Coord<-c(geneCenter-0.3, geneCenter, geneCenter+0.3) + heightOrizontalLineEnh<-enh_y_positions[1]+2 + triangle_Y_Coord<-c(heightOrizontalLineEnh+0.3, heightOrizontalLineEnh-0.2, heightOrizontalLineEnh+0.3) + polygon(triangle_X_Coord, triangle_Y_Coord, col = "black", border = "black") + } + + + + ################################################## + ## Assembling relevant info from paintGene_WT_TAD + ################################################## + info_drawing<-list("geneCenter"=geneCenter, ##geneCenterPosition is important to know row orientation of enhancer arrow secondary TAD + "geneTAD_breakP"=breakPos, + "genePos"=genePos) + + + return(info_drawing) + +} diff --git a/Postre_app/functions/graphicalSummary_generation.R b/Postre_app/functions/graphicalSummary_generation.R index 45675e5..15c017d 100644 --- a/Postre_app/functions/graphicalSummary_generation.R +++ b/Postre_app/functions/graphicalSummary_generation.R @@ -212,6 +212,15 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){ geneBreakP_Position_respectToTSS <-"afterTSS" } + }else if((gene_mechanism=="LongRange_geneDuplication") || (gene_mechanism=="Direct_LongRange_geneDuplication")){ + ##It is predicted in intra TAD SV a longRange_geneDuplication + ##Basically the gene is active and gets duplicated with some enhancers + ##But the gene is duplicated inside of the TAD, and based on the algorithm the gene has to be active + # Bec gene_breakpoint == "Break1&2" + ##So just paint the gene as duplicated + + gene_breakp_line_type<-"surroundingGene" + }else{ ##Just generating this variable to avoid missing variable errors ##On function call eventhough won't be used @@ -427,46 +436,107 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){ ################################################################################ ##Duplications have their own kind of particularities so let's treat them a part ################################################################################ - + ##Focusing on duplic that enh can be triggering the disease if((gene_mechanism == "LongRange") || ##In this case the gene is not duplicated (gene_mechanism == "LongRange_geneDuplication") || (gene_mechanism =="Direct_LongRange_geneDuplication")){ - ################################################################## - ## IMPORTANT PARTICULARITIE. "Kept" tracks cognate enhancers - ## So if nkept > intial is because some of the initial duplicated - if(geneBreakP_Position_respectToTSS=="afterTSS"){ - ##It implies the breakpoint is after the TSS (bigger position): - ##Check n enh kept on the right + + if(((gene_mechanism == "LongRange_geneDuplication") || (gene_mechanism =="Direct_LongRange_geneDuplication")) && (SV_landing == "IntraTAD")){ + + + ##It means, okey, THE GENE IS DUPLICATED AND some enhancers are duplicated surrounding the gene, + #And it has been predicted a pathomech where enh could contribute... bec they are dupl + #but the gene is active since it is a pathogenically predicted intra TAD SV by GOF + #So only plot the gene duplicated, keep it simple for now + ##FUTURE, IMPROVE THIS PLOT + + ###For Now: + ## Set n enhnacers initial and in the other TAD to 0 + ## If gene pathogenic effect by Direct Gene Truncation we do not care about enhancers + ##So not painting them in the plot (achieved by enh = 0) + ##But if in future we predict fusion transcripts... should be painted if that is the prediction + # nEnh_initial_left + # nEnh_initial_right + # nEnh_other_domain + # + # nEnh_kept_left + # nEnh_kept_right + # nEnh_gained + + ##nEnhGained refers to ectopic enh, and this is an IntraTAD SV + #So ignore + ################################################################## + ## IMPORTANT PARTICULARITIE. "Kept" tracks cognate enhancers + ## So if nkept > intial is because some of the initial duplicated + + gene_breakp_line_type<-list() + + ##Tener en cuenta ambos breakpoints + ##For left breakp + if(nEnh_kept_left == nEnh_initial_left ){ + ##for now, does not matter wheter it had initially or not + gene_breakp_line_type$LeftBreakp<-"beforeTSS_duplic_none"##we will put the line between gene and enh + + }else if(nEnh_kept_left == 2*nEnh_initial_left){ + gene_breakp_line_type$LeftBreakp<-"beforeTSS_duplic_all"##all enhancer on that side duplicated + + }else if(nEnh_kept_left > nEnh_initial_left){ + gene_breakp_line_type$LeftBreakp<-"beforeTSS_duplic_some" ##we will put the line between enh + } + + ##For right Breakpoint if(nEnh_kept_right == nEnh_initial_right){ ##for now, does not matter wheter it had initially or not - gene_breakp_line_type<-"afterTSS_duplic_none"##we will put the line between gene and enh + gene_breakp_line_type$RightBreakp<-"afterTSS_duplic_none"##we will put the line between gene and enh }else if(nEnh_kept_right == 2*nEnh_initial_right ){ - gene_breakp_line_type<-"afterTSS_duplic_all" + gene_breakp_line_type$RightBreakp<-"afterTSS_duplic_all" }else if(nEnh_kept_right > nEnh_initial_right){ - gene_breakp_line_type<-"afterTSS_duplic_some" ##we will put the line between enh + gene_breakp_line_type$RightBreakp<-"afterTSS_duplic_some" ##we will put the line between enh } - }else if(geneBreakP_Position_respectToTSS=="beforeTSS"){ - ##It implies the breakpoint is before the TSS (smaller position): - ##Check nEnh kept on the left - if(nEnh_kept_left == nEnh_initial_left ){ - ##for now, does not matter wheter it had initially or not - gene_breakp_line_type<-"beforeTSS_duplic_none"##we will put the line between gene and enh + }else{ + ################################################################## + ## IMPORTANT PARTICULARITIE. "Kept" tracks cognate enhancers + ## So if nkept > intial is because some of the initial duplicated + + if(geneBreakP_Position_respectToTSS=="afterTSS"){ + ##It implies the breakpoint is after the TSS (bigger position): + ##Check n enh kept on the right + if(nEnh_kept_right == nEnh_initial_right){ + ##for now, does not matter wheter it had initially or not + gene_breakp_line_type<-"afterTSS_duplic_none"##we will put the line between gene and enh + + }else if(nEnh_kept_right == 2*nEnh_initial_right ){ + gene_breakp_line_type<-"afterTSS_duplic_all" + + }else if(nEnh_kept_right > nEnh_initial_right){ + gene_breakp_line_type<-"afterTSS_duplic_some" ##we will put the line between enh + } - }else if(nEnh_kept_left == 2*nEnh_initial_left){ - gene_breakp_line_type<-"beforeTSS_duplic_all"##all enhancer on that side duplicated + }else if(geneBreakP_Position_respectToTSS=="beforeTSS"){ + ##It implies the breakpoint is before the TSS (smaller position): + ##Check nEnh kept on the left + if(nEnh_kept_left == nEnh_initial_left ){ + ##for now, does not matter wheter it had initially or not + gene_breakp_line_type<-"beforeTSS_duplic_none"##we will put the line between gene and enh + + }else if(nEnh_kept_left == 2*nEnh_initial_left){ + gene_breakp_line_type<-"beforeTSS_duplic_all"##all enhancer on that side duplicated + + }else if(nEnh_kept_left > nEnh_initial_left){ + gene_breakp_line_type<-"beforeTSS_duplic_some" ##we will put the line between enh + } - }else if(nEnh_kept_left > nEnh_initial_left){ - gene_breakp_line_type<-"beforeTSS_duplic_some" ##we will put the line between enh } - } + + } else if(gene_mechanism == "Direct_geneDuplication"){ ############################ # For DIRECT GENE DUPLICATIONS @@ -542,6 +612,7 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){ ##So track it on the list of Not, main candidates if(gene_breakpoint != "NotClear_BreakpointAssociation"){ + ##So we generate graphical Abstract ##We will see what to do with NotClear_BreakpointAssociation, but for now skip to avoid crash ########### @@ -551,399 +622,96 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){ ##outpPath<-"graphicalSummaries/" fullOutpPath<-paste0(outpPath, gene,"_",targetMech, "_", phase,"_", patientResults$job_UniCode, ".png") - ############################# - ## Loading auxiliar functions for plotting - ##source("functions/aux_functions_forGraphicalSummary.R") - - #################################### - ##png with maximum resolution 300dpi - png(filename = fullOutpPath, width = 12, height = 8, units = "in", res = 300 ) - ##x11() - ########################################## - ###Creating canvas for plotting - yAxisLim<-c(-50,30) + - ##tagEnhancersLabel to avoid enhancershancers when neoTAD painting, to avoid overlap - tagEnhancersLabel<-"enhancers" + + ##Do a try catch, If i get an error, just PLOT + ##Error on graphical abstract generation. Pq esto va a generar bastantes crasheos - ##Defining xAxis Width - 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." + tryCatch({ - }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) - par(mar = c(0,0,0,0)) - - #When I want to se the axis, uncomment the 3 following lines - # plot(x=1:2, y=1:2, type="n", - # ylim=yAxisLim, - # xlim=xAxisLim) - - ##OPTION REMOVING AXIS - #UPON COMPLETION USING THIS - plot(x=0:20, y=0:20, type = "n", - ylim = yAxisLim, - xlim = xAxisLim, - xaxt = 'n', yaxt = 'n', bty = 'n', pch = '', ylab = '', xlab = '') ##Upon completion, REMOVE AXIS - - ############################################################################## - ############################################################################## - - texSizeChr<-2 - # enhNumbersSize<-1##Some variables for text sizes - - #Adding plot header - text(x=20, y=30, label=paste0("Graphical summary of ", gene, " regulatory domain in ", phase), cex = 1.7) - - text(x=20,y=26, label="Simplification",cex=1.7) - - #WT allelle label - text(x=20, y=20, label="Control Scenario", cex = 1.5) - - - ##Check whether the current Gene gene regulatory domain is disrupted or not (it can occur for deletions or duplications) - ##If the TAD gene is entirely deleted or duplicated, between the affected ones - ##We will know that this is occurring if the gene_breakpoint takes the value<-"No_AssociatedBreakpoint" - ##Still pendent to take into account if value: "NotClear_BreakpointAssociation" - - ##Again important to check whether gene regulatory domain altered or not - #Info derived from gene breakpoint - ##gene_regulatoryDomain_altered##TRUE OR FALSE - ##situation "primaryTAD_Central" means we only paint one tad in the middle cause it is not disrupted - - ##Coord for tads over X axis (Depending on the situation either two TADs or just one will be painted) - #Let's try make them wider two cm per side to ensure everything fits on the re-arrangement plots - tad_XCoord_OnLeftSide<-c(3,17,10)#c(5,15,10) ##c(3,17,10) - tad_XCoord_OnRightSide<-c(tad_XCoord_OnLeftSide[1]+10+11, - tad_XCoord_OnLeftSide[2]+10+11, - tad_XCoord_OnLeftSide[3]+10+11) - tad_XCoord_OnCenter<-c(13,27,20) - - #Over Y axis, WT line - tad_YCoord_WildTypeLine<-c(0,0,15) - - - - if(situation %in% c("primaryTAD_Sinistral", "primaryTAD_Dextral")){ - ##So we paint two TADs cause gene breakpoint disrupts its regulatory domain, and re-shuffles it with another + #################################### + ##png with maximum resolution 300dpi + png(filename = fullOutpPath, width = 12, height = 8, units = "in", res = 300 ) - if(situation =="primaryTAD_Sinistral"){ - ######################## - ## PAINTING GENE-TAD ### - ## on the left side - ######################## - - text(x=5, y=yPos_chr_WT, label=chr_gene, cex = texSizeChr) - - ##Creating TAD to represente gene WT scenario - - tad_X_cord<-tad_XCoord_OnLeftSide ##c(5,15,10) - info_drawingGENE_TAD<-paintGene_WT_TAD(tad_X_cord = tad_X_cord, - tad_Y_cord = tad_YCoord_WildTypeLine, - nEnh_initial_left = nEnh_initial_left, - nEnh_initial_right = nEnh_initial_right, - gene = gene, - gene_breakp_line_type = gene_breakp_line_type, - situation = situation, - patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel) - - geneCenter<-info_drawingGENE_TAD$geneCenter - - # ##Adding interTAD dotted lines - # paintInterTAD_WT_lines(tad_X_cord = c(5,15,10)) - - ################################################ - ## PAINTING SECONDARY//OTHER AFFECTED DOMAIN ### - ## on the right side - ################################################ - text(x=26, y=yPos_chr_WT, label=chr_oppositeDomain, cex = texSizeChr) - ##Creating TAD to represente gene WT scenario - tad_X_cord<-tad_XCoord_OnRightSide - tad_Y_cord<-tad_YCoord_WildTypeLine - ##Info returned used to represent the rearrangement - - info_drawingSecondaryTAD<-paint_Enhancer_WT_Secondary_TAD(tad_X_cord = tad_X_cord, - tad_Y_cord = tad_YCoord_WildTypeLine, - nEnh_other_domain = nEnh_other_domain, - geneCenter = geneCenter, - otherDomain_breakp_line_type = otherDomain_breakp_line_type, - situation = situation, - geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS, - patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel) - - }else if(situation == "primaryTAD_Dextral"){ - ######################## - ## PAINTING GENE-TAD ### - ## on the Right Side side - ######################## - - text(x=26, y=yPos_chr_WT, label=chr_gene, cex = texSizeChr) - - ##Creating TAD to represente gene WT scenario - tad_X_cord<-tad_XCoord_OnRightSide##c(5+10+11,15+10+11,10+10+11) - ##Info returned used to represent the rearrangement - info_drawingGENE_TAD<-paintGene_WT_TAD(tad_X_cord = tad_X_cord, - tad_Y_cord = tad_YCoord_WildTypeLine, - nEnh_initial_left = nEnh_initial_left, - nEnh_initial_right = nEnh_initial_right, - gene = gene, - gene_breakp_line_type = gene_breakp_line_type, - situation = situation, - patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel) - - geneCenter<-info_drawingGENE_TAD$geneCenter - - # ##Adding interTAD dotted lines - # paintInterTAD_WT_lines(tad_X_cord = c(5,15,10)) - - ################################################ - ## PAINTING SECONDARY//OTHER AFFECTED DOMAIN ### - ## on the LEFT side - ################################################ - text(x=5, y=yPos_chr_WT, label=chr_oppositeDomain, cex = texSizeChr) - ##Creating TAD to represente gene WT scenario - tad_X_cord<-tad_XCoord_OnLeftSide - tad_Y_cord<-tad_YCoord_WildTypeLine - - ##Info returned used to represent the rearrangement + ########################################## + ###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") || (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." - info_drawingSecondaryTAD<-paint_Enhancer_WT_Secondary_TAD(tad_X_cord = tad_X_cord, - tad_Y_cord = tad_YCoord_WildTypeLine, - nEnh_other_domain = nEnh_other_domain, - geneCenter = geneCenter, - otherDomain_breakp_line_type = otherDomain_breakp_line_type, - situation = situation, - geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS, - patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel) + }else{ + xAxisLim<-c(0,40) } - }else if(situation == "primaryTAD_Central"){ - ##So either the breakpoint falls in a different TAD, and this TAD is either duplicated or deleted entirely - ##Or both breakpoint fall inside of the same TAD - ##In any case, breakpoints do not affect its boundaries - ##So paint it in the center - ##With breakpoints flanking theTAD upon a certain distance - ##source("functions/aux_functions_forGraphicalSummary.R") + yPos_chr_WT<-13 ##variable to hold the position of the chr text in the WT situation in the Y axis - ######################## - ## PAINTING GENE-TAD ### - ## on the Center (Only one TAD painted) - ######################## + ##Adjust image, to exclude spaces outside canvas (drawing area) + par(mar = c(0,0,0,0)) - text(x=tad_XCoord_OnCenter[1]+2, y=yPos_chr_WT, label=chr_gene, cex = texSizeChr) + #When I want to se the axis, uncomment the 3 following lines + # plot(x=1:2, y=1:2, type="n", + # ylim=yAxisLim, + # xlim=xAxisLim) - ##Creating TAD to represente gene WT scenario + ##OPTION REMOVING AXIS + #UPON COMPLETION USING THIS + plot(x=0:20, y=0:20, type = "n", + ylim = yAxisLim, + xlim = xAxisLim, + xaxt = 'n', yaxt = 'n', bty = 'n', pch = '', ylab = '', xlab = '') ##Upon completion, REMOVE AXIS - tad_X_cord<-tad_XCoord_OnCenter + ############################################################################## + ############################################################################## - info_drawingGENE_TAD<-paintGene_WT_TAD(tad_X_cord = tad_X_cord, - tad_Y_cord = tad_YCoord_WildTypeLine, - nEnh_initial_left = nEnh_initial_left, - nEnh_initial_right = nEnh_initial_right, - gene = gene, - gene_breakp_line_type = gene_breakp_line_type, - situation = situation, - patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel) + texSizeChr<-2 + # enhNumbersSize<-1##Some variables for text sizes - geneCenter<-info_drawingGENE_TAD$geneCenter + #Adding plot header + text(x=20, y=30, label=paste0("Graphical summary of ", gene, " regulatory domain in ", phase), cex = 1.7) - } - - - ########################### - ## Adding Label SV type - ########################### - ##source("functions/aux_functions_forGraphicalSummary.R") - paint_SV_labels(sv_type = sv_type, xAxisLim = xAxisLim, yAxisPos = -12.5) - - ############################## - ###Paint interTad arrows - ############################## - - ##Avoid if is translocation - ##For now remove, too noisy - # if(sv_type=="Inversion"){ - # paintInterTAD_arrows() - # } - - ############################################################ - ## Painting Patient Re-arranged Scenario ################### - ## Here is when plot changes, regarding SV - ############################################################ - ##source("functions/makingGraphs/aux_fun_Plots_Rearranged_TADs.R") - - #Adding SV rearrangment header - #WT allelle label - text(x=20, y=20-40, label="Patient Scenario", cex = 1.5) - #text(x=20,y=18-30, label="Simplification",cex=1.2) - #text(x=20, y=16-30, label=paste0("Focusing on gene ", gene, " in phase ", phase), cex = 1.2) - - #Height at which TADs are displayed - tad_YCoord_Rearrangements<-tad_YCoord_WildTypeLine-40 - - ############################################################################################################# - ##Here, we need to differentiate depending on the SV - ##Also if gene direct effect, for LOF (as truncation or deletion), do not paint the whole rearrangement - ############################################################################################################# - - if(gene_mechanism == "Direct_geneTruncation"){ - ##Plot GeneTruncation. Only one plot in the middle no TAD painted - paint_Gene_Truncation(gene = gene, - xAxisLim = xAxisLim, - tad_X_cord = tad_XCoord_OnCenter, - tad_YCoord_Rearrangements = tad_YCoord_Rearrangements) + text(x=20,y=26, label="Simplification",cex=1.7) - }else if(gene_mechanism == "Direct_geneDeletion"){ - ##Plot GeneDeletion. Only one plot in the middle no TAD painted - paint_Gene_Deletion(gene = gene, - xAxisLim = xAxisLim, - tad_X_cord = tad_XCoord_OnCenter, - tad_YCoord_Rearrangements = tad_YCoord_Rearrangements) + #WT allelle label + text(x=20, y=20, label="Control Scenario", cex = 1.5) - }else if(gene_mechanism == "LongRange"){ - if((sv_type=="Inversion") || (sv_type=="Translocation")){ - ##It implies a reshuffling of TADs, so no DNA gained or lost - - #Paint Gene SV re-arranged TAD - infoDrawing_gene_sv_tad<-paintGene_SV_TAD(nEnh_initial_left = nEnh_initial_left, - nEnh_initial_right = nEnh_initial_right, - gene = gene, - gene_breakp_line_type = gene_breakp_line_type, - situation = situation, - nEnh_kept_left = nEnh_kept_left, - nEnh_kept_right = nEnh_kept_right, - nEnh_gained = nEnh_gained, - nEnh_other_domain = nEnh_other_domain, - info_drawingGENE_TAD = info_drawingGENE_TAD, - info_drawingSecondaryTAD = info_drawingSecondaryTAD, - tad_XCoord_OnLeftSide = tad_XCoord_OnLeftSide, - tad_XCoord_OnRightSide = tad_XCoord_OnRightSide, - tad_YCoord_Rearrangements = tad_YCoord_Rearrangements, - geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS, tagEnhancersLabel = tagEnhancersLabel) - - #Paint SecondaryTAD SV re-arranged - #The one where the gene of interest is not located - paintSecondaryDomain_SV_TAD(nEnh_initial_left = nEnh_initial_left, - nEnh_initial_right = nEnh_initial_right, - gene = gene, - gene_breakp_line_type = gene_breakp_line_type, - situation = situation, - nEnh_other_domain = nEnh_other_domain, - nEnh_kept_left = nEnh_kept_left, - nEnh_kept_right = nEnh_kept_right, - nEnh_gained = nEnh_gained, - info_drawingGENE_TAD = info_drawingGENE_TAD, - info_drawingSecondaryTAD = info_drawingSecondaryTAD, - 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, 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 - paintGene_SV_Deletion_TAD(nEnh_initial_left = nEnh_initial_left, - nEnh_initial_right = nEnh_initial_right, - gene = gene, - gene_breakp_line_type = gene_breakp_line_type, - situation = situation, - nEnh_kept_left = nEnh_kept_left, - nEnh_kept_right = nEnh_kept_right, - nEnh_gained = nEnh_gained, - nEnh_other_domain = nEnh_other_domain, - info_drawingGENE_TAD = info_drawingGENE_TAD, - info_drawingSecondaryTAD = info_drawingSecondaryTAD, - tad_X_cord = tad_XCoord_OnCenter , - tad_YCoord_Rearrangements = tad_YCoord_Rearrangements, - geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS, tagEnhancersLabel = tagEnhancersLabel) - - }else if(sv_type == "Duplication"){ - - ##In this context there is no gene duplication - ###If we are facing a LongRange mechanism, and the gene is not duplicated, as it is happening in this case - ###It must be intraTAD, because on the contrary, if a gene Not duplicated, and in a InterTAD SV, the gene regulatory - ##Domain remains as it was. - - ##If it is not intra-TAD, raise error, it can be an interTAD where breakpoint falls in enh...hence counted as lost - ##So LOF happening by means of a Duplication... but rare. So if this is the case rise error to check what is going on - - - ##Check if SV is intraTAD (primaryTAD_central or phaseIntegratedResults$SV_landing IntraTAD) - - ##To be a NeoTAD process the gene needs to be duplicated - ##Check that THIS is INTRA-TAD - - if(SV_landing == "IntraTAD"){ - - #okey pintar - ##Pintar el TAD con los enh, si hay mas que habian en un lado pintar 6 u 8 si se doblan todos - ##Si hay menos... tal vez por duplication falling strictly in a enh... pintar menos.. Buff for now not considered - paintGene_SV_Duplication_OnlyLongRange_Intra_TAD(nEnh_initial_left = nEnh_initial_left, - nEnh_initial_right = nEnh_initial_right, - gene = gene, - gene_breakp_line_type = gene_breakp_line_type, - situation = situation, - nEnh_kept_left = nEnh_kept_left, - nEnh_kept_right = nEnh_kept_right, - nEnh_gained = nEnh_gained, - nEnh_other_domain = nEnh_other_domain, - info_drawingGENE_TAD = info_drawingGENE_TAD, - info_drawingSecondaryTAD = info_drawingSecondaryTAD, - tad_X_cord = tad_XCoord_OnCenter , - tad_YCoord_Rearrangements = tad_YCoord_Rearrangements, - geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS, - patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel) - - }else{ - ##Error, no concibo esta situacion ahora mismo - stop("I don't contemplate how this can happen sensibly right now") - } - - - - } - }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 + ##Check whether the current Gene gene regulatory domain is disrupted or not (it can occur for deletions or duplications) + ##If the TAD gene is entirely deleted or duplicated, between the affected ones + ##We will know that this is occurring if the gene_breakpoint takes the value<-"No_AssociatedBreakpoint" + ##Still pendent to take into account if value: "NotClear_BreakpointAssociation" - ## NEO-TAD processes. If interTAD + ##Again important to check whether gene regulatory domain altered or not + #Info derived from gene breakpoint + ##gene_regulatoryDomain_altered##TRUE OR FALSE + ##situation "primaryTAD_Central" means we only paint one tad in the middle cause it is not disrupted - ##Filter for interTAD, if it is intraTAD i do not reasonably understand how this can be pathogenic - ##IF not considered as Direct or Direct_LonRange_geneDuplication - ##Because this would imply that gene poorly expressed, by cognate enh duplication pathogenic - ##And we are trying to prevent this from being a good candidate + ##Coord for tads over X axis (Depending on the situation either two TADs or just one will be painted) + #Let's try make them wider two cm per side to ensure everything fits on the re-arrangement plots + tad_XCoord_OnLeftSide<-c(3,17,10)#c(5,15,10) ##c(3,17,10) + tad_XCoord_OnRightSide<-c(tad_XCoord_OnLeftSide[1]+10+11, + tad_XCoord_OnLeftSide[2]+10+11, + tad_XCoord_OnLeftSide[3]+10+11) + tad_XCoord_OnCenter<-c(13,27,20) + #Over Y axis, WT line + tad_YCoord_WildTypeLine<-c(0,0,15) - if(SV_landing == "InterTAD" ){ - - ###################### - ## NEO-TAD process - ###################### - ##Left and Right TADs are painted same as WT at the sides - ##So reuse the same script styling - ##Situation can not be primary tad central - - ###################### - ## Painting borderTADs - tad_Y_cord<-tad_YCoord_Rearrangements - - tad_XCoord_MoreLefted_OnLeftSide<-tad_XCoord_OnLeftSide - 10 - tad_XCoord_MoreRighted_OnRightSide<-tad_XCoord_OnRightSide + 10 - - - ##Modificar TAD X coord tirarlos mas a los lados + + if(situation %in% c("primaryTAD_Sinistral", "primaryTAD_Dextral")){ + ##So we paint two TADs cause gene breakpoint disrupts its regulatory domain, and re-shuffles it with another if(situation =="primaryTAD_Sinistral"){ ######################## @@ -951,13 +719,13 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){ ## on the left side ######################## - #text(x=5, y=yPos_chr_WT, label=chr_gene, cex = texSizeChr) + text(x=5, y=yPos_chr_WT, label=chr_gene, cex = texSizeChr) ##Creating TAD to represente gene WT scenario - tad_X_cord<-tad_XCoord_MoreLefted_OnLeftSide + tad_X_cord<-tad_XCoord_OnLeftSide ##c(5,15,10) info_drawingGENE_TAD<-paintGene_WT_TAD(tad_X_cord = tad_X_cord, - tad_Y_cord = tad_YCoord_Rearrangements, + tad_Y_cord = tad_YCoord_WildTypeLine, nEnh_initial_left = nEnh_initial_left, nEnh_initial_right = nEnh_initial_right, gene = gene, @@ -967,19 +735,21 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){ geneCenter<-info_drawingGENE_TAD$geneCenter + # ##Adding interTAD dotted lines + # paintInterTAD_WT_lines(tad_X_cord = c(5,15,10)) ################################################ ## PAINTING SECONDARY//OTHER AFFECTED DOMAIN ### ## on the right side ################################################ - #text(x=26, y=yPos_chr_WT, label=chr_oppositeDomain, cex = texSizeChr) + text(x=26, y=yPos_chr_WT, label=chr_oppositeDomain, cex = texSizeChr) ##Creating TAD to represente gene WT scenario - tad_X_cord<-tad_XCoord_MoreRighted_OnRightSide - + tad_X_cord<-tad_XCoord_OnRightSide + tad_Y_cord<-tad_YCoord_WildTypeLine ##Info returned used to represent the rearrangement info_drawingSecondaryTAD<-paint_Enhancer_WT_Secondary_TAD(tad_X_cord = tad_X_cord, - tad_Y_cord = tad_YCoord_Rearrangements, + tad_Y_cord = tad_YCoord_WildTypeLine, nEnh_other_domain = nEnh_other_domain, geneCenter = geneCenter, otherDomain_breakp_line_type = otherDomain_breakp_line_type, @@ -993,14 +763,13 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){ ## on the Right Side side ######################## - #text(x=26, y=yPos_chr_WT, label=chr_gene, cex = texSizeChr) + text(x=26, y=yPos_chr_WT, label=chr_gene, cex = texSizeChr) ##Creating TAD to represente gene WT scenario - tad_X_cord<-tad_XCoord_MoreRighted_OnRightSide - + tad_X_cord<-tad_XCoord_OnRightSide##c(5+10+11,15+10+11,10+10+11) ##Info returned used to represent the rearrangement info_drawingGENE_TAD<-paintGene_WT_TAD(tad_X_cord = tad_X_cord, - tad_Y_cord = tad_YCoord_Rearrangements, + tad_Y_cord = tad_YCoord_WildTypeLine, nEnh_initial_left = nEnh_initial_left, nEnh_initial_right = nEnh_initial_right, gene = gene, @@ -1010,20 +779,22 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){ geneCenter<-info_drawingGENE_TAD$geneCenter + # ##Adding interTAD dotted lines + # paintInterTAD_WT_lines(tad_X_cord = c(5,15,10)) ################################################ ## PAINTING SECONDARY//OTHER AFFECTED DOMAIN ### ## on the LEFT side ################################################ - #text(x=5, y=yPos_chr_WT, label=chr_oppositeDomain, cex = texSizeChr) + text(x=5, y=yPos_chr_WT, label=chr_oppositeDomain, cex = texSizeChr) ##Creating TAD to represente gene WT scenario - tad_X_cord<-tad_XCoord_MoreLefted_OnLeftSide - + tad_X_cord<-tad_XCoord_OnLeftSide + tad_Y_cord<-tad_YCoord_WildTypeLine ##Info returned used to represent the rearrangement info_drawingSecondaryTAD<-paint_Enhancer_WT_Secondary_TAD(tad_X_cord = tad_X_cord, - tad_Y_cord = tad_YCoord_Rearrangements, + tad_Y_cord = tad_YCoord_WildTypeLine, nEnh_other_domain = nEnh_other_domain, geneCenter = geneCenter, otherDomain_breakp_line_type = otherDomain_breakp_line_type, @@ -1032,52 +803,418 @@ graphicalSummary_generation<-function(patientResults, minPathogenicScore){ patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel) } + }else if(situation == "primaryTAD_Central"){ + ##So either the breakpoint falls in a different TAD, and this TAD is either duplicated or deleted entirely + ##Or both breakpoint fall inside of the same TAD + ##In any case, breakpoints do not affect its boundaries + + ##So paint it in the center + ##With breakpoints flanking theTAD upon a certain distance + ##source("functions/aux_functions_forGraphicalSummary.R") + ######################## - ##Painting the NEO TAD + ## PAINTING GENE-TAD ### + ## on the Center (Only one TAD painted) ######################## - paintGene_SV_Duplication_NEO_TAD(nEnh_initial_left = nEnh_initial_left, - nEnh_initial_right = nEnh_initial_right, - gene = gene, - gene_breakp_line_type = gene_breakp_line_type, - situation = situation, - nEnh_kept_left = nEnh_kept_left, - nEnh_kept_right = nEnh_kept_right, - nEnh_gained = nEnh_gained, - nEnh_other_domain = nEnh_other_domain, - info_drawingGENE_TAD = info_drawingGENE_TAD, - info_drawingSecondaryTAD = info_drawingSecondaryTAD, - tad_X_cord = tad_XCoord_OnCenter , - tad_YCoord_Rearrangements = tad_YCoord_Rearrangements, - geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS, tagEnhancersLabel = tagEnhancersLabel) + text(x=tad_XCoord_OnCenter[1]+2, y=yPos_chr_WT, label=chr_gene, cex = texSizeChr) + ##Creating TAD to represente gene WT scenario + tad_X_cord<-tad_XCoord_OnCenter + + if(((gene_mechanism == "LongRange_geneDuplication") || (gene_mechanism =="Direct_LongRange_geneDuplication")) && (SV_landing == "IntraTAD")){ + + # browser() + + info_drawingGENE_TAD<-paintGene_WT_TAD_intraTADdupWithEnh(tad_X_cord = tad_X_cord, + tad_Y_cord = tad_YCoord_WildTypeLine, + nEnh_initial_left = nEnh_initial_left, + nEnh_initial_right = nEnh_initial_right, + gene = gene, + gene_breakp_line_type = gene_breakp_line_type, + situation = situation, + patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel) + + + }else{ + info_drawingGENE_TAD<-paintGene_WT_TAD(tad_X_cord = tad_X_cord, + tad_Y_cord = tad_YCoord_WildTypeLine, + nEnh_initial_left = nEnh_initial_left, + nEnh_initial_right = nEnh_initial_right, + gene = gene, + gene_breakp_line_type = gene_breakp_line_type, + situation = situation, + patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel) + + geneCenter<-info_drawingGENE_TAD$geneCenter + } - }else { - #It would be intraTAD dup, where pathogenic mech by enh dup and not by gene dup - #...rare, attending to what I have stated before - ##Error, no concibo esta situacion ahora mismo - stop("I don't contemplate how this can happen sensibly right now") } + ########################### + ## Adding Label SV type + ########################### + ##source("functions/aux_functions_forGraphicalSummary.R") + paint_SV_labels(sv_type = sv_type, xAxisLim = xAxisLim, yAxisPos = -12.5) + + ############################## + ###Paint interTad arrows + ############################## + + ##Avoid if is translocation + ##For now remove, too noisy + # if(sv_type=="Inversion"){ + # paintInterTAD_arrows() + # } + + ############################################################ + ## Painting Patient Re-arranged Scenario ################### + ## Here is when plot changes, regarding SV + ############################################################ + ##source("functions/makingGraphs/aux_fun_Plots_Rearranged_TADs.R") - }else if(gene_mechanism == "Direct_geneDuplication"){ - ##We paint two times only the gene, and enough... + #Adding SV rearrangment header + #WT allelle label + text(x=20, y=20-40, label="Patient Scenario", cex = 1.5) + #text(x=20,y=18-30, label="Simplification",cex=1.2) + #text(x=20, y=16-30, label=paste0("Focusing on gene ", gene, " in phase ", phase), cex = 1.2) - paint_Gene_Duplicated(gene = gene, + #Height at which TADs are displayed + tad_YCoord_Rearrangements<-tad_YCoord_WildTypeLine-40 + + ############################################################################################################# + ##Here, we need to differentiate depending on the SV + ##Also if gene direct effect, for LOF (as truncation or deletion), do not paint the whole rearrangement + ############################################################################################################# + + if(gene_mechanism == "Direct_geneTruncation"){ + ##Plot GeneTruncation. Only one plot in the middle no TAD painted + paint_Gene_Truncation(gene = gene, + xAxisLim = xAxisLim, + tad_X_cord = tad_XCoord_OnCenter, + tad_YCoord_Rearrangements = tad_YCoord_Rearrangements) + + }else if(gene_mechanism == "Direct_geneDeletion"){ + ##Plot GeneDeletion. Only one plot in the middle no TAD painted + paint_Gene_Deletion(gene = gene, xAxisLim = xAxisLim, tad_X_cord = tad_XCoord_OnCenter, tad_YCoord_Rearrangements = tad_YCoord_Rearrangements) + + }else if(gene_mechanism == "LongRange"){ + + if((sv_type=="Inversion") || (sv_type=="Translocation")){ + ##It implies a reshuffling of TADs, so no DNA gained or lost + + #Paint Gene SV re-arranged TAD + infoDrawing_gene_sv_tad<-paintGene_SV_TAD(nEnh_initial_left = nEnh_initial_left, + nEnh_initial_right = nEnh_initial_right, + gene = gene, + gene_breakp_line_type = gene_breakp_line_type, + situation = situation, + nEnh_kept_left = nEnh_kept_left, + nEnh_kept_right = nEnh_kept_right, + nEnh_gained = nEnh_gained, + nEnh_other_domain = nEnh_other_domain, + info_drawingGENE_TAD = info_drawingGENE_TAD, + info_drawingSecondaryTAD = info_drawingSecondaryTAD, + tad_XCoord_OnLeftSide = tad_XCoord_OnLeftSide, + tad_XCoord_OnRightSide = tad_XCoord_OnRightSide, + tad_YCoord_Rearrangements = tad_YCoord_Rearrangements, + geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS, tagEnhancersLabel = tagEnhancersLabel) + + #Paint SecondaryTAD SV re-arranged + #The one where the gene of interest is not located + paintSecondaryDomain_SV_TAD(nEnh_initial_left = nEnh_initial_left, + nEnh_initial_right = nEnh_initial_right, + gene = gene, + gene_breakp_line_type = gene_breakp_line_type, + situation = situation, + nEnh_other_domain = nEnh_other_domain, + nEnh_kept_left = nEnh_kept_left, + nEnh_kept_right = nEnh_kept_right, + nEnh_gained = nEnh_gained, + info_drawingGENE_TAD = info_drawingGENE_TAD, + info_drawingSecondaryTAD = info_drawingSecondaryTAD, + 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, 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 + paintGene_SV_Deletion_TAD(nEnh_initial_left = nEnh_initial_left, + nEnh_initial_right = nEnh_initial_right, + gene = gene, + gene_breakp_line_type = gene_breakp_line_type, + situation = situation, + nEnh_kept_left = nEnh_kept_left, + nEnh_kept_right = nEnh_kept_right, + nEnh_gained = nEnh_gained, + nEnh_other_domain = nEnh_other_domain, + info_drawingGENE_TAD = info_drawingGENE_TAD, + info_drawingSecondaryTAD = info_drawingSecondaryTAD, + tad_X_cord = tad_XCoord_OnCenter , + tad_YCoord_Rearrangements = tad_YCoord_Rearrangements, + geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS, tagEnhancersLabel = tagEnhancersLabel) + + }else if(sv_type == "Duplication"){ + + ##In this context there is no gene duplication + ###If we are facing a LongRange mechanism, and the gene is not duplicated, as it is happening in this case + ###It must be intraTAD, because on the contrary, if a gene Not duplicated, and in a InterTAD SV, the gene regulatory + ##Domain remains as it was. + + ##If it is not intra-TAD, raise error, it can be an interTAD where breakpoint falls in enh...hence counted as lost + ##So LOF happening by means of a Duplication... but rare. So if this is the case rise error to check what is going on + + + ##Check if SV is intraTAD (primaryTAD_central or phaseIntegratedResults$SV_landing IntraTAD) + + ##To be a NeoTAD process the gene needs to be duplicated + ##Check that THIS is INTRA-TAD + + if(SV_landing == "IntraTAD"){ + + #okey pintar + ##Pintar el TAD con los enh, si hay mas que habian en un lado pintar 6 u 8 si se doblan todos + ##Si hay menos... tal vez por duplication falling strictly in a enh... pintar menos.. Buff for now not considered + paintGene_SV_Duplication_OnlyLongRange_Intra_TAD(nEnh_initial_left = nEnh_initial_left, + nEnh_initial_right = nEnh_initial_right, + gene = gene, + gene_breakp_line_type = gene_breakp_line_type, + situation = situation, + nEnh_kept_left = nEnh_kept_left, + nEnh_kept_right = nEnh_kept_right, + nEnh_gained = nEnh_gained, + nEnh_other_domain = nEnh_other_domain, + info_drawingGENE_TAD = info_drawingGENE_TAD, + info_drawingSecondaryTAD = info_drawingSecondaryTAD, + tad_X_cord = tad_XCoord_OnCenter , + tad_YCoord_Rearrangements = tad_YCoord_Rearrangements, + geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS, + patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel) + + }else{ + ##Error, no concibo esta situacion ahora mismo + stop("I don't contemplate how this can happen sensibly right now") + } + + + + } + }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 + + ## NEO-TAD processes. If interTAD + + ##Filter for interTAD, if it is intraTAD i do not reasonably understand how this can be pathogenic + ##IF not considered as Direct or Direct_LonRange_geneDuplication + ##Because this would imply that gene poorly expressed, by cognate enh duplication pathogenic + ##And we are trying to prevent this from being a good candidate + + + + if(SV_landing == "InterTAD" ){ + + ###################### + ## NEO-TAD process + ###################### + ##Left and Right TADs are painted same as WT at the sides + ##So reuse the same script styling + ##Situation can not be primary tad central + + ###################### + ## Painting borderTADs + tad_Y_cord<-tad_YCoord_Rearrangements + + tad_XCoord_MoreLefted_OnLeftSide<-tad_XCoord_OnLeftSide - 10 + tad_XCoord_MoreRighted_OnRightSide<-tad_XCoord_OnRightSide + 10 + + + ##Modificar TAD X coord tirarlos mas a los lados + + if(situation =="primaryTAD_Sinistral"){ + ######################## + ## PAINTING GENE-TAD ### + ## on the left side + ######################## + + #text(x=5, y=yPos_chr_WT, label=chr_gene, cex = texSizeChr) + + ##Creating TAD to represente gene WT scenario + + tad_X_cord<-tad_XCoord_MoreLefted_OnLeftSide + info_drawingGENE_TAD<-paintGene_WT_TAD(tad_X_cord = tad_X_cord, + tad_Y_cord = tad_YCoord_Rearrangements, + nEnh_initial_left = nEnh_initial_left, + nEnh_initial_right = nEnh_initial_right, + gene = gene, + gene_breakp_line_type = gene_breakp_line_type, + situation = situation, + patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel) + + geneCenter<-info_drawingGENE_TAD$geneCenter + + + ################################################ + ## PAINTING SECONDARY//OTHER AFFECTED DOMAIN ### + ## on the right side + ################################################ + #text(x=26, y=yPos_chr_WT, label=chr_oppositeDomain, cex = texSizeChr) + ##Creating TAD to represente gene WT scenario + tad_X_cord<-tad_XCoord_MoreRighted_OnRightSide + + ##Info returned used to represent the rearrangement + + info_drawingSecondaryTAD<-paint_Enhancer_WT_Secondary_TAD(tad_X_cord = tad_X_cord, + tad_Y_cord = tad_YCoord_Rearrangements, + nEnh_other_domain = nEnh_other_domain, + geneCenter = geneCenter, + otherDomain_breakp_line_type = otherDomain_breakp_line_type, + situation = situation, + geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS, + patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel) + + }else if(situation == "primaryTAD_Dextral"){ + ######################## + ## PAINTING GENE-TAD ### + ## on the Right Side side + ######################## + + #text(x=26, y=yPos_chr_WT, label=chr_gene, cex = texSizeChr) + + ##Creating TAD to represente gene WT scenario + tad_X_cord<-tad_XCoord_MoreRighted_OnRightSide + + ##Info returned used to represent the rearrangement + info_drawingGENE_TAD<-paintGene_WT_TAD(tad_X_cord = tad_X_cord, + tad_Y_cord = tad_YCoord_Rearrangements, + nEnh_initial_left = nEnh_initial_left, + nEnh_initial_right = nEnh_initial_right, + gene = gene, + gene_breakp_line_type = gene_breakp_line_type, + situation = situation, + patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel) + + geneCenter<-info_drawingGENE_TAD$geneCenter + + + ################################################ + ## PAINTING SECONDARY//OTHER AFFECTED DOMAIN ### + ## on the LEFT side + ################################################ + #text(x=5, y=yPos_chr_WT, label=chr_oppositeDomain, cex = texSizeChr) + ##Creating TAD to represente gene WT scenario + tad_X_cord<-tad_XCoord_MoreLefted_OnLeftSide + + + ##Info returned used to represent the rearrangement + + info_drawingSecondaryTAD<-paint_Enhancer_WT_Secondary_TAD(tad_X_cord = tad_X_cord, + tad_Y_cord = tad_YCoord_Rearrangements, + nEnh_other_domain = nEnh_other_domain, + geneCenter = geneCenter, + otherDomain_breakp_line_type = otherDomain_breakp_line_type, + situation = situation, + geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS, + patientResults = patientResults, tagEnhancersLabel = tagEnhancersLabel) + } + + ######################## + ##Painting the NEO TAD + ######################## + paintGene_SV_Duplication_NEO_TAD(nEnh_initial_left = nEnh_initial_left, + nEnh_initial_right = nEnh_initial_right, + gene = gene, + gene_breakp_line_type = gene_breakp_line_type, + situation = situation, + nEnh_kept_left = nEnh_kept_left, + nEnh_kept_right = nEnh_kept_right, + nEnh_gained = nEnh_gained, + nEnh_other_domain = nEnh_other_domain, + info_drawingGENE_TAD = info_drawingGENE_TAD, + info_drawingSecondaryTAD = info_drawingSecondaryTAD, + tad_X_cord = tad_XCoord_OnCenter , + tad_YCoord_Rearrangements = tad_YCoord_Rearrangements, + geneBreakP_Position_respectToTSS = geneBreakP_Position_respectToTSS, tagEnhancersLabel = tagEnhancersLabel) + + + + + }else { + #It would be intraTAD dup, where pathogenic mech by enh dup and not by gene dup + #...rare, attending to what I have stated before + ##Error, no concibo esta situacion ahora mismo + # stop("I don't contemplate how this can happen sensibly right now") + + ##This is the SATB2 and FOXG1 situation where both scores are large buth long-range slightly larger... + paint_Gene_Duplicated(gene = gene, + xAxisLim = xAxisLim, + tad_X_cord = tad_XCoord_OnCenter, + tad_YCoord_Rearrangements = tad_YCoord_Rearrangements) + + } + + + + }else if(gene_mechanism == "Direct_geneDuplication"){ + ##We paint two times only the gene, and enough... + + paint_Gene_Duplicated(gene = gene, + xAxisLim = xAxisLim, + tad_X_cord = tad_XCoord_OnCenter, + tad_YCoord_Rearrangements = tad_YCoord_Rearrangements) + + + } + ####################################### + ## CLOSING && STORING PLOT ############ + ####################################### - } - - ####################################### - ## CLOSING && STORING PLOT ############ - ####################################### + dev.off()##Saving Graph + + },error = function(err){ + dev.off() + #################################### + ##png with maximum resolution 300dpi + print("ERROR") + png(filename = fullOutpPath, width = 12, height = 8, units = "in", res = 300 ) + + + ########################################## + ###Creating canvas for plotting + ##OPTION REMOVING AXIS + #UPON COMPLETION USING THIS + xAxisLim<-c(0,40) - dev.off()##Saving Graph + ##Adjust image, to exclude spaces outside canvas (drawing area) + par(mar = c(0,0,0,0)) + + + yAxisLim<-c(0,20) + + plot(x=0:20, y=0:20, type = "n", + ylim = yAxisLim, + xlim = xAxisLim, + xaxt = 'n', yaxt = 'n', bty = 'n', pch = '', ylab = '', xlab = '') ##Upon completion, REMOVE AXIS + + text(x=20,y=10, label="An internal error occurred during the graphical abstract generation.\n Please contact POSTRE developers to take a look at the error",cex=1.7) + + + ####################################### + ## CLOSING && STORING PLOT ############ + ####################################### + + dev.off()##Saving Graph + + + }) } } } diff --git a/Postre_app/www/graphicalSummaries/FolderExp.txt b/Postre_app/www/graphicalSummaries/FolderExp.txt deleted file mode 100644 index f13d124..0000000 --- a/Postre_app/www/graphicalSummaries/FolderExp.txt +++ /dev/null @@ -1,2 +0,0 @@ -##Folder with automatically generated images for the analysed SV -##Images will be removed upon job resubmission diff --git a/Postre_app/www/graphicalSummaries/SATB2_20230314010450_Duplication_neurodevelopmental_TS_plot.png b/Postre_app/www/graphicalSummaries/SATB2_20230314010450_Duplication_neurodevelopmental_TS_plot.png new file mode 100644 index 0000000..4c72be7 Binary files /dev/null and b/Postre_app/www/graphicalSummaries/SATB2_20230314010450_Duplication_neurodevelopmental_TS_plot.png differ diff --git a/Postre_app/www/graphicalSummaries/SATB2_20230314010450_Duplication_neurodevelopmental_polyCscore_plot.png b/Postre_app/www/graphicalSummaries/SATB2_20230314010450_Duplication_neurodevelopmental_polyCscore_plot.png new file mode 100644 index 0000000..c2dfb45 Binary files /dev/null and b/Postre_app/www/graphicalSummaries/SATB2_20230314010450_Duplication_neurodevelopmental_polyCscore_plot.png differ diff --git a/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw15_20230314010450_Duplication_neurodevelopmental.png b/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw15_20230314010450_Duplication_neurodevelopmental.png new file mode 100644 index 0000000..5697622 Binary files /dev/null and b/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw15_20230314010450_Duplication_neurodevelopmental.png differ diff --git a/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw15_20230314010450_Duplication_neurodevelopmental_expressionLevelPlot.png b/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw15_20230314010450_Duplication_neurodevelopmental_expressionLevelPlot.png new file mode 100644 index 0000000..e92bfd8 Binary files /dev/null and b/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw15_20230314010450_Duplication_neurodevelopmental_expressionLevelPlot.png differ diff --git a/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw15_20230314010450_Duplication_neurodevelopmental_regulatoryLandscapeBarplotChanges.png b/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw15_20230314010450_Duplication_neurodevelopmental_regulatoryLandscapeBarplotChanges.png new file mode 100644 index 0000000..0d966d6 Binary files /dev/null and b/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw15_20230314010450_Duplication_neurodevelopmental_regulatoryLandscapeBarplotChanges.png differ diff --git a/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw18_20230314010450_Duplication_neurodevelopmental.png b/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw18_20230314010450_Duplication_neurodevelopmental.png new file mode 100644 index 0000000..96897d7 Binary files /dev/null and b/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw18_20230314010450_Duplication_neurodevelopmental.png differ diff --git a/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw18_20230314010450_Duplication_neurodevelopmental_expressionLevelPlot.png b/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw18_20230314010450_Duplication_neurodevelopmental_expressionLevelPlot.png new file mode 100644 index 0000000..e3a663c Binary files /dev/null and b/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw18_20230314010450_Duplication_neurodevelopmental_expressionLevelPlot.png differ diff --git a/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw18_20230314010450_Duplication_neurodevelopmental_regulatoryLandscapeBarplotChanges.png b/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw18_20230314010450_Duplication_neurodevelopmental_regulatoryLandscapeBarplotChanges.png new file mode 100644 index 0000000..929bee5 Binary files /dev/null and b/Postre_app/www/graphicalSummaries/SATB2_GOF_PfcGw18_20230314010450_Duplication_neurodevelopmental_regulatoryLandscapeBarplotChanges.png differ diff --git a/Postre_app/www/tablesDownload/table_PatientsInfo.txt b/Postre_app/www/tablesDownload/table_PatientsInfo.txt index a4fd220..02d5090 100644 --- a/Postre_app/www/tablesDownload/table_PatientsInfo.txt +++ b/Postre_app/www/tablesDownload/table_PatientsInfo.txt @@ -1,11 +1,22 @@ chr_Break1 coord_Break1 chr_Break2 coord_Break2 TypeSV Phenotype SV_ID runMode genePhenoConsideration refGenome userTADmap -chr6 10355280 chr6 99103873 Inversion head_neck Patient1_SV1 Standard yes hg19 no -chr6 10099104 chr6 10858260 Deletion head_neck Patient2_SV1 Standard yes hg19 no -chr10 2572670,2572679 chr17 69391220,69395705 Translocation head_neck,limbs Patient3_SV1 Standard yes hg19 no -chr17 68020547 chr17 70038208 Duplication limbs Patient4_SV1 Standard yes hg19 no -chr2 221278232 chr2 223014332 Deletion limbs Patient5_SV1 Standard yes hg19 no -chr2 199632039 chr2 204602266 Deletion neurodevelopmental Patient6_SV1 Standard yes hg19 no -chr5 88232587 chr5 93437723 Deletion neurodevelopmental Patient7_SV1 Standard yes hg19 no -chr4 148252852,148252854 chr14 99097976,99097980 Translocation neurodevelopmental Patient8_SV1 Standard yes hg19 no -chr4 129315144 chr4 129316312 Deletion neurodevelopmental Patient8_SV2 Standard yes hg19 no -chr15 100349143 chr15 100349232 Deletion neurodevelopmental Patient8_SV3 Standard yes hg19 no +chr6 10099104 chr6 10858260 Deletion head_neck TFAP2A_Coding_Nr1 Standard yes hg19 no +chr6 10366260,10366807 chr6 10433913,10434178 Deletion head_neck TFAP2A_Coding_Nr2 Standard yes hg19 no +chr2 223153899 chr2 223164405 Deletion head_neck PAX3_Coding_Nr1 Standard yes hg19 no +chr2 200309696,200319784 chr7 19222993,19247899 Translocation neurodevelopmental SATB2_Coding_Nr1 Standard yes hg19 no +chr2 200166659,200166954 chr14 57164698,57165819 Translocation neurodevelopmental SATB2_Coding_Nr2 Standard yes hg19 no +chr2 200166166,200203438 chr10 64644346,64825342 Translocation neurodevelopmental SATB2_Coding_Nr3 Standard yes hg19 no +chr2 200128960 chr2 200312555 Deletion neurodevelopmental SATB2_Coding_Nr4 Standard yes hg19 no +chr2 200151982 chr2 200325064 Deletion neurodevelopmental SATB2_Coding_Nr5 Standard yes hg19 no +chr2 200151782 chr2 200336956 Deletion neurodevelopmental SATB2_Coding_Nr6 Standard yes hg19 no +chr14 28257152 chr14 35048345 Duplication neurodevelopmental FOXG1_Coding_Nr1 Standard yes hg19 no +chr14 28556166 chr14 34968020 Duplication neurodevelopmental FOXG1_Coding_Nr2 Standard yes hg19 no +chr14 19930001 chr14 37830249 Duplication neurodevelopmental FOXG1_Coding_Nr3 Standard yes hg19 no +chr14 27830160 chr14 30930249 Deletion neurodevelopmental FOXG1_Coding_Nr4 Standard yes hg19 no +chr14 28430160 chr14 31330249 Deletion neurodevelopmental FOXG1_Coding_Nr5 Standard yes hg19 no +chr5 85598295 chr5 91182469 Duplication neurodevelopmental MEF2C_Coding_Nr1 Standard yes hg19 no +chr5 87356360 chr5 92591506 Duplication neurodevelopmental MEF2C_Coding_Nr2 Standard yes hg19 no +chr5 87942771 chr5 88261128 Deletion neurodevelopmental MEF2C_Coding_Nr3 Standard yes hg19 no +chr5 87198371 chr5 88338502 Deletion neurodevelopmental MEF2C_Coding_Nr4 Standard yes hg19 no +chr7 96465800 chr7 97184399 Duplication limbs DLX5&6_Coding_Nr1 Standard yes hg19 no +chr7 89540795 chr7 98019213 Deletion limbs DLX5&6_Coding_Nr2 Standard yes hg19 no +chr1 43251879 chr1 43416139 Deletion neurodevelopmental SLC2A1_Coding_Nr1 Standard yes hg19 no diff --git a/Postre_app/www/tablesDownload/table_ResultsPerGene.txt b/Postre_app/www/tablesDownload/table_ResultsPerGene.txt index 1b24b3b..7be4fbc 100644 --- a/Postre_app/www/tablesDownload/table_ResultsPerGene.txt +++ b/Postre_app/www/tablesDownload/table_ResultsPerGene.txt @@ -1,10 +1,13 @@ Gene Phenotype N SVs N SVs Long-Range N SVs Coding SV IDs Long-Range SV IDs Coding SV IDs -TFAP2A head_neck 2 1 1 Patient1_SV1,Patient2_SV1 Patient1_SV1 Patient2_SV1 -SOX9 head_neck 1 1 0 Patient3_SV1 Patient3_SV1 -SOX9 limbs 1 1 0 Patient3_SV1 Patient3_SV1 -KCNJ2 limbs 1 1 0 Patient4_SV1 Patient4_SV1 -PAX3 limbs 1 1 0 Patient5_SV1 Patient5_SV1 -SATB2 neurodevelopmental 1 0 1 Patient6_SV1 Patient6_SV1 -NR2F1 neurodevelopmental 1 0 1 Patient7_SV1 Patient7_SV1 -MEF2C neurodevelopmental 1 1 0 Patient7_SV1 Patient7_SV1 -BCL11B neurodevelopmental 1 1 0 Patient8_SV1 Patient8_SV1 +SATB2 neurodevelopmental 6 0 6 SATB2_Coding_Nr1,SATB2_Coding_Nr2,SATB2_Coding_Nr3,SATB2_Coding_Nr4,SATB2_Coding_Nr5,SATB2_Coding_Nr6 SATB2_Coding_Nr1,SATB2_Coding_Nr2,SATB2_Coding_Nr3,SATB2_Coding_Nr4,SATB2_Coding_Nr5,SATB2_Coding_Nr6 +FOXG1 neurodevelopmental 5 0 5 FOXG1_Coding_Nr1,FOXG1_Coding_Nr2,FOXG1_Coding_Nr3,FOXG1_Coding_Nr4,FOXG1_Coding_Nr5 FOXG1_Coding_Nr1,FOXG1_Coding_Nr2,FOXG1_Coding_Nr3,FOXG1_Coding_Nr4,FOXG1_Coding_Nr5 +MEF2C neurodevelopmental 4 0 4 MEF2C_Coding_Nr1,MEF2C_Coding_Nr2,MEF2C_Coding_Nr3,MEF2C_Coding_Nr4 MEF2C_Coding_Nr1,MEF2C_Coding_Nr2,MEF2C_Coding_Nr3,MEF2C_Coding_Nr4 +TFAP2A head_neck 2 0 2 TFAP2A_Coding_Nr1,TFAP2A_Coding_Nr2 TFAP2A_Coding_Nr1,TFAP2A_Coding_Nr2 +DLX5 limbs 2 0 2 DLX5&6_Coding_Nr1,DLX5&6_Coding_Nr2 DLX5&6_Coding_Nr1,DLX5&6_Coding_Nr2 +PAX3 head_neck 1 0 1 PAX3_Coding_Nr1 PAX3_Coding_Nr1 +TWIST1 neurodevelopmental 1 1 0 SATB2_Coding_Nr1 SATB2_Coding_Nr1 +OTX2 neurodevelopmental 1 1 0 SATB2_Coding_Nr2 SATB2_Coding_Nr2 +EGR2 neurodevelopmental 1 1 0 SATB2_Coding_Nr3 SATB2_Coding_Nr3 +CHD8 neurodevelopmental 1 0 1 FOXG1_Coding_Nr3 FOXG1_Coding_Nr3 +SLC2A1 neurodevelopmental 1 0 1 SLC2A1_Coding_Nr1 SLC2A1_Coding_Nr1 +COL1A2 limbs 1 0 1 DLX5&6_Coding_Nr2 DLX5&6_Coding_Nr2 diff --git a/Postre_app/www/tablesDownload/table_ResultsPerSV.txt b/Postre_app/www/tablesDownload/table_ResultsPerSV.txt index f96171b..ac5cb4e 100644 --- a/Postre_app/www/tablesDownload/table_ResultsPerSV.txt +++ b/Postre_app/www/tablesDownload/table_ResultsPerSV.txt @@ -1,12 +1,22 @@ SV ID Phenotype Pathogenic Score Pathogenic Causative genes Candidate genes (Pathogenic Score) -Patient1_SV1 head_neck 1 Yes TFAP2A TFAP2A(1),FBXL4(0.67),POU3F2(0.66),EEF1E1(0.61),MMS22L(0.49),SLC35B3(0.41) -Patient2_SV1 head_neck 1 Yes TFAP2A TFAP2A(1),GCM2(0.67),PAK1IP1(0.65),EEF1E1(0.61),ELOVL2(0.5),SYCP2L(0.5),SLC35B3(0.41),NEDD9(0.37),ERVFRD-1(0.33),SMIM13(0.33),TMEM14B(0.33),TMEM14C(0.33),GCNT2(0.2),C6orf52(0.18),MAK(0) -Patient3_SV1 head_neck 1 Yes SOX9 SOX9(1),PFKP(0.61),ADARB2(0.5) -Patient3_SV1 limbs 1 Yes SOX9 SOX9(1),ADARB2(0.5),PFKP(0.43) -Patient4_SV1 limbs 0.99 Yes KCNJ2 KCNJ2(0.99),SOX9(0.75),MAP2K6(0.37),KCNJ16(0.33),ABCA5(0.05) -Patient5_SV1 limbs 0.98 Yes PAX3 PAX3(0.98),EPHA4(0.5),SGPP2(0.5),STK11IP(0.38),SLC4A3(0.32) -Patient6_SV1 neurodevelopmental 1 Yes SATB2 SATB2(1),NDUFB3(0.67),BZW1(0.66),ABI2(0.66),RAPH1(0.64),ALS2(0.56),BMPR2(0.5),CLK1(0.5),SUMO1(0.48),TMEM237(0.47),FZD7(0.42),ORC2(0.4),SPATS2L(0.34),CTLA4(0.33),FAM117B(0.33),ICOS(0.33),NOP58(0.33),TRAK2(0.33),PPIL3(0.32),NIF3L1(0.27),C2orf69(0.26),WDR12(0.23),STRADB(0.22),ICA1L(0.2),FAM126B(0.19),AOX1(0.17),CD28(0.17),CFLAR(0.17),MPP4(0.15),NBEAL1(0.1),CYP20A1(0.03),KCTD18(0.02),C2CD6(0),CARF(0),CASP10(0),CASP8(0),CDK15(0),FLACC1(0),FTCDNL1(0),KIAA2012(0),MAIP1(0),SGO2(0),TYW5(0) -Patient7_SV1 neurodevelopmental 1 Yes NR2F1,MEF2C NR2F1(1),MEF2C(0.88),FAM172A(0.67),ARRDC3(0.66),CETN3(0.4),KIAA0825(0.25),LYSMD3(0.11),MBLAC2(0.07),ADGRV1(0),POLR3G(0),POU5F2(0),SLF1(0) -Patient8_SV1 neurodevelopmental 1 Yes BCL11B BCL11B(1),VRK1(0.75),EDNRA(0.67),ARHGAP10(0.5),TMEM184C(0.43),PRMT9(0) -Patient8_SV2 neurodevelopmental 0.28 No MFSD8(0.28),PGRMC2(0.23),SCLT1(0.02),C4orf33(0.02),LARP1B(0.02),ABHD18(0),JADE1(0) -Patient8_SV3 neurodevelopmental 0.34 No MEF2A(0.34),LRRC28(0.16),TTC23(0.11),LYSMD4(0.08) +TFAP2A_Coding_Nr1 head_neck 1 Yes TFAP2A TFAP2A(1),GCM2(0.67),PAK1IP1(0.65),EEF1E1(0.61),ELOVL2(0.5),SYCP2L(0.5),SLC35B3(0.41),NEDD9(0.37),ERVFRD-1(0.33),SMIM13(0.33),TMEM14B(0.33),TMEM14C(0.33),GCNT2(0.2),C6orf52(0.18),MAK(0) +TFAP2A_Coding_Nr2 head_neck 1 Yes TFAP2A TFAP2A(1),EEF1E1(0.61),SLC35B3(0.41) +PAX3_Coding_Nr1 head_neck 1 Yes PAX3 PAX3(1),SGPP2(0.14) +SATB2_Coding_Nr1 neurodevelopmental 1 Yes SATB2,TWIST1 SATB2(1),TWIST1(1),HDAC9(0.67),FERD3L(0.5),SNX13(0.4),PRPS1L1(0.33),FTCDNL1(0) +SATB2_Coding_Nr2 neurodevelopmental 1 Yes SATB2,OTX2 SATB2(1),OTX2(1),EXOC5(0.38),NAA30(0.34),AP5M1(0),FTCDNL1(0) +SATB2_Coding_Nr3 neurodevelopmental 1 Yes SATB2,EGR2 SATB2(1),EGR2(1),ADO(0.5),NRBF2(0.36),FTCDNL1(0) +SATB2_Coding_Nr4 neurodevelopmental 1 Yes SATB2 SATB2(1),FTCDNL1(0) +SATB2_Coding_Nr5 neurodevelopmental 1 Yes SATB2 SATB2(1),FTCDNL1(0) +SATB2_Coding_Nr6 neurodevelopmental 1 Yes SATB2 SATB2(1),FTCDNL1(0) +FOXG1_Coding_Nr1 neurodevelopmental 1 Yes FOXG1 FOXG1(1),SNX6(0.66),SRP54(0.63),STRN3(0.61),CFL2(0.5),HECTD1(0.5),EGLN3(0.48),ARHGAP5(0.41),NPAS3(0.39),PRKD1(0.38),PSMA6(0.38),NFKBIA(0.37),AP4S1(0.37),NUBPL(0.34),COCH(0.34),AKAP6(0.33),EAPP(0.33),BAZ1A(0.3),G2E3(0.27),PPP2R3C(0.22),SCFD1(0.21),SPTSSA(0.2),GPR33(0.17),INSM2(0.13),FAM177A1(0.11),HEATR5A(0.03),DTD2(0),PRORP(0) +FOXG1_Coding_Nr2 neurodevelopmental 1 Yes FOXG1 FOXG1(1),EGLN3(0.67),NPAS3(0.66),STRN3(0.61),HECTD1(0.5),ARHGAP5(0.41),PRKD1(0.38),AP4S1(0.37),NUBPL(0.34),COCH(0.34),AKAP6(0.33),SPTSSA(0.33),G2E3(0.27),SCFD1(0.21),GPR33(0.17),HEATR5A(0.03),DTD2(0) +FOXG1_Coding_Nr3 neurodevelopmental 1 Yes FOXG1,CHD8 FOXG1(1),CHD8(0.88),CFL2(0.67),SRP54(0.67),TINF2(0.67),PRMT5(0.67),OSGEP(0.67),PNP(0.67),NOVA1(0.65),BCL2L2-PABPN1(0.65),HNRNPC(0.63),SUPT16H(0.63),TOX4(0.63),STRN3(0.61),CCNB1IP1(0.59),APEX1(0.5),JPH4(0.5),NDRG2(0.5),NKX2-1(0.5),OXA1L(0.5),PSMA6(0.5),PSME1(0.5),RAB2B(0.5),SALL2(0.5),SLC22A17(0.5),SNX6(0.5),ACIN1(0.5),HECTD1(0.5),PSMB5(0.5),METTL3(0.5),BCL2L2(0.5),OR4M1(0.5),OR6S1(0.5),RNASE10(0.5),RNASE11(0.5),TEP1(0.5),MMP14(0.5),NEDD8(0.49),NFKBIA(0.49),ZNF219(0.49),DCAF11(0.48),EFS(0.48),PABPN1(0.48),EGLN3(0.48),PARP2(0.45),CIDEB(0.42),ARHGAP5(0.41),NPAS3(0.39),PRKD1(0.38),SLC7A8(0.38),AP4S1(0.37),TTC5(0.36),RNF31(0.35),RALGAPA1(0.34),NUBPL(0.34),COCH(0.34),AKAP6(0.33),CDH24(0.33),CHMP4A(0.33),DAD1(0.33),EAPP(0.33),GMPR2(0.33),NEDD8-MDP1(0.33),PAX9(0.33),REC8(0.33),SDR39U1(0.33),MYH6(0.33),THTPA(0.33),TM9SF1(0.33),ARHGEF40(0.33),METTL17(0.33),KHNYN(0.33),RNASE1(0.33),ANG(0.33),EDDM3A(0.33),EDDM3B(0.33),KLHL33(0.33),OR11G2(0.33),OR11H4(0.33),OR11H6(0.33),OR4K1(0.33),OR4K13(0.33),OR4K14(0.33),OR4K15(0.33),OR4K17(0.33),OR4K2(0.33),OR4K5(0.33),OR4L1(0.33),OR4N2(0.33),OR4N5(0.33),OR4Q3(0.33),OR5AU1(0.33),POTEM(0.33),RNASE12(0.33),RNASE13(0.33),RNASE2(0.33),RNASE3(0.33),RNASE6(0.33),RNASE7(0.33),RNASE8(0.33),RNASE9(0.33),RPGRIP1(0.33),SLC39A2(0.33),TPPP2(0.33),RBM23(0.32),NYNRIN(0.32),BRMS1L(0.31),ABHD4(0.31),PPP2R3C(0.3),MBIP(0.29),IPO4(0.28),G2E3(0.27),CPNE6(0.26),RNASE4(0.25),MRPL52(0.25),FOXA1(0.24),BAZ1A(0.24),HAUS4(0.22),ZFHX2(0.22),RABGGTA(0.21),SCFD1(0.21),REM2(0.2),SPTSSA(0.2),NRL(0.19),C14orf119(0.19),IRF9(0.18),NGDN(0.17),ADCY4(0.17),CBLN3(0.17),DHRS4(0.17),DHRS4L1(0.17),DHRS4L2(0.17),GPR33(0.17),INSM2(0.17),MIPOL1(0.17),NKX2-8(0.17),RIPK3(0.17),SLC25A21(0.17),SLC7A7(0.17),TGM1(0.17),NFATC4(0.17),MYH7(0.16),FAM177A1(0.15),MDP1(0.14),TTC6(0.13),STXBP6(0.09),C14orf93(0.08),DHRS1(0.08),PSME2(0.05),LRP10(0.05),HEATR5A(0.03),AP1G2(0.03),LTB4R2(0.01),HOMEZ(0.01),PPP1R3E(0.01),AJUBA(0),CARMIL3(0),CEBPE(0),CMA1(0),CMTM5(0),CTSG(0),DHRS2(0),DTD2(0),EMC9(0),FITM1(0),GZMB(0),GZMH(0),IL25(0),LMLN2(0),LTB4R(0),NOP9(0),OR10G2(0),OR10G3(0),OR11H12(0),OR11H2(0),OR4E1(0),OR4E2(0),OR4K3(0),OR6J1(0),PCK2(0),PIP4P1(0),POTEG(0),PRORP(0),PSMB11(0),RNF212B(0),TMEM253(0),TSSK4(0) +FOXG1_Coding_Nr4 neurodevelopmental 1 Yes FOXG1 FOXG1(1),G2E3(0.56),SCFD1(0.53),PRKD1(0.38) +FOXG1_Coding_Nr5 neurodevelopmental 1 Yes FOXG1 FOXG1(1),AP4S1(0.67),NUBPL(0.67),STRN3(0.65),COCH(0.5),GPR33(0.5),HECTD1(0.5),ARHGAP5(0.49),G2E3(0.41),PRKD1(0.38),AKAP6(0.38),SCFD1(0.37),HEATR5A(0.33),DTD2(0) +MEF2C_Coding_Nr1 neurodevelopmental 0.83 Yes MEF2C MEF2C(0.83),NR2F1(0.75),RASA1(0.66),ARRDC3(0.5),COX7C(0.33),CCNH(0.25),CETN3(0.24),LYSMD3(0.11),MBLAC2(0.07),TMEM161B(0),ADGRV1(0),POLR3G(0) +MEF2C_Coding_Nr2 neurodevelopmental 0.83 Yes MEF2C MEF2C(0.83),NR2F1(0.75),ARRDC3(0.5),RASA1(0.5),TMEM161B(0.33),CETN3(0.24),CCNH(0.19),LYSMD3(0.11),MBLAC2(0.07),ADGRV1(0),POLR3G(0) +MEF2C_Coding_Nr3 neurodevelopmental 0.83 Yes MEF2C MEF2C(0.83),RASA1(0.75),CETN3(0.55),CCNH(0.44),LYSMD3(0.33),MBLAC2(0.33),POLR3G(0.33),TMEM161B(0.33),ADGRV1(0) +MEF2C_Coding_Nr4 neurodevelopmental 0.83 Yes MEF2C MEF2C(0.83),RASA1(0.75),CETN3(0.55),CCNH(0.44),LYSMD3(0.33),MBLAC2(0.33),POLR3G(0.33),TMEM161B(0),ADGRV1(0) +SLC2A1_Coding_Nr1 neurodevelopmental 0.83 Yes SLC2A1 SLC2A1(0.83),ZNF691(0.11),ERMAP(0.06),SVBP(0),TMEM269(0) +DLX5&6_Coding_Nr1 limbs 0.83 Yes DLX5 DLX5(0.83),DLX6(0.55),ASNS(0.48),SLC25A13(0.25),TAC1(0.24),LMTK2(0.2),BHLHA15(0.12),DYNC1I1(0.08),OCM2(0),SDHAF3(0),SEM1(0) +DLX5&6_Coding_Nr2 limbs 0.99 Yes DLX5,COL1A2 DLX5(0.99),COL1A2(0.83),PEX1(0.67),TRRAP(0.67),NPTX2(0.67),FZD1(0.66),ASNS(0.64),DLX6(0.56),ANKIB1(0.55),CDK6(0.5),CYP51A1(0.5),ZNF804B(0.5),TMEM130(0.49),PEG10(0.48),AKAP9(0.33),BET1(0.33),BRI3(0.33),CALCR(0.33),CASD1(0.33),CDK14(0.33),CLDN12(0.33),GATAD1(0.33),GNG11(0.33),KRIT1(0.33),PON2(0.33),SAMD9(0.33),SAMD9L(0.33),SGCE(0.33),SLC25A13(0.33),SRI(0.33),STEAP4(0.33),TAC1(0.31),BAIAP2L1(0.28),LMTK2(0.26),RBM48(0.25),FAM133B(0.19),HEPACAM2(0.17),STEAP2(0.17),TECPR1(0.16),GTPBP10(0.11),DYNC1I1(0.11),PPP1R9A(0.09),PDK4(0.06),TFPI2(0.04),ASB4(0),BHLHA15(0),CFAP69(0),ERVW-1(0),FAM237B(0),GNGT1(0),LRRD1(0),MTERF1(0),OCM2(0),PON1(0),PON3(0),PTTG1IP2(0),SDHAF3(0),SEM1(0),STEAP1(0),TEX47(0),VPS50(0)