Bioinformatics Scripts & Commands

Python

Install Python

Windows: https://www.python.org/downloads/windows/ (Don’t forget to tick PATH in first step of installation)

Install Virtual Environment

Windows:

pip install virtualenv

Virtual Environment Creation

Windows: Go to the desired folder and open command prompt/terminal/powershell in this folder by pressing “shift” key and “right click” in mouse then select “terminal” or “powershell” . Then type following commands

virtualenv biopythonenv

Activate/Use Virtual Environment : Go to folder that contain env folder then open with terminal like above and enter following commands

biopythonenv\Scripts\activate

Installation of mostly used bioinformatic python library

Lists of Essential Libraries:

  • biopython – Sequence handling (FASTA, GenBank), BLAST, alignments, phylogenetics
  • numpy – Numerical computing, arrays, matrix operations
  • pandas – Tabular biological data (expression matrices, metadata)
  • scipy – Statistics, clustering, distance metrics
  • matplotlib – Core plotting
  • seaborn – Statistical & publication-quality plots

Install all above libraries in activated virtual environment by entering following commands

pip install biopython numpy pandas scipy matplotlib seaborn

For Genomics, NGS, and Sequence Analysis

  • pyfaidx – Fast random access to FASTA files
  • pysam – Read/write BAM, SAM, VCF (essential for NGS)
  • pybedtools – Genomic interval operations (BED, GTF, GFF)
  • scikit-bio – Microbiome, phylogenetics, sequence analysis
pip install pysam pyfaidx pybedtools scikit-bio

Machine Learning & Statistics

  • scikit-learn – ML (clustering, PCA, classifiers)
  • statsmodels – Statistical tests, regression, differential analysis
pip install scikit-learn statsmodels

Structural Biology & Biochemistry

  • biotite – Structures, alignments, trajectories
  • mdtraj – Molecular dynamics trajectory analysis
  • rdkit – Cheminformatics (drug discovery)
pip install biotite mdtraj rdkit-pypi

Other Semi Essential Libraries

Progress meter for Python loops and command-line interfaces (tqdm)

pip install requests tqdm

Miniconda(Conda Environment )

Anaconda vs Miniconda: Miniconda is best for low grade computer and easy clean installation and uninstallation

How to install miniconda?

In windows

To install mini conda first need to visit anaconda download website https://www.anaconda.com/download/success Then choose miniconda installation file to downlaod

Installation Guide:

  • Double click the installation file
  • Choose installation for user only
  • Change default installation folder to D or E drive not in C drive for low grade pc and easy unstallation
  • Do not add PATH and do not use anaconda python default.
  • Then finish the installation

Create conda virtual environment

  • Open anaconda PowerShell Prompt from Start Menu in windows
  • Go to working directory from c drive
  • Update conda using comand “conda update conda
  • Create virtual environment using command “conda create -n biocondaenv python=3.10 ” here “biocondaenv” is the name of virtual environment . You can give any other name also
  • Use command “conda activate biocondaenv” to activate virtual environment.
  • After activating user defined venv the default environment “(base)” is changed into “(biocondaenv)
  • After finishing data analysis and research you can deactivate conda using command “conda deactivate” .

Update Conda Channel Configuration (in default ‘base’ environment)

Run these commands one by one in conda terminal

conda config --add channels bioconda
conda config --add channels conda-forge
conda config --set channel_priority strict

Verify setup by command ” conda config --show channels ” This should show following order

channels:
-conda-forge
-bioconda
-defaults

Now your computer is ready to install bioconda libraries

Enter the give command in biocondaenv virtual environment

conda install -c conda-forge -c bioconda fastqc multiqc samtools bcftools bedtools bwa bowtie2 hisat2 blast mafft muscle clustalo biopython snakemake seqkit

Install mamba in user created virtual environment because mamba is faster than conda in low grade computer

  • Create virtual environment using command “conda create -n biomambaaenv python=3.10 ” here “biomambaenv” is the name of virtual environment . You can give any other name also
  • Activate miomambaenve
  • Then install mamba like below
conda install -c conda-forge mamba
mamba  --version

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top