Scientific Programming
A.Y. 2026/2027
Learning objectives
Programming skills are essential for bioinformatics and computational genomics, including the implementation of scripts for automation of recurrent data processing procedures and development of novel tools and reusable software packages.
The objective of the course is to make students proficient in writing software by adopting computational approaches, concepts and methods. As currently being the most widely used programming languages in the area of data science and in particular genomic data analysis, the course will present the scientific programming features of the Python and R programming languages. The students will have the opportunity to familiarize not only with the syntax and execution flow of the programming languages, but also with some of the software packages or libraries commonly used in bioinformatics. Also the creation of own software packages or libraries will be discussed.
The objective of the course is to make students proficient in writing software by adopting computational approaches, concepts and methods. As currently being the most widely used programming languages in the area of data science and in particular genomic data analysis, the course will present the scientific programming features of the Python and R programming languages. The students will have the opportunity to familiarize not only with the syntax and execution flow of the programming languages, but also with some of the software packages or libraries commonly used in bioinformatics. Also the creation of own software packages or libraries will be discussed.
Expected learning outcomes
Specifically, the goal of the R part of the course is to teach a correct and efficient use of this software environment for statistical computing and flexible visualization of data. The R part will illustrate the enormous performance loss that can result from inefficient coding and introduce both basic and advanced data structures and processing methods commonly used for bioinformatics, focusing on Bioconductor packages. Furthermore, R will be explored as a powerful tool for data visualization; also unit testing and version control will be discussed.
The objective for the Python part of the course is to empower the students with skills for a) coherent and efficient dataset manipulation by mean of the Pandas and NumPy libraries; b) concepts of concurrent programming for efficient execution; c) data visualization, by means of classical curve/scatter plots as well as more sophisticated heatmap, clustermap, histograms, boxplots; d) network programming, in particular how to access and deploy REST services.
Exercises will help to get hands on experience with the theoretical concepts discussed in the lectures and with the handling of biological or biomedical data.
The objective for the Python part of the course is to empower the students with skills for a) coherent and efficient dataset manipulation by mean of the Pandas and NumPy libraries; b) concepts of concurrent programming for efficient execution; c) data visualization, by means of classical curve/scatter plots as well as more sophisticated heatmap, clustermap, histograms, boxplots; d) network programming, in particular how to access and deploy REST services.
Exercises will help to get hands on experience with the theoretical concepts discussed in the lectures and with the handling of biological or biomedical data.
Lesson period: Second semester
Assessment methods: Esame
Assessment result: voto verbalizzato in trentesimi
Single course
This course cannot be attended as a single course. Please check our list of single courses to find the ones available for enrolment.
Course syllabus and organization
Single session
Course syllabus
Programming skills are essential for bioinformatics and computational genomics, including the implementation of scripts for automation of recurrent data processing procedures and development of novel tools and reusable software packages. The objective of the course is to make students proficient in writing software by adopting computational approaches, concepts and methods. As currently being the most widely used programming languages in the area of data science and in particular genomic data analysis, the course will present the scientific programming features of the Python and R programming languages. The students will have the opportunity to familiarize not only with the syntax and execution flow of the programming languages, but also with some of the software packages or libraries commonly used in bioinformatics. Also the creation of own software packages or libraries will be a core topic. Exercises will help to get hands on experience with the theoretical concepts discussed in the lectures and with the handling of biological or biomedical data.
Part A: Python programming
1. Python recap: main Python concept; control flow statement, variables, data structures, classes, handling of exceptions, file management.
2. Concurrent programming: needs of parallelism; theoretical benefits of parallelism; Python library "multiprocessing" to spawn and join processes; Python library "multithreading" and its limitations.
3. Pandas, NumPy and Polars libraries: efficient matrix operations with NumPy; concept of Pandas DataFrame and some hints on the internals; overview of the main functionalities provided by a DataFrame (import from and export to files, relational operators, data retrieval, data manipulation).
4. Visualization libraries: overview of the two main libraries for data visualization in Python: matplotlib and Seaborn; trivial plots: curves, scatter plots; sophisticated plots: heatmaps, clustermap, plots of distributions; good practice for realizing plots: correct usage of axis scale, legend, title, etc.
5. Network programming: theory and implementation of client-server architectures; implementation of RESTful web service using the Python module "flask".
Part B: R programming
1. Course introduction: Motivation, course information, introduction.
2. Introduction to R, CRAN and Bioconductor: repetition of the basic syntax and execution flow (blocks, conditional statements, loops); basic data structures (vectors, factors, matrices, data frames, lists), functions and scripts, data import/export.
3. Data processing in R: advanced use of data structures, vectorized operations and efficient coding in R (e.g., apply versus for-loops; differences in syntax and performance).
4. Class systems in R: S3, S4 and Reference classes
5. Creating R/Bioconductor packages: basic package structure; requirements; building and verifying packages; Bioconductor submission process.
6. Unit testing in R: the testthat framework for unit testing in R.
7. Version control with Git/GitHub
8. Important data types and packages for bioinformatics in R: GRanges for genomic locations, DNAString and RNAString, SummrizedExperiment, annotation packages (e.g., GenomicFeatures).
9. Data visualization in R: simple plots, boxplots, heatmaps and more; basic introduction to the powerful and flexible ggplot2 framework, its syntax and use.
10. Specific use cases in R: e.g., differential expression analysis (DEseq2), pathway analysis (GSEA).
Part A: Python programming
1. Python recap: main Python concept; control flow statement, variables, data structures, classes, handling of exceptions, file management.
2. Concurrent programming: needs of parallelism; theoretical benefits of parallelism; Python library "multiprocessing" to spawn and join processes; Python library "multithreading" and its limitations.
3. Pandas, NumPy and Polars libraries: efficient matrix operations with NumPy; concept of Pandas DataFrame and some hints on the internals; overview of the main functionalities provided by a DataFrame (import from and export to files, relational operators, data retrieval, data manipulation).
4. Visualization libraries: overview of the two main libraries for data visualization in Python: matplotlib and Seaborn; trivial plots: curves, scatter plots; sophisticated plots: heatmaps, clustermap, plots of distributions; good practice for realizing plots: correct usage of axis scale, legend, title, etc.
5. Network programming: theory and implementation of client-server architectures; implementation of RESTful web service using the Python module "flask".
Part B: R programming
1. Course introduction: Motivation, course information, introduction.
2. Introduction to R, CRAN and Bioconductor: repetition of the basic syntax and execution flow (blocks, conditional statements, loops); basic data structures (vectors, factors, matrices, data frames, lists), functions and scripts, data import/export.
3. Data processing in R: advanced use of data structures, vectorized operations and efficient coding in R (e.g., apply versus for-loops; differences in syntax and performance).
4. Class systems in R: S3, S4 and Reference classes
5. Creating R/Bioconductor packages: basic package structure; requirements; building and verifying packages; Bioconductor submission process.
6. Unit testing in R: the testthat framework for unit testing in R.
7. Version control with Git/GitHub
8. Important data types and packages for bioinformatics in R: GRanges for genomic locations, DNAString and RNAString, SummrizedExperiment, annotation packages (e.g., GenomicFeatures).
9. Data visualization in R: simple plots, boxplots, heatmaps and more; basic introduction to the powerful and flexible ggplot2 framework, its syntax and use.
10. Specific use cases in R: e.g., differential expression analysis (DEseq2), pathway analysis (GSEA).
Prerequisites for admission
Basic knowledge of programming, preferably in Python language and/or in R. Basic knowledge of molecular biology.
Teaching methods
Class lectures and exercise sessions
Teaching Resources
The slides presented during the course, the recordings and many solved exercises are available via WeBeep, the portal for students and professors at Politecnico di Milano.
Suggested resources:
W. McKinney, Python for data analysis, Editor: O'Reilly, 3rd edition, 2023
Z.A. Shaw, Learn Python the hard way: A very simple introduction to the terrifyingly beautiful world. 3rd Edition of computers and code, Editor: Zed Shaw's Hard Way Series
O. Jones et al., Introduction to Scientific Programming and Simulation Using R. 2nd Edition, Editor: Chapman and Hall/CRC
C. Ortutay, Z. Ortutay, Molecular Data Analysis Using R, Editor: Wiley Blackwell
Suggested resources:
W. McKinney, Python for data analysis, Editor: O'Reilly, 3rd edition, 2023
Z.A. Shaw, Learn Python the hard way: A very simple introduction to the terrifyingly beautiful world. 3rd Edition of computers and code, Editor: Zed Shaw's Hard Way Series
O. Jones et al., Introduction to Scientific Programming and Simulation Using R. 2nd Edition, Editor: Chapman and Hall/CRC
C. Ortutay, Z. Ortutay, Molecular Data Analysis Using R, Editor: Wiley Blackwell
Assessment methods and Criteria
The assessment is based on:
1. a written exam to be taken in the exam sessions defined by the school
2. two individual project assignments, one to be implemented in R and one to be implemented in Python.
The final grade is a weighted average based on the grade of the exam (70%) and of each of the project assignments (15% each).
1. a written exam to be taken in the exam sessions defined by the school
2. two individual project assignments, one to be implemented in R and one to be implemented in Python.
The final grade is a weighted average based on the grade of the exam (70%) and of each of the project assignments (15% each).
IINF-05/A - Information Processing Systems - University credits: 6
Exercises: 24 hours
Lectures: 36 hours
Lectures: 36 hours
Professor:
Cascianelli Silvia
Shifts:
Turno
Professor:
Cascianelli Silvia