📗
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
  • Step 1. Installation
  • 1.1 Install minicoda or anaconda
  • 1.2 Setup python environment and packages for this book
  • 1.3 Use screen to start jupyter notebook
  • 1.4 In jupyter notebook extension tab, select your favorite extensions
  • 1.5 clone the repository from github

Was this helpful?

  1. Work Environment

Chapter Ensemble

Previoussingle-cell dataNextAll About Installations

Last updated 4 years ago

Was this helpful?

In this chapter, I will discuss all setups for the work environment before starting analysis.

This page contains quick steps for creating same work environment in 5 mins.

The following pages will explain details:

  1. : How to install python, python packages, and other bioinformatic programs related to this book.

  2. : How to keep your command running in the shell.

  3. : Using Jupyter Notebook/Lab for data analysis, and useful tips to enhance efficiency.

  4. : Using Git and Github while you do coding and analysis.

  5. : Some other optional tips.

Step 1. Installation

1.1 Install minicoda or anaconda

Install any one of them from here: or

1.2 Setup python environment and packages for this book

# setup conda channels
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge

# remove the incomplete environment if you did
conda env remove -n genome_book

# create the environment and install everything in one command!
# These packages will be used in this book
conda create -n genome_book \
    python=3.7 \
    pandas==1.0.3 \
    seaborn=0.10.0 \
    jupyter==1.0.0 \
    jupyter_contrib_nbextensions==0.5.1 \
    scikit-learn==0.22.2.post1 \
    pysam==0.15.4 \
    deeptools==3.4.2 \
    pybedtools==0.8.1 \
    scanpy=1.4 \
    salmon==1.2.1

1.3 Use screen to start jupyter notebook

# this creates a new screen named jupyter
screen -R jupyter
# In the new screen

# go back to your home direcotry
cd ~
# jupyter can only read file from the directory it starts, 
# if you run the jupyter in a subdirectory, 
# it can not reach other files on your computer.

# enter the env
conda activate genome_book

# optionally, setup your jupyter password
jupyter notebook password

# start jupyter notebook
jupyter notebook

# jupyter will keep running in the screen even if you cloase the terminal
# You should see the jupyter URL from its stdout

1.4 In jupyter notebook extension tab, select your favorite extensions

1.5 clone the repository from github

$ cd /To/The/Place/You/Want/To/Save/This/Repo/

$ git clone https://github.com/lhqing/py_genome_sci_book.git

Now in jupyter notebook navigator, go to the github repo, you can start browse my code and data.

Now everything is installed!

All About Installations
Keep Running
Coding Environment
Git and Github
Other tips
miniconda
anaconda
These are my selections
file in py_genome_sci_book/analysis/hello_world/jupyter_hello_world.ipynb