📗
Essential Python For Genome Science
  • Before Start
  • Chapter Contents
  • Prerequisites
    • About the UNIX system
    • About python
  • UNDERSTAND RAW DATA
    • Stages of Genome Data Generation
    • From Bulk To Single Cell
    • Introduction To the Datasets
      • bulk RNA-seq
      • single-cell data
  • Work Environment
    • Chapter Ensemble
    • All About Installations
    • Keep Running
    • Coding Environment
    • Git and Github
    • Other Tips
  • Python and UNIX System
    • Run Python
    • File I/O
    • Run Shell Command In Python - I
    • 🎉Case Study: Mapping bulk RNA-seq reads with salmon
  • Data Cleaning
    • 🎉Key Concept of Pandas
    • 🎉Case Study: Aggregate Salmon Quant
    • Case Study: Exploring The Dataset 🚩
    • The "copy" and "inplace" Parameter 🚩
    • Case Study: Extract and Reformat GTF file 🚩
    • the correct vs. the wrong way of using pandas 🚩
    • Case Study: Bulk Sample PCA 🚩
  • PYTHON BASICS
    • Python can be lightning-fast ⚡️ 🚩
    • Run Shell Command In Python - II 🚩
    • Pointers In Python 🚩
    • Everything is an object 🚩
    • Thread and Process 🚩
    • Resource For Intermediate Python Knowledge 🚩
    • Python magic method 🚩
  • Genome Science Data
    • NGS Data Formats and Tools 🚩
      • SAM/BAM 🚩
      • BED 🚩
      • GTF 🚩
      • Bigwig / Bigbed 🚩
      • VCF / BCF 🚩
    • The Python Packages 🚩
  • Data visualization
    • Matplotlib Basics 🚩
    • Seaborn Basics 🚩
    • Interactive Data Visualization 🚩
  • Use R in Python
    • Why? 🚩
    • rpy2 🚩
  • Gotchas
    • Check whether package X is installed
    • BAM to FASTQ
    • Genomic Websites
Powered by GitBook
On this page
  • Oh my zsh
  • Customize your shell using the config file
  • Export your environment for backup and recovering

Was this helpful?

  1. Work Environment

Other Tips

PreviousGit and GithubNextRun Python

Last updated 5 years ago

Was this helpful?

Bash is the most common shell, but there are a lot more other options. My favorite shell is zsh, when equip with "Oh my zsh".

Give it a try, and you will love it.

Customize your shell using the config file

Both bash and zsh comes with a config file in your home directory. The one for bash is ~/.bashrc and the one for zsh is ~/.zshrc.

Export your environment for backup and recovering

# enter env first
$ conda activate genome_book
(genome_book)

# export the environment into a yml file, which contains all installation history
$ conda env export --from-history > environment.yml
(genome_book)

# This is the content of that file
$ cat environment.yml
name: genome_book
channels:
  - conda-forge
  - bioconda
  - defaults
dependencies:
  - pandas==1.0.3
  - jupyter==1.0.0
  - scikit-learn==0.22.2.post1
  - pysam==0.15.4
  - seaborn=0.10.0
  - pybedtools==0.8.1
  - python=3.7
  - jupyter_contrib_nbextensions==0.5.1
  - deeptools==3.4.2
prefix: /Users/hq/miniconda3/envs/genome_book
(genome_book)

# recreate the exact environment with the yml file
$ conda env create -f environment.yml

This config file is basically a shell script, execute by the shell when it starts. Usually, I create many alias for common commands such as ssh to a server or start a jupyter notebook, zsh also come with many convenient alias and other and themes for your shell (I use ys theme).

From this and of conda documentation:

fancy plugins
stack overflow
export section
Oh my zsh
GitHub - ohmyzsh/ohmyzsh: 🙃 A delightful community-driven (with 2,000+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.GitHub
Logo