-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53d6b29
commit 7cdf361
Showing
31 changed files
with
3,497 additions
and
2,185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# ignore the special file | ||
**.ipynb linguist-vendored | ||
**.ipynb linguist-vendored | ||
**.R linguist-vendored | ||
** .Rprofile linguist-vendored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,9 @@ | |
*.arrow | ||
*Weights | ||
*.sqlite | ||
*.svg | ||
*.gz | ||
*.whl | ||
|
||
# folder | ||
**/conda/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ results*/ | |
split/ | ||
multi/ | ||
results_bak/ | ||
figures/ | ||
figures/ | ||
hetero/ |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,230 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "7eef7d2f-cc7f-4ab7-bd03-c242ea7ad280", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"Loading required package: ggplot2\n", | ||
"\n", | ||
"Loading required package: ggrepel\n", | ||
"\n", | ||
"Registered S3 methods overwritten by 'ggalt':\n", | ||
" method from \n", | ||
" grid.draw.absoluteGrob ggplot2\n", | ||
" grobHeight.absoluteGrob ggplot2\n", | ||
" grobWidth.absoluteGrob ggplot2\n", | ||
" grobX.absoluteGrob ggplot2\n", | ||
" grobY.absoluteGrob ggplot2\n", | ||
"\n", | ||
"── \u001b[1mAttaching packages\u001b[22m ─────────────────────────────────────────────────────────────────────────────── tidyverse 1.3.2 ──\n", | ||
"\u001b[32m✔\u001b[39m \u001b[34mtibble \u001b[39m 3.1.8 \u001b[32m✔\u001b[39m \u001b[34mdplyr \u001b[39m 1.0.10\n", | ||
"\u001b[32m✔\u001b[39m \u001b[34mtidyr \u001b[39m 1.2.1 \u001b[32m✔\u001b[39m \u001b[34mstringr\u001b[39m 1.5.0 \n", | ||
"\u001b[32m✔\u001b[39m \u001b[34mreadr \u001b[39m 2.1.3 \u001b[32m✔\u001b[39m \u001b[34mforcats\u001b[39m 0.5.2 \n", | ||
"\u001b[32m✔\u001b[39m \u001b[34mpurrr \u001b[39m 1.0.0 \n", | ||
"── \u001b[1mConflicts\u001b[22m ────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──\n", | ||
"\u001b[31m✖\u001b[39m \u001b[34mdplyr\u001b[39m::\u001b[32mfilter()\u001b[39m masks \u001b[34mstats\u001b[39m::filter()\n", | ||
"\u001b[31m✖\u001b[39m \u001b[34mdplyr\u001b[39m::\u001b[32mlag()\u001b[39m masks \u001b[34mstats\u001b[39m::lag()\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"setwd('../../')\n", | ||
"source('.Rprofile')\n", | ||
"setwd('./case/visium_xenium')\n", | ||
"\n", | ||
"library(EnhancedVolcano)\n", | ||
"library(tidyverse)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "e2d0b05f-f1bf-49d0-bd83-3d5d1df4b600", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"\u001b[1m\u001b[22mNew names:\n", | ||
"\u001b[36m•\u001b[39m `` -> `...1`\n", | ||
"\u001b[1mRows: \u001b[22m\u001b[34m18056\u001b[39m \u001b[1mColumns: \u001b[22m\u001b[34m9\u001b[39m\n", | ||
"\u001b[36m──\u001b[39m \u001b[1mColumn specification\u001b[22m \u001b[36m────────────────────────────────────────────────────────────────────────────────────────────────\u001b[39m\n", | ||
"\u001b[1mDelimiter:\u001b[22m \",\"\n", | ||
"\u001b[31mchr\u001b[39m (2): No_name, Yes_name\n", | ||
"\u001b[32mdbl\u001b[39m (7): ...1, No_pval, No_logf, No_scor, Yes_pval, Yes_logf, Yes_scor\n", | ||
"\n", | ||
"\u001b[36mℹ\u001b[39m Use `spec()` to retrieve the full column specification for this data.\n", | ||
"\u001b[36mℹ\u001b[39m Specify the column types or set `show_col_types = FALSE` to quiet this message.\n", | ||
"Warning message:\n", | ||
"“Setting row names on a tibble is deprecated.”\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"hvg <- read_csv('../../data/visium/breast/hvg_align.csv')\n", | ||
"hvg <- hvg[,c('Yes_name','Yes_pval','Yes_logf','Yes_scor')]\n", | ||
"rownames(hvg) <- hvg[['Yes_name']]\n", | ||
"colnames(hvg) <- c('Name','adj.Pval','logFC2','Score')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"id": "d6f16112-c341-4bb3-8145-61cc9b83f946", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# top 25\n", | ||
"top25 <- hvg %>% filter(logFC2 > 1.5 & adj.Pval < 0.05) %>% arrange(-Score) %>% head(25) \n", | ||
"top25 <- as.vector(top25$Name)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"id": "760219ac-3db1-4e5b-a8c9-4df9c57df114", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<style>\n", | ||
".list-inline {list-style: none; margin:0; padding: 0}\n", | ||
".list-inline>li {display: inline-block}\n", | ||
".list-inline>li:not(:last-child)::after {content: \"\\00b7\"; padding: 0 .5ex}\n", | ||
"</style>\n", | ||
"<ol class=list-inline><li>'STC2'</li><li>'TRH'</li><li>'CACNG4'</li><li>'TMEM47'</li><li>'MUCL1'</li><li>'RIMS4'</li><li>'AFF3'</li><li>'CPB1'</li><li>'MAGED2'</li><li>'STARD10'</li><li>'NOS1AP'</li><li>'NEK10'</li><li>'LDLRAD3'</li><li>'PHGR1'</li><li>'MAPT'</li><li>'EREG'</li><li>'IFI27'</li><li>'LAMA3'</li><li>'SULT2B1'</li><li>'TBC1D9'</li><li>'ADCY1'</li><li>'KIAA1324'</li><li>'AUTS2'</li><li>'FAM3B'</li><li>'MCCC2'</li></ol>\n" | ||
], | ||
"text/latex": [ | ||
"\\begin{enumerate*}\n", | ||
"\\item 'STC2'\n", | ||
"\\item 'TRH'\n", | ||
"\\item 'CACNG4'\n", | ||
"\\item 'TMEM47'\n", | ||
"\\item 'MUCL1'\n", | ||
"\\item 'RIMS4'\n", | ||
"\\item 'AFF3'\n", | ||
"\\item 'CPB1'\n", | ||
"\\item 'MAGED2'\n", | ||
"\\item 'STARD10'\n", | ||
"\\item 'NOS1AP'\n", | ||
"\\item 'NEK10'\n", | ||
"\\item 'LDLRAD3'\n", | ||
"\\item 'PHGR1'\n", | ||
"\\item 'MAPT'\n", | ||
"\\item 'EREG'\n", | ||
"\\item 'IFI27'\n", | ||
"\\item 'LAMA3'\n", | ||
"\\item 'SULT2B1'\n", | ||
"\\item 'TBC1D9'\n", | ||
"\\item 'ADCY1'\n", | ||
"\\item 'KIAA1324'\n", | ||
"\\item 'AUTS2'\n", | ||
"\\item 'FAM3B'\n", | ||
"\\item 'MCCC2'\n", | ||
"\\end{enumerate*}\n" | ||
], | ||
"text/markdown": [ | ||
"1. 'STC2'\n", | ||
"2. 'TRH'\n", | ||
"3. 'CACNG4'\n", | ||
"4. 'TMEM47'\n", | ||
"5. 'MUCL1'\n", | ||
"6. 'RIMS4'\n", | ||
"7. 'AFF3'\n", | ||
"8. 'CPB1'\n", | ||
"9. 'MAGED2'\n", | ||
"10. 'STARD10'\n", | ||
"11. 'NOS1AP'\n", | ||
"12. 'NEK10'\n", | ||
"13. 'LDLRAD3'\n", | ||
"14. 'PHGR1'\n", | ||
"15. 'MAPT'\n", | ||
"16. 'EREG'\n", | ||
"17. 'IFI27'\n", | ||
"18. 'LAMA3'\n", | ||
"19. 'SULT2B1'\n", | ||
"20. 'TBC1D9'\n", | ||
"21. 'ADCY1'\n", | ||
"22. 'KIAA1324'\n", | ||
"23. 'AUTS2'\n", | ||
"24. 'FAM3B'\n", | ||
"25. 'MCCC2'\n", | ||
"\n", | ||
"\n" | ||
], | ||
"text/plain": [ | ||
" [1] \"STC2\" \"TRH\" \"CACNG4\" \"TMEM47\" \"MUCL1\" \"RIMS4\" \n", | ||
" [7] \"AFF3\" \"CPB1\" \"MAGED2\" \"STARD10\" \"NOS1AP\" \"NEK10\" \n", | ||
"[13] \"LDLRAD3\" \"PHGR1\" \"MAPT\" \"EREG\" \"IFI27\" \"LAMA3\" \n", | ||
"[19] \"SULT2B1\" \"TBC1D9\" \"ADCY1\" \"KIAA1324\" \"AUTS2\" \"FAM3B\" \n", | ||
"[25] \"MCCC2\" " | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"top25" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 21, | ||
"id": "af31222e-4ef7-4b41-a7e3-da4db650aa06", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"options(repr.plot.width=13, repr.plot.height=12)\n", | ||
"p1 <- EnhancedVolcano(hvg, lab = rownames(hvg), x = 'logFC2', y= 'adj.Pval', xlim = c(-6,6), ylim = c(0,6), FCcutoff = 1.5, pCutoff = 0.05, labSize =7,axisLabSize =24,\n", | ||
" colAlpha = 1,\n", | ||
" xlab = 'log2 fold change', ylab = 'log10 adjust P.value',\n", | ||
" # selectLab = top25,\n", | ||
" # col = c(\"grey30\", \"grey30\", \"grey30\", \"red2\"),\n", | ||
" # drawConnectors = TRUE,\n", | ||
" title = '', subtitle ='',\n", | ||
" pointSize = c(ifelse((hvg$\"logFC2\">1.5 |hvg$\"logFC2\"< -1.5) & hvg$\"adj.Pval\"<0.05 , 2.5, 1.5)),\n", | ||
" legendLabels =c('NS','log2FC only','adj.P only','Significant'),\n", | ||
" legendPosition = 'right',\n", | ||
" legendLabSize = 22)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 24, | ||
"id": "a0cd6eb7-9738-42a6-9cec-74a7efee1afb", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"ggsave('./volcano.svg',p1, width = 13, height = 12)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "slat_r", | ||
"language": "R", | ||
"name": "slat_r" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": "r", | ||
"file_extension": ".r", | ||
"mimetype": "text/x-r-source", | ||
"name": "R", | ||
"pygments_lexer": "r", | ||
"version": "4.1.3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.