Differences

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

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
how_to [2020/01/21 21:00] – [Choose a solid state (SSD) external drive?] adminhow_to [2020/03/02 15:39] – [Write in xls files from R?] admin
Line 4: Line 4:
  
 ---- ----
 +
 +==== Work with screen sessions? ====
 +
 +There are five main [[http://www.pixelbeat.org/lkdb/screen.html|commands]] while working with screen session:
 +
 +  - Start and name a screen: ''screen -S <NAME of the screen>''
 +  - Detach from a screen: ''Ctrl+a d''
 +  - See the list of active screens: ''screen -ls''
 +  - Reattach to a screen: ''screen -r <NAME of the screen>''
 +  - Quit and kill your screen: ''Ctrl+a ''  then ''Ctrl+\''
 +
 +----
 +
 +
 +==== 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 84: Line 113:
 ---- ----
  
-**Write in xls files from R?** \\ +====   Restore a file    deleted     in a local git directory  ====
-Use [[http://www.inside-r.org/packages/cran/XLConnect/docs/writeWorksheetToFile|writeWorksheetToFile]]() function from [[http://cran.r-project.org/web/packages/XLConnect/index.html|XLConnect]] package like below:+
  
-<code> +\\
-writeWorksheetToFile(data=matrix(1:10,2,2),file='./temp.xls',sheet='test1'+
-writeWorksheetToFile(data=matrix(1:6,2,3),file='./temp.xls',sheet='test2'+
-</code> +
- +
----- +
- +
-**Restore a file** **deleted ****in a local git directory?** \\+
 [[http://stackoverflow.com/questions/9305326/why-doesnt-git-pull-bring-back-directories-that-ive-deleted|Use]] git reset –hard to completely bring your working directory to HEAD state. However, this is a [[http://stackoverflow.com/questions/5473/how-can-i-undo-git-reset-hard-head1|dangerous]] command because you may loose some local files that are not pushed yet. [[http://stackoverflow.com/questions/9305326/why-doesnt-git-pull-bring-back-directories-that-ive-deleted|Use]] git reset –hard to completely bring your working directory to HEAD state. However, this is a [[http://stackoverflow.com/questions/5473/how-can-i-undo-git-reset-hard-head1|dangerous]] command because you may loose some local files that are not pushed yet.
  
 ---- ----
  
-**Get familiar with machine learning and its applications in computational biology? ** \\+====   Get familiar with machine learning and its applications in computational biology?    ==== 
 - Most common ML techniques are very well explained in [[https://scikit-learn.org/stable/user_guide.html|Scikit learn]] with [[https://scikit-learn.org/stable/modules/decomposition.html|illustrations]] and example Python code. These techniques have been implemented in [[https://www.kaggle.com/getting-started/5243|R]] packages including mlr3 and tidymodels. - Most common ML techniques are very well explained in [[https://scikit-learn.org/stable/user_guide.html|Scikit learn]] with [[https://scikit-learn.org/stable/modules/decomposition.html|illustrations]] and example Python code. These techniques have been implemented in [[https://www.kaggle.com/getting-started/5243|R]] packages including mlr3 and tidymodels.
  
Line 106: Line 128:
 ---- ----
  
-**Get access to the papers through the library when you are off-campus?** \\ + 
-First add the following to your browser (Chrome or Firefox) bookmarks.+==== Get access to the papers through the library when you are off-campus? ==== 
 + 
 +In any of these two ways:\\ 
 +a) First add the following to your browser (Chrome or Firefox) bookmarks.
  
 <code> <code>
Line 114: Line 139:
  
 Then, on the journal page, click on the bookmark. Login and start reading. Then, on the journal page, click on the bookmark. Login and start reading.
 +
 +b) Use [[https://infosec.uthscsa.edu/two-factor-enrollment|GlobalProtect]], which is the University VPN.
  
 ---- ----
  
-**Convert pdf to MS word?** \\ + 
-Try whatever you can to avoid conversion! Instead, educate your team and your collaborators to use [[https://www.authorea.com/users/54336|Authorea]], [[https://www.overleaf.com/|Overleaf]] or at least google doc. __Only__ if your biologist collaborators cannot [[http://www.dedoimedo.com/computers/latex.html|unfortunately]] edit the LaTeX source, consider using a conversion tool such as docs.[[https://docs.zone/|zone]]. Alternatively, Acrobat Pro can export a .pdf as a .doc file. If Bibtex is not an option, use [[http://www.easybib.com/|EasyBib]].+==== Convert pdf to MS word? ==== 
 + 
 +Try whatever you can to avoid conversion! Instead, educate your team and your collaborators to use [[https://www.authorea.com/users/54336|Authorea]], [[https://www.overleaf.com/|Overleaf]] or at least Google Doc. In Google Doc, references can be easily handled using [[https://gsuite.google.com/marketplace/app/paperpile/894076725911|Paperpile]] add-on, and figures can be automatically numbered using the the [[https://gsuite.google.com/marketplace/app/cross_reference/269114033347?pann=cwsdp&hl=en|Cross Reference]] add-on as suggested in these [[https://lcolladotor.github.io/2019/04/02/how-to-write-academic-documents-with-googledocs/#.Xjne6RNKjUI|guidelines]] on how to write academic documents with Google Docs . __Only__ if your biologist collaborators cannot [[http://www.dedoimedo.com/computers/latex.html|unfortunately]] edit the LaTeX source, consider using a conversion tool such as docs.[[https://docs.zone/|zone]]. Alternatively, Acrobat Pro can export a .pdf as a .doc file. If Bibtex is not an option, use [[http://www.easybib.com/|EasyBib]].
  
 ---- ----
  
-**Enable spell check in Emacs on OS X?** \\+ 
 +==== Enable spell check in Emacs on OS X? ==== 
 The default Aquamacs spell checker has some issues. To replace it, first [[http://stackoverflow.com/questions/19022015/emacs-on-mac-os-x-how-to-get-spell-check-to-work|install]] Aspell, which is a [[https://en.wikipedia.org/wiki/GNU_Aspell|replacement]] for Ispell: The default Aquamacs spell checker has some issues. To replace it, first [[http://stackoverflow.com/questions/19022015/emacs-on-mac-os-x-how-to-get-spell-check-to-work|install]] Aspell, which is a [[https://en.wikipedia.org/wiki/GNU_Aspell|replacement]] for Ispell:
  
Line 137: Line 168:
 ---- ----
  
-**Do microaray analysis or anything else in Bioconductor?** \\+==== Do microaray analysis or anything else in Bioconductor? ==== 
 [[http://manuals.bioinformatics.ucr.edu/home/R_BioCondManual#TOC-Affy|This ]] is an excellent site with many well commented code examples and a lot of handy short-cuts. See also [[:how_to|Functional analysis tools]]. [[http://manuals.bioinformatics.ucr.edu/home/R_BioCondManual#TOC-Affy|This ]] is an excellent site with many well commented code examples and a lot of handy short-cuts. See also [[:how_to|Functional analysis tools]].
  
Line 420: Line 452:
 ==== Disable scroll acceleration in macOS? ==== ==== Disable scroll acceleration in macOS? ====
  
-Install and [[https://www.reddit.com/r/osx/comments/6kx6zb/how_to_disable_mouse_scrolling_acceleration/|use]] USB [[http://www.usboverdrive.com/USBOverdrive/Information.html|Overdrive]] to set Wheel up and down "Speed" to say, 6 lines. The following [[https://apple.stackexchange.com/questions/253111/how-to-disable-scroll-acceleration-in-macos-sierra|command]] does NOT work:+Install and [[https://www.reddit.com/r/osx/comments/6kx6zb/how_to_disable_mouse_scrolling_acceleration/|use]] USB [[http://www.usboverdrive.com/USBOverdrive/Information.html|Overdrive]] to set Wheel up and down "Speed" of your mouse to say, 6 lines. The following [[https://apple.stackexchange.com/questions/253111/how-to-disable-scroll-acceleration-in-macos-sierra|command]] does NOT work:
  
 <code> <code>
Line 429: Line 461:
  
 ---- ----
 +
  
 ===== Choose a solid state (SSD) external drive? ===== ===== 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/Sabrent-Rocket-External-Aluminum-SB-1TB-PRO/dp/B07X6CKHH1/ref=sr_1_1_sspa?keywords=ssd+solid+"970+evo"+external&qid=1579637189&s=pc&sr=1-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUFGS01DRDJXV0RDVkgmZW5jcnlwdGVkSWQ9QTA4NzA4MTYxUjVZU1pZTVMxVUNJJmVuY3J5cHRlZEFkSWQ9QTA0NjI4NzQzOUY5Slg1NjdQQ0ZOJndpZGdldE5hbWU9c3BfYXRmJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==|Sabrent]], Seagete, Addlink, and Team.+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. 
 + 
 +---- 
 + 
 +===== Work with screen session? ===== 
 + 
 +There are five main [[http://www.pixelbeat.org/lkdb/screen.html|commands]] while working with screen session: 
 + 
 +  - Start and name a screen: ''screen -S $NAME'' 
 +  - Detach from a screen: ''Ctrl+a d'' 
 +  - See the list of active screens: ''screen -ls'' 
 +  - Reattach to a screen: ''screen -r $NAME'' 
 +  - Quit and [[https://askubuntu.com/questions/356006/kill-a-screen-session|kill]] your screen: ''Ctrl+a then Ctrl+\''
  
 ---- ----