Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
how_to [2020/01/21 20:50] – [Prepare or review computational biology papers for Nature methods?] adminhow_to [2020/01/22 16:53] – [Read and write excel files in R] isha
Line 4: Line 4:
  
 ---- ----
 +
 +==== Read and write excel files in R ====
 +
 +Use [[https://cran.r-project.org/web/packages/openxlsx/index.html|openxlsx]] package to read, write and edit xlsx files in R. Package's integration with C++ makes it faster and easier to use. Simplifies the creation of Excel .xlsx files by providing a high level interface to writing, styling and editing worksheets. Through the use of 'Rcpp', read/write times are comparable to the 'xlsx' and 'XLConnect' packages with the added benefit of removing the dependency on Java.
 +
 +<code>
 +E.g. Writing four dataframes in four sheets of excel workbook can be done as follows:
 +library(openxlsx)
 +listDataFrames <- list("GO-BP"=data.frame(egoBP), "GO-MF"=data.frame(egoMF),
 +                       "KEGG" = data.frame(eKEGG), "NCG" = data.frame(ncg))
 +xlsFile <- file.path(resultPath, paste0(l1, "_ORA_results.xlsx"))
 +write.xlsx(x=listDataFrames, file=xlsFile)
 +</code>
 +
 +----
 +
  
 ==== Set local mirror for Rscript ==== ==== Set local mirror for Rscript ====
Line 206: Line 222:
 ---- ----
  
-=====   Set the default width of fill mode (line length) in emacs?   =====+===== Set the default width of fill mode (line length) in emacs? =====
  
-=====   ===== 
- 
-\\ 
 [[http://stackoverflow.com/questions/3566727/how-to-set-the-default-width-of-fill-mode-to-80-with-emacs|Use]] 'M-x customize-variable' to set 'fill-column' (100 in Oncinfo). Use DejaVu Sans Mono (~[[http://www.leancrew.com/all-this/2009/10/the-compleat-menlovera-sans-comparison/|Menlo]] on MacOS) size 18-20 is an [[http://ergoemacs.org/emacs/emacs_unicode_fonts.html|appropriate]] font for programming in Emacs. To do so, you may need to manually edit your .emacs in [[https://stackoverflow.com/questions/4821984/emacs-osx-default-font-setting-does-not-persist|macOS]], and add the following [[https://stackoverflow.com/questions/4879785/can-i-break-the-long-line-in-emacs-non-windows-to-the-next-line|line]]: [[http://stackoverflow.com/questions/3566727/how-to-set-the-default-width-of-fill-mode-to-80-with-emacs|Use]] 'M-x customize-variable' to set 'fill-column' (100 in Oncinfo). Use DejaVu Sans Mono (~[[http://www.leancrew.com/all-this/2009/10/the-compleat-menlovera-sans-comparison/|Menlo]] on MacOS) size 18-20 is an [[http://ergoemacs.org/emacs/emacs_unicode_fonts.html|appropriate]] font for programming in Emacs. To do so, you may need to manually edit your .emacs in [[https://stackoverflow.com/questions/4821984/emacs-osx-default-font-setting-does-not-persist|macOS]], and add the following [[https://stackoverflow.com/questions/4879785/can-i-break-the-long-line-in-emacs-non-windows-to-the-next-line|line]]:
  
Line 216: Line 229:
 (setq truncate-lines nil) (setq truncate-lines nil)
 </code> </code>
 +
 +----
  
  
Line 231: Line 246:
 ---- ----
  
-**Convert gene or protein IDs?** \\+===== Convert gene or protein IDs? ===== 
 [[https://www.biostars.org/p/22/|Use]] [[https://biodbnet-abcc.ncifcrf.gov/db/db2db.php|bioDBnet]], BioMart - Ensembl, or [[https://bioconductor.org/packages/release/bioc/html/AnnotationDbi.html|AnnotationDbi]] package in R to convert between Entrez Gene, RefSeq, Ensemble, and many more. [[https://www.biostars.org/p/22/|Use]] [[https://biodbnet-abcc.ncifcrf.gov/db/db2db.php|bioDBnet]], BioMart - Ensembl, or [[https://bioconductor.org/packages/release/bioc/html/AnnotationDbi.html|AnnotationDbi]] package in R to convert between Entrez Gene, RefSeq, Ensemble, and many more.
  
 ---- ----
 +
  
 ===== Prepare attractive, scientific presentations ? ===== ===== Prepare attractive, scientific presentations ? =====
Line 426: Line 443:
  
 Logitech Control Center may help on the [[https://support.logi.com/hc/en-gb/articles/360025297833-Logitech-Control-Center-for-Macintosh-OS-X|Logitech]] MX mice older than 2019. Logitech Control Center may help on the [[https://support.logi.com/hc/en-gb/articles/360025297833-Logitech-Control-Center-for-Macintosh-OS-X|Logitech]] MX mice older than 2019.
 +
 +----
 +
 +===== Choose a solid state (SSD) external drive? =====
 +
 +The non-volatile memory express (NVMe) devices are [[https://ssd.borecraft.com/SSD_Buying_Guide_List.pdf|better]] than SATA solid state drives. Good brands include [[https://smile.amazon.com/gp/product/B07X6CKHH1/ref=ox_sc_act_title_1?smid=A29Y8OP2GPR7PE&psc=1|Sabrent]] (Nano is smaller than Pro but gets hot when extensivly used), Seagete, Addlink, and Team. As of 2020, a speed of 1000 Mb/s is possible using USB 3.2.
 +
 +----