Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2014 BioSB RNA-seq Command Line Crash Course

2014 BioSB RNA-seq Command Line Crash Course

Command line crash course given in the 2014 BioSB RNA-seq course

Wibowo Arindrarto

July 07, 2014
Tweet

More Decks by Wibowo Arindrarto

Other Decks in Education

Transcript

  1. COMMAND LINE CRASH COURSE BIOSB ADVANCED RNA-SEQ COURSE 2014 Wibowo

    Arindrarto ( ) Leiden University Medical Center based on some materials created by Michiel van Galen ( ) Leiden University Medical Center 0
  2. WHY YOU NEED THE COMMAND LINE Speed Power Automation Reproducibility

    Cutting-edge tech Move all files ending with .txt to a USB drive $ m v * . t x t / m e d i a / U S B Replace "human" with "H. sapiens" in all files in the current directory $ l s | x a r g s s e d - i ' s / h u m a n / H . s a p i e n s / g ' Create a file containing 100 lines of random numbers $ f o r i i n ` s e q 1 1 0 0 ` ; d o e c h o $ R A N D O M > > o u t . t x t ; d o n e Show the last 50 executed commands $ h i s t o r y | t a i l - n 5 0
  3. WHY WE ARE USING LINUX Default interface is already powerful

    MacOS works with small differences here and there Windows not good enough now. Use dual boot, virtual machine, or cygwin if you must
  4. LET'S DIVE IN! Tab-completion helps you complete your command $

    m k d < T A B > man pages provide documentation $ m a n m k d i r "--help" or "-h" flags shows the quick reference $ m k d i r - - h e l p makes it even easier explainshell.com
  5. WHAT AM I LOOKING AT? Prompt c o u r

    s e @ r n a s e q 2 0 1 4 : ~ $ Directory contents . ├ ─ ─ D e s k t o p ├ ─ ─ D o c u m e n t s ├ ─ ─ D o w n l o a d s ├ ─ ─ l i b ├ ─ ─ M u s i c ├ ─ ─ P i c t u r e s ├ ─ ─ P u b l i c ├ ─ ─ T e m p l a t e s └ ─ ─ V i d e o s 9 d i r e c t o r i e s , 0 f i l e s
  6. l s DISPLAYS DIRECTORY CONTENTS Prompt c o u r

    s e @ r n a s e q 2 0 1 4 : ~ $ l s Output D e s k t o p D o c u m e n t s D o w n l o a d s M u s i c P i c t u r e s P u b l i c T e m p l a t e s V i d e o s Directory contents . ├ ─ ─ D e s k t o p ├ ─ ─ D o c u m e n t s ├ ─ ─ D o w n l o a d s ├ ─ ─ l i b ├ ─ ─ M u s i c ├ ─ ─ P i c t u r e s ├ ─ ─ P u b l i c ├ ─ ─ T e m p l a t e s └ ─ ─ V i d e o s 9 d i r e c t o r i e s , 0 f i l e s
  7. p w d SHOWS PATH TO CURRENT LOCATION Prompt $

    p w d Output / h o m e / c o u r s e Directory contents . ├ ─ ─ D e s k t o p ├ ─ ─ D o c u m e n t s ├ ─ ─ D o w n l o a d s ├ ─ ─ l i b ├ ─ ─ M u s i c ├ ─ ─ P i c t u r e s ├ ─ ─ P u b l i c ├ ─ ─ T e m p l a t e s └ ─ ─ V i d e o s 9 d i r e c t o r i e s , 0 f i l e s
  8. c d CHANGES THE CURRENT DIRECTORY Prompt $ c d

    D e s k t o p / d a y _ 0 1 / c l i $ p w d Output / h o m e / c o u r s e / D e s k t o p / d a y _ 0 1 / c l i Directory contents . 0 d i r e c t o r i e s , 0 f i l e s
  9. e c h o PRINTS TO THE SCREEN Prompt $

    e c h o " I k n o w m y A T G C s " Output I k n o w m y A T G C s Directory contents . 0 d i r e c t o r i e s , 0 f i l e s
  10. REDIRECTION Printing to the screen is writing streams of characters

    to the screen You can redirect this stream into a file instead Redirects can overwrite or append to the file Prompt $ e c h o " I k n o w m y A T G C s " > m y _ f i r s t _ f i l e . t x t $ e c h o " H e l l o a g a i n " > > m y _ f i r s t _ f i l e . t x t Output Directory contents . └ ─ ─ m y _ f i r s t _ f i l e . t x t 0 d i r e c t o r i e s , 1 f i l e
  11. c a t SHOWS THE CONTENT OF AN ENTIRE FILE

    Prompt $ c a t m y _ f i r s t _ f i l e . t x t Output I k n o w m y A T G C s H e l l o a g a i n Directory contents . └ ─ ─ m y _ f i r s t _ f i l e . t x t 0 d i r e c t o r i e s , 1 f i l e
  12. l e s s SHOWS FILE CONTENT INTERACTIVELY Prompt $

    l e s s m y _ f i r s t _ f i l e . t x t Output Session I k n o w m y A T G C s H e l l o a g a i n m y _ f i r s t _ f i l e . t x t ( E N D ) Directory contents . └ ─ ─ m y _ f i r s t _ f i l e . t x t 0 d i r e c t o r i e s , 1 f i l e
  13. m v MOVES FILES / DIRECTORIES Prompt $ m v

    m y _ f i r s t _ f i l e . t x t m o v e d . t x t Output Directory contents . └ ─ ─ m o v e d . t x t 0 d i r e c t o r i e s , 1 f i l e
  14. c p COPIES FILES / DIRECTORIES Prompt $ c p

    m o v e d . t x t c o p i e d . t x t Output Directory contents . ├ ─ ─ c o p i e d . t x t └ ─ ─ m o v e d . t x t 0 d i r e c t o r i e s , 2 f i l e s
  15. WORKING WITH FILES Some files contain instructions that the computer

    can execute. These are called executable files, which can be human- readable text file (scripts) or a compiled program (binaries). Executing a bash script $ b a s h m y _ s c r i p t . s h Executing a compiled binary $ s i c k l e s e - f i n p u t . f a s t q - o o u t p u t . f a s t q
  16. CAUTION! By default, c p and m v will overwrite

    files without prompt. There is no recycle bin, so be careful.
  17. THAT'S ALL FOR NOW This is a crash course after

    all Barely touching the tip of the iceberg But enough to do the RNA-seq tutorial today To start the RNA-seq tutorial $ c d . . / r n a s e q