Skip to content
المشاريع

hentablihamza/practical-biopython-course

عرض على GitHub

حول

Hands-on Biopython course: 12 beginner-to-intermediate Jupyter/Colab notebooks from sequences to BLAST, alignments, phylogenetics, and protein-ligand structures, following the drug target EGFR with real public data.

التعلّم والتعليم

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
جارٍ جمع السجل
خلال 7 أيام
جارٍ جمع السجل
خلال 15 يومًا
جارٍ جمع السجل
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

Practical Biopython Course

A hands-on, 12-notebook course that takes you from Python basics to sequence analysis, BLAST, alignments, phylogenetics, and protein–ligand structures with Biopython — all in your browser with Google Colab.

CI Python 3.10+ Open in Colab

Every notebook runs end to end on free Google Colab with one click — no installation, no setup. The course follows one real drug target from gene to drug-bound structure: EGFR, the epidermal growth factor receptor targeted by lung-cancer drugs such as erlotinib and osimertinib. All data are real, public records from NCBI, UniProt, and the PDB, and never invented numbers.

Binding-pocket conservation

From Notebook 12: the 15 EGFR residues within 4 Å of erlotinib (PDB 1M17), compared across 15 kinases. Catalytic residues such as Lys745 and Asp855 are shared by all of them, while the gatekeeper Thr790 and the hinge region vary: that is where inhibitor selectivity comes from.

Who this is for

  • Biology, chemistry, and pharmacy students and Ph.D. researchers starting in bioinformatics or computational drug discovery.
  • Structural biologists and medicinal chemists who want to script the sequence and structure work they now do by hand on websites.
  • Programmers entering the life sciences who want a biology-grounded tour of Biopython.

You need only basic Python. Notebook 01 covers the Python you need; everything else is taught as it appears.

Syllabus

Click a badge to open that notebook in Colab, or browse the notebooks/ folder.

# Notebook You will learn to… Colab
01 Python refresher & Biopython setup use strings, dicts, functions, and pandas on sequences; install Biopython; read a first FASTA file Open
02 The Seq object reverse complement, GC content, transcription, translation, six-frame ORFs, codon usage, T790M Open
03 SeqRecord & SeqIO read, index, filter, convert, and write FASTA and GenBank files Open
04 Sequence features & annotations walk GenBank features, extract the CDS, map residues to codons and exons, draw a feature map Open
05 NCBI Entrez esearch / esummary / efetch on Nucleotide and PubMed, politely and with an offline cache Open
06 Pairwise alignment PairwiseAligner, BLOSUM62, affine gaps, global vs local, identity matrix of drug-target kinases Open
07 Multiple sequence alignment AlignIO, conservation (entropy), consensus, binding-site residues across kinases Open
08 BLAST qblast at NCBI, parse XML with NCBIXML, build and filter a hit table Open
09 Protein analysis ProtParam (MW, pI, ε280, instability, GRAVY), hydropathy, motifs, Bio.motifs Open
10 Protein structures with Bio.PDB EGFR–erlotinib (PDB 1M17): hierarchy, numbering, distances, binding site, B-factors, SASA Open
11 Phylogenetics distance matrices, UPGMA & neighbour-joining trees, rooting, Newick, bootstrap support Open
12 Mini project: target → structure UniProt → sequence → BLAST → alignment → PDB → binding-pocket conservation and selectivity Open

Each notebook has clear learning objectives, explanations in Markdown, runnable code, and exercises with collapsible solutions. Work them in order — later notebooks reuse ideas and data from earlier ones.

How to use it

Option 1 — Google Colab (recommended, nothing to install)

Click any Open in Colab badge above. The first cell installs Biopython and downloads the course data automatically.

Option 2 — Run locally

git clone https://github.com/hentablihamza/practical-biopython-course.git
cd practical-biopython-course

# with conda
conda env create -f environment.yml
conda activate practical-biopython-course

# or with pip
pip install -r requirements.txt

jupyter notebook   # open the notebooks/ folder

Online and offline

Notebooks 05 (NCBI Entrez), 10 (PDB download), and 12 (UniProt) query live web services when they can and fall back automatically to cached copies in data/ when there is no internet. Notebook 08 reads a cached BLAST result by default because remote BLAST jobs can wait in NCBI's queue for many minutes; flip RUN_LIVE_BLAST = True to submit your own. Set the environment variable COURSE_OFFLINE=1 to force the cached path everywhere (this is what CI does).

When you use NCBI, set Entrez.email to your own address, as NCBI's usage policy asks (Notebook 05 explains the rules).

Datasets

Small, real, public datasets are committed under data/ with full provenance in data/README.md and retrieval dates in data/provenance.json:

  • UniProt sequences of 15 protein kinases (human ErbB family, EGFR orthologues, and drug targets such as ABL1, BTK, BRAF, ALK) plus EGFR feature annotations.
  • NCBI RefSeq EGFR mRNA NM_005228.5 (GenBank and FASTA) and cached Entrez search results.
  • A cached BLAST search of the EGFR kinase domain against Swiss-Prot.
  • A multiple sequence alignment of the 15 kinase domains (FAMSA).
  • PDB 1M17: EGFR kinase domain bound to erlotinib (mmCIF and PDB formats).

Refresh everything from the original sources with scripts/refresh_cache.py.

Related open-source projects

This course is part of a small set of open tools and courses for computational drug discovery:

  • practical-cheminformatics-course — the companion course: 12 Colab notebooks from RDKit basics to QSAR and virtual screening.
  • chembl-easy — one-command clean, ML-ready bioactivity downloads from ChEMBL (e.g. for the EGFR target used here).
  • chem-curate — reproducible bioactivity and structure curation for QSAR.
  • qsar-split-bench — benchmark random, scaffold, cluster, and time splits to detect data leakage.

Author

Hamza Hentabli, Ph.D. — AI/ML drug discovery & cheminformatics scientist, and former teacher who has mentored Ph.D. and master's students. This course distills that teaching into material anyone can run.

If these materials help your work or teaching, please cite them (see CITATION.cff). Issues and suggestions are welcome.

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…