09.qmd (5081B)
1 --- 2 title: Cohort 9 3 --- 4 5 {{< video https://www.youtube.com/embed/IcYVNhpoB3w >}} 6 7 <details> 8 9 <summary>Meeting chat log</summary> 10 ``` 11 00:05:48 Jeffrey Stevens: I"ve never understood tryCatch() 12 00:09:29 Jo Hardin: you are a great facilitator, Olivier! 13 00:09:34 Olivier Leroy: start 14 00:09:41 Jeffrey Stevens: Reacted to "you are a great faci..." with ๐ฏ 15 00:10:09 Diana Garcia Cortes: Reacted to "you are a great faci..." with ๐ฏ 16 00:12:59 Leo: Reacted to "you are a great faci..." with ๐ 17 00:15:12 Howard Baek: https://style.tidyverse.org/error-messages.html 18 00:15:29 Olivier Leroy: The stop function take โฆ as arguments 19 00:17:48 Olivier Leroy: I had a โhow now I understand why warning are staking moment reading that partโ 20 00:21:10 Diana Garcia Cortes: https://statisticsglobe.com/errors-warnings-r 21 00:29:42 Olivier Leroy: I use message to return side effect like โwhere the file is downloadedโ even if you can hide that in other pLACE 22 00:31:52 Steffi LaZerte (she/her): Sorry I'm late! 23 00:32:18 Jeffrey Stevens: Reacted to "Sorry I'm late!" with ๐ 24 00:32:28 Olivier Leroy: Replying to "Sorry I'm late!" 25 26 No worries welcome! 27 00:32:30 Diana Garcia Cortes: From the ComplexHeatmap package from Bioconductor: 28 29 library(ComplexHeatmap) 30 Loading required package: grid 31 ======================================== 32 ComplexHeatmap version 2.18.0 33 Bioconductor page: http://bioconductor.org/packages/ComplexHeatmap/ 34 Github page: https://github.com/jokergoo/ComplexHeatmap 35 Documentation: http://jokergoo.github.io/ComplexHeatmap-reference 36 37 If you use it in published research, please cite either one: 38 - Gu, Z. Complex Heatmap Visualization. iMeta 2022. 39 - Gu, Z. Complex heatmaps reveal patterns and correlations in multidimensional 40 genomic data. Bioinformatics 2016. 41 42 43 The new InteractiveComplexHeatmap package can directly export static 44 complex heatmaps into an interactive Shiny app with zero effort. Have a try! 45 46 This message can be suppressed by: 47 suppressPackageStartupMessages(library(ComplexHeatmap)) 48 ======================================== 49 00:32:50 Olivier Leroy: Reacted to "From the ComplexHeat..." with ๐ป 50 00:33:08 Jeffrey Stevens: Reacted to "From the ComplexHeat..." with ๐ฑ 51 00:33:52 Olivier Leroy: Reacted to "Sorry I'm late!" with ๐ 52 00:34:36 Olivier Leroy: Just new line 53 00:35:45 Olivier Leroy: That is how you can create nice message in ComplexHeatmap ๐ 54 00:35:59 Jeffrey Stevens: What's the difference between cat() and print()? 55 00:36:17 Steffi LaZerte (she/her): Reacted to "No worries welcome!" with ๐ 56 00:37:08 Jeffrey Stevens: print() is creating a vector? 57 00:38:24 Diana Garcia Cortes: Print receives an object as an argument, cat has โฆ 58 00:38:37 Jeffrey Stevens: OK, thanks 59 00:38:56 Howard Baek: https://stackoverflow.com/questions/31843662/what-is-the-difference-between-cat-and-print 60 00:40:40 Diana Garcia Cortes: Iโll start using message() instead of cat() to tell myself what Iโm doing in my own code ๐ 61 00:41:11 Olivier Leroy: Replying to "Iโll start using mes..." 62 63 I am an huge print user also ๐ 64 00:41:28 Diana Garcia Cortes: Reacted to "I am an huge print u..." with ๐ 65 00:41:30 Steffi LaZerte (she/her): Message is much nicer to handle, I find. I use cat() if I'm print text that I need to copy/paste elsewhere 66 00:41:36 Olivier Leroy: Reacted to "Iโll start using mes..." with โ 67 00:42:26 Diana Garcia Cortes: Reacted to "Message is much nice..." with ๐ฎ 68 00:42:42 Steffi LaZerte (she/her): Another difference between cat and print is that cat will 'print' the line breaks appropriately: 69 70 > print("hi\neveryone") 71 [1] "hi\neveryone" 72 > cat("hi\neveryone") 73 hi 74 everyone 75 > 76 00:42:56 Olivier Leroy: Reacted to "Another difference b..." with ๐ 77 00:44:53 Diana Garcia Cortes: Reacted to "Another difference b..." with ๐ 78 00:46:10 Steffi LaZerte (she/her): I've always used what they don't recommend here, using try() and checking the class for "try-error" rather than using tryCatch() because I could never understand how to use tryCatch() ๐ 79 80 I'm looking forward to figuring this out! 81 00:46:32 Jeffrey Stevens: Reacted to "I've always used wha..." with ๐ฏ 82 00:49:34 Olivier Leroy: Add a print so we had to path to check ๐ 83 00:50:25 Steffi LaZerte (she/her): Reacted to "Add a print so we ha..." with ๐คฃ 84 00:51:38 Jo Hardin: i totally agree Olivier. seems like itโs very hard to understand the `tryCatch()` flow. 85 00:54:19 Jo Hardin: it makes me think a little bit about the logic / flow of the arguments in `ifelse()` or `case_when()`. 86 00:54:52 Diana Garcia Cortes: rows <- tryCatch({ 87 vroom(snakemake@params[["row_filter_file"]], delim = "\t") %>% 88 clean_names() %>% pull(1) 89 }, error = function(e) { 90 print("No row filter file found") 91 NULL 92 message(โNo row filter file found") 93 94 }) 95 01:03:04 Jeffrey Stevens: I'm surprised the chapter didn't reference the {cli} package. Do you all use it? 96 https://cli.r-lib.org/index.html 97 01:03:54 Jeffrey Stevens: Beautiful messaging 98 01:04:20 Steffi LaZerte (she/her): Reacted to "rows <- tryCatch({ 99 ..." with ๐ฏ 100 01:04:57 Olivier Leroy: End 101 ``` 102 </details>