From 21d4e89975bbfaf3aeab87c4f78bc810a147827c Mon Sep 17 00:00:00 2001 From: freefire <97975089@qq.com> Date: Sun, 12 Jan 2025 03:27:50 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=9B=B4=E6=96=B0ui=E5=92=8CR=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/CircosHeatmap-aardio.exe | Bin 1465856 -> 1476096 bytes main.aardio | 11 +++++------ res/heatmap_script.R | 26 +++++++++++++------------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/dist/CircosHeatmap-aardio.exe b/dist/CircosHeatmap-aardio.exe index fe0cc6715d3ea8995241ca723bef05975a59fb25..f271b479c2e3df6a0d2679d1cf0ccc5c507ffef2 100644 GIT binary patch delta 11552 zcmeI2e{@sFmB;UUlEL^%w&dSH5@d%TCOD2Er1?S8JjpiLlz;;ykcJiuOSVO2NwsA# z#6%<6#u!YGX}WoAn%z3>HlZ}#xZ7;a+5D)4p@D`bCfgp;obJ}y0wHPIy4`M?&34oM z&U+*4nY2CqW6%DxRnGV`bLZ!~b7$tx5cd27Z0M7tWs-EqBjwUf(!?Vhr8_L|wkq2B z|H`@jku%b04iZF72yMLyc_1N62%HuKD?%2+EQHwz*$8tGa>f#}a&Uf3CMz`+5L1cR z@HNC77Gf46ssMArZqNY^gQegx5YT^C{N0MshWbg!yTRANVQ>n363n(D4|IWVfVY9a z1{*;~A;nl5B2|UN7`PTZ3buixU>|q}JONIEAA;|L#YL!`MQkxx0ji)1t_8P(+rS7I z1rLCq2S>ms!4u#=ffL|FQHA6O3_0Gq(S1-ro~!C~+OcnrJ*c|foH&r;3O!|hX%k3(4pYV!3r<}s^FKwt>7sz0{#L#02acy zN5D$(1XvGFC@x|hh+Kg{H);H_B1i~FAt#&mp-U;gz0`(|A*%-Y>Zk{Kxh60R>;`9n z!{BW27?=$vwR_5x66tkqAIFpqYqp)3Hd>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sG->Fe5XP4NLaAm(d=>IZ=~t zWRy2-3TkHLH|%nM3nT6Gp|qw8n-CisOa&Q54Fg)*f&6Rq^5aRwh8b#p1mz7&R+kxP z^bC%KQU?u>Gcp^dxcSG~T`ls8Dcf^{d}9UQ@*BI7{isdeep|VP8hOiu@-6B6+sSkX zns^Lp4u5;yuc~_7UW~WlQ}oWcU*S)#vozO^0X$@;_BYI0*|JAbhtoEb*`(6RcGXmf z+qaocqTNSTydKp{KBv7Zx0zlcGMz$S4WtrI9DePOJWhVwIlG&`a!9uE(`USle>v>2 z@P$KiYuWS|e>LazIhv2On=w%o3Wv$cQ-|esJYMc*JeHQ_Rr_)9NIbTR)o{ha{FVbl z{o(rhg7d{y%vCU{w|}TN)_*8c%-LAXPFtA0m>rJ9!^yOkfIwJ8uRj^wcr2hEe$nd`2B;yY!=ctmD? z_@vD0__|75I47h2^W$=@yS}hoiDXl6ED{>>qxKp*+f*zyXlIT5gq>Zb6|Lh-c6JSK zaj?~VorAeGyH@*W4d3fz6=kgr#XQx?Y+CT@n0z&#aI&kux{I}vwhx992ZlleT5sPH z9R&=1d{)V>zPuxw=tb6AU#E?#iZ47a`-=8gC+@M*#o9JX%H_W!|97jH@y+3|5{n$b zP?T8czDO*|A9k_z{ACyJ{CyYm*Gby;YzhyB9`MHw)N6~RRq0K{Mh43?BAapyU^-Dszh=k zxscpQp6rEI?{$xGXVzQ6-~70$dW>bgNWLt~R^78R8}PEv_V903IM(qU33h``>qq-p wvX3X2x6HIr`_HVc*`OSyCB9bH|Wn>#unmvCA9Uyp1=C;$Ke diff --git a/main.aardio b/main.aardio index 8e3a98f..4ac0a3e 100644 --- a/main.aardio +++ b/main.aardio @@ -2,10 +2,10 @@ import win.ui; /*DSG{{*/ mainForm = win.form(text="CircosHeatmap-aardio";right=800;bottom=600) mainForm.add( - editConsole={cls="edit";left=10;top=120;right=780;bottom=580;db=1;dl=1;dr=1;dt=1;edge=1;multiline=1;z=1}, - inputFile={cls="edit";left=10;top=10;right=600;bottom=40;edge=1;z=2}, - btnSelectFile={cls="button";text="选择输入文件";left=610;top=10;right=730;bottom=40;z=3}, - btnRun={cls="button";text="运行";left=740;top=10;right=780;bottom=40;z=4} +btnRun={cls="button";text="运行";left=740;top=10;right=780;bottom=40;z=4}; +btnSelectFile={cls="button";text="选择输入文件";left=607;top=11;right=727;bottom=41;z=3}; +editConsole={cls="edit";left=10;top=120;right=780;bottom=580;db=1;dl=1;dr=1;dt=1;edge=1;multiline=1;z=1}; +inputFile={cls="edit";left=10;top=10;right=600;bottom=40;edge=1;z=2} ) /*}}*/ @@ -41,8 +41,7 @@ mainForm.btnRun.oncommand = function(id, event) { // 将 R 脚本的输出显示在控制台中 mainForm.editConsole.print(out); - - console.log("Circos热图已成功保存至: " + outputFilePath); + mainForm.editConsole.print("Circos热图已成功保存至: " + outputFilePath); } // 显示主窗口 diff --git a/res/heatmap_script.R b/res/heatmap_script.R index fac303a..89cf89e 100644 --- a/res/heatmap_script.R +++ b/res/heatmap_script.R @@ -8,7 +8,7 @@ suppressPackageStartupMessages(library(dendsort)) suppressPackageStartupMessages(library(gridBase)) # Get arguments from the command line -args=commandArgs(T); +args <- commandArgs(T) # Check the number of arguments if (length(args) != 2) { @@ -71,7 +71,7 @@ message("Drawing the circular heatmap with adjusted and beautified dendrogram... circos.par(gap.after = c(30)) circos.heatmap(cir1, col = mycol, dend.side = "inside", rownames.side = "outside", - track.height = 0.28, + track.height = 0.35, rownames.col = "black", rownames.cex = 1.3, rownames.font = 1.3, @@ -80,29 +80,29 @@ circos.heatmap(cir1, col = mycol, dend.side = "inside", dend.callback = function(dend, m, si) { color_branches(dend, k = 15, col = 1:15) }) -circos.clear() -# Add legend labels -message("Adding legend labels...") -lg <- Legend(title = "Exp", col_fun = mycol, - direction = c("vertical")) -grid.draw(lg) - -# Add column names -message("Adding column names...") +# 添加列名 circos.track(track.index = get.current.track.index(), panel.fun = function(x, y) { if (CELL_META$sector.numeric.index == 1) { cn <- colnames(cir1) n <- length(cn) + # Adjust the x and y positions circos.text(rep(CELL_META$cell.xlim[2], n) + convert_x(0.5, "mm"), - 1:n + 5, + 1:n + 2.5, cn, cex = 0.6, adj = c(0, 0.5), facing = "inside") } }, bg.border = NA) +# 添加图例 +message("Adding legend labels...") +lg <- Legend(title = "Exp", col_fun = mycol, direction = "vertical") +message("The heatmap has been successfully saved to: ", output_pdf) +grid.draw(lg) + +# 清除环形图 circos.clear() # Close the PDF device dev.off() -message("The heatmap has been successfully saved to: ", output_pdf) +message("The heatmap has been successfully saved to: ", output_pdf) \ No newline at end of file