In this five-day hands-on course you turn research-style Python code into a tested, documented, and installable Python package, and publish it on GitHub. The code simulates a bottom-up mass-spectrometry proteomics experiment, from protein sequences to simulated mass spectra.
Note
"Advanced" refers to software development practices (packaging, testing, version control, collaboration), not to complex algorithms. The programming itself stays at an intermediate level.
Software development
- Structure code into reusable, documented functions
- Write unit tests and run them with
pytest - Build an installable Python package (
pyproject.toml, editable installs) - Track your work with Git (commit, push, pull, branches)
- Collaborate on GitHub: README documentation, cross-testing, forks, and pull requests
- Run tests automatically with GitHub Actions (continuous integration)
- Create reproducible environments with conda and pip
- Use LLM assistants critically to support your coding
Scientific Python
- Data handling and plotting with pandas, NumPy, and Matplotlib
- Text processing with regular expressions
- Using a domain library (pyteomics)
Proteomics basics
- The bottom-up proteomics workflow: protein digestion, liquid chromatography (LC), and mass spectrometry (MS1/MS2)
- Peptide masses, m/z values, and fragment ions
Knowledge
- Basic Python: data types, loops, conditionals, functions, list and dictionary comprehensions
- Some coding experience in any language, ideally at least one small coding project
- Basic command-line navigation (
cd,ls,mkdir,cp) - No prior knowledge of proteomics or mass spectrometry is needed. The tutorials introduce the concepts.
Preparation (self-study in the week before the course)
Everyone starts with a different background, so the week before the course is for self-organized learning on DataCamp (the organizers send you access details) or a platform of your choice. You do not need to do every course. Pick those that cover what you are not yet familiar with.
Python basics: string operations, regular expressions, lists and dictionaries, list and dictionary comprehensions, slicing, loops, if/else statements, using external libraries, and simple plots with Matplotlib. These match the contents of the "Standard Python Course".
- Introduction to Python for Data Science
- Intermediate Python
- For looking up specifics: W3Schools Python
Developer skills:
- Writing your own functions: Introduction to Functions in Python
- Writing and running tests: Introduction to Testing in Python (chapters 1–3)
- Package development: Developing Python Packages
- Version control and collaboration: Introduction to Git and Introduction to GitHub Concepts
Equipment
- A laptop (Windows, macOS, or Linux) on which you can install software
- The tools from the setup guide, installed before the course starts (see Getting started)
The course simulates a bottom-up proteomics experiment:
- Input: a multi-protein FASTA file (sample_proteins.fasta)
- Processing: enzymatic digestion → LC retention-time prediction → MS1/MS2 simulation (mass, m/z, fragmentation)
- Output: TSV files with peptide and fragment m/z values (saved in
results/), diagnostic plots, and your own reusable Python package
Days 1–3 develop the functions in Jupyter notebooks. On days 4–5 you move them into a package.
| Day | Topic | Material |
|---|---|---|
| 1 | FASTA parsing and protein digestion | Tutorial 1 |
| 2 | Liquid chromatography simulation | Tutorial 2 |
| 3 | MS1/MS2 spectra simulation | Tutorial 3 |
| 4 | Package your functions, with tests and CI | Tutorial 4 |
| 5 | Publish, cross-test, and pull requests | Tutorial 4, Bonus |
The final notebook runs the complete experiment with your package. A reference solution of the package is available at UKHD-NP/proteosim. Try it yourself first.
Before the course, follow the setup guide: docs/setup.md. It covers the GitHub account and access token, Git, VS Code, Conda (via Miniforge), the course environment, an LLM assistant, and a Google Colab fallback.
Do not edit the tutorial notebooks directly. Work on your own copy instead.
Why: the instructors may update the tutorials during the course. If you edit the
original notebooks, git pull fails with conflicts and you have to sort out your changes
and ours by hand. If you only edit copies, git pull always works.
At the start of each tutorial:
- Get the latest version of the course material (in the terminal, inside
advanced-python_course):git pull
- Copy the notebook of the day into the same
tutorials/folder and add_editto the name. It must stay intutorials/, because the notebooks read from../dataand write to../results. - Open and work only in the
_editcopy. Leave the original unchanged.
.
├── data/ # Input FASTA files
├── tutorials/ # Day-by-day notebooks (days 1–3) and instructions (days 4–5)
├── templates/ # pyproject.toml template for your package
├── results/ # Outputs written by the tutorials
├── docs/ # Setup guide and course slides
└── README.md
- Provide clear instructions on how to obtain access to Datacamp and its courses with two weeks in advance
- Ensure there enough power outlets in the room for the practical part.
- For some more students advanced students the first tutorials were too easy, too much was given. Solution? Hide proposed code under "hints" foldable sections. This way advanced students have a greater challenge while less advanced can still profit from templates.
- For exercise 5.12 use the E.coli fasta file and ask the students to compare different proteases as well as to plot the distribution of nr. of peptides per protein (fasta file already included in repo).