Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
how_to [2019/10/20 23:05]
admin [Access a Bioconductor package source code?]
how_to [2020/01/22 18:53] (current)
isha [Read and write excel files in R]
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 18: Line 34:
 ---- ----
  
-Add only [[http://​stackoverflow.com/​questions/​7124726/​git-add-only-modified-changes-and-ignore-untracked-files|modified]] changes and ignore untracked files using git?+===== Add only modified changes and ignore untracked files using git? =====
  
 <​code>​ <​code>​
Line 24: Line 40:
 </​code>​ </​code>​
  
-If there is a conflict at push time, first pull. Now, you need to look for ">>>"​ in the code, and manually fix the conflict. Then, push again.+The [[https://​stackoverflow.com/​questions/​7124726/​git-add-only-modified-changes-and-ignore-untracked-files|above]] should work if there is no conflict. ​If there is a conflict at push time, first pull. Now, you need to look for ">>>"​ in the code, and manually fix the conflict. Then, push again.
  
 ---- ----
 +
  
 ==== Use a package that is being developed? ==== ==== Use a package that is being developed? ====
Line 193: Line 210:
 ---- ----
  
-**Write a scientific paper?** \\+===== Write a scientific paper? ​===== 
 Put the figures together and then [[http://​www.scidev.net/​global/​publishing/​practical-guide/​how-do-i-write-a-scientific-paper-.html|draft]] different [[https://​www.nature.com/​articles/​nmeth.4532?​WT.ec_id=NMETH-201712&​spMailingID=55474826&​spUserID=MTIyMzczNjc4MDI2S0&​spJobID=1285409878&​spReportId=MTI4NTQwOTg3OAS2|sections]]. Focus the [[http://​www.grantcentral.com/​strategies-for-avoiding-common-problems-with-research-manuscripts/​|Discussion]]. Be careful about [[http://​colah.github.io/​posts/​2019-05-Collaboration/​index.html|authorship]]. Put the figures together and then [[http://​www.scidev.net/​global/​publishing/​practical-guide/​how-do-i-write-a-scientific-paper-.html|draft]] different [[https://​www.nature.com/​articles/​nmeth.4532?​WT.ec_id=NMETH-201712&​spMailingID=55474826&​spUserID=MTIyMzczNjc4MDI2S0&​spJobID=1285409878&​spReportId=MTI4NTQwOTg3OAS2|sections]]. Focus the [[http://​www.grantcentral.com/​strategies-for-avoiding-common-problems-with-research-manuscripts/​|Discussion]]. Be careful about [[http://​colah.github.io/​posts/​2019-05-Collaboration/​index.html|authorship]].
  
 ---- ----
  
-**Prepare or review computational biology papers for Nature methods?** \\+===== Prepare or review computational biology papers for Nature methods? ​===== 
 Read their "​Reviewing computational methods"​ ([[http://​www.nature.com/​nmeth/​journal/​v12/​n12/​full/​nmeth.3686.html|2015]]) and "​Guidelines for algorithms and software in Nature Methods"​ ([[http://​blogs.nature.com/​methagora/​2014/​02/​guidelines-for-algorithms-and-software-in-nature-methods.html|2014]]) articles. Provide source code, pseudocode, compiled executables,​ and the mathematical description. Softwares must be accompanied with documentation,​ sample data and the expected output, and a license (e.g., GPL≥2). Have a look at [[:​the_list_of_computational_biology_papers_in_nature_methods|The list of computational biology papers in Nature Methods]] published in 2015, and the [[https://​www.google.com/​url?​sa=t&​rct=j&​q=&​esrc=s&​source=web&​cd=9&​cad=rja&​uact=8&​ved=0ahUKEwic2Oum3dvJAhUGeSYKHWurD-EQFghQMAg&​url=http%3A%2F%2Ford.ntu.edu.tw%2Ftc%2Fincludes%2FGetFile.ashx%3FmID%3D253%26id%3D1744%26chk%3De15262f3-87bf-4a7e-be6a-4103cbc61968&​usg=AFQjCNHfNXyryLDQMWBRrInOpJVKIL0LCA&​sig2=8C9UE1arY4vi2q_CUdsdiQ|hints]] by an editor of Nature Communications. Read their "​Reviewing computational methods"​ ([[http://​www.nature.com/​nmeth/​journal/​v12/​n12/​full/​nmeth.3686.html|2015]]) and "​Guidelines for algorithms and software in Nature Methods"​ ([[http://​blogs.nature.com/​methagora/​2014/​02/​guidelines-for-algorithms-and-software-in-nature-methods.html|2014]]) articles. Provide source code, pseudocode, compiled executables,​ and the mathematical description. Softwares must be accompanied with documentation,​ sample data and the expected output, and a license (e.g., GPL≥2). Have a look at [[:​the_list_of_computational_biology_papers_in_nature_methods|The list of computational biology papers in Nature Methods]] published in 2015, and the [[https://​www.google.com/​url?​sa=t&​rct=j&​q=&​esrc=s&​source=web&​cd=9&​cad=rja&​uact=8&​ved=0ahUKEwic2Oum3dvJAhUGeSYKHWurD-EQFghQMAg&​url=http%3A%2F%2Ford.ntu.edu.tw%2Ftc%2Fincludes%2FGetFile.ashx%3FmID%3D253%26id%3D1744%26chk%3De15262f3-87bf-4a7e-be6a-4103cbc61968&​usg=AFQjCNHfNXyryLDQMWBRrInOpJVKIL0LCA&​sig2=8C9UE1arY4vi2q_CUdsdiQ|hints]] by an editor of Nature Communications.
  
 ---- ----
  
-**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 211: Line 231:
  
 ---- ----
 +
  
 ==== Get older versions using git? ==== ==== Get older versions using git? ====
Line 225: 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 ? ===== 
 Use a "home slide"​. Also, learn about other tips from Susan [[https://​www.youtube.com/​watch?​v=Hp7Id3Yb9XQ|McConnell]]. Use a "home slide"​. Also, learn about other tips from Susan [[https://​www.youtube.com/​watch?​v=Hp7Id3Yb9XQ|McConnell]].
  
 ---- ----
 +
  
 ==== Access a Bioconductor package source code? ==== ==== Access a Bioconductor package source code? ====
Line 418: 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.
 +
 +----