Fundamentals of Bioinformatics 2Module PRINCIPLES OF BIOINFORMATICS
Academic Year 2025/2026 - Teacher: ELISABETTA SCIACCAExpected Learning Outcomes
At the end of the course, students will be able to understand the fundamental principles of programming and the distinction between compiled and interpreted languages, recognizing the main logical constructs (sequence, selection, and iteration) and their representation through flowcharts.
They will acquire familiarity with the R and Python languages, learning their structure, syntax, and main data types, both primitive and structured. Students will be able to translate simple algorithms into working code, use control constructs (if, for, while), create and manage data structures such as lists, matrices, and data frames, read and write files, and represent data graphically.
Students will also develop the ability to install and use external packages, apply programming principles to solve basic problems, and select the most suitable development environment for the type of activity.
At the end of the course, they will be able to work independently in writing, executing, and testing elementary scripts, understanding the logic that guides the design and implementation of algorithms.
Required Prerequisites
Detailed Course Content
Part I - Introduction to Programming.
Definition of algorithm and programming language.
Description of translators and distinction between compiled and interpreted languages.
Basic programming concepts: variables, assignment, data types, and types of operators (arithmetic, relational, and Boolean).
Introduction to fundamental programming constructs (sequence, selection, and iteration).
Flowcharts and Structured Linear Notation.
Exercises on algorithms and flowcharts.
Assessment quiz.
Part II - Introduction to the R Language
Installation and introduction to R and the RStudio development environment.
Language basics: comments, variable assignment, special values, primitive and advanced data types, data type checking and conversion.
Syntax of arithmetic, relational, and Boolean operators.
Syntax of fundamental constructs (if-else, while, for) and implementation of simple flowcharts.
Function definition and related exercises.
Introduction to the vector data type (concatenation function, seq(), rep(), and other utility functions for vectors).
Introduction to the matrix data type and related functions (element extraction, filters, row and column management). Exercises on vectors and matrices.
Introduction to the list data type (the list() function and utility functions, element extraction).
Introduction to the dataframe data type (utility functions, element extraction, adding/removing rows and columns, handling NA values). Exercises on lists and dataframes.
Reading and writing files.
Plots in R (line plots, bar plots, pie charts, and aesthetic parameters).
Installing libraries in R from CRAN and Bioconductor.
Assessment quiz.
Part III - Introduction to Python
Installation and introduction to Python and the Spyder development environment.
Language basics: comments, variable assignment, special values, primitive and advanced data types, data type checking and conversion, strings and related operations.
Syntax of arithmetic, relational, and Boolean operators.
Syntax of fundamental constructs (if-else, while, for) and implementation of simple flowcharts.
Function definition and docstrings with related exercises.
The Python standard library.
Introduction to the list data type (creating a list, element extraction, and related methods).
Tuples and sets (definition and related methods).
Dictionaries (definition and related methods).
Installing external modules via pip and installing pandas and numpy.
Introduction to numpy arrays and related operations.
Exercises on arrays.
Introduction to pandas series and related operations.
Introduction to pandas dataframes and related operations.
Exercises on series and dataframes.
Plots in Python with matplotlib (line plots, bar plots, and aesthetic parameters).
Assessment quiz
Textbook Information
The professor will provide teaching materials on the course's Studium page in the form of:
- Slides discussed in class
- R and Python scripts containing the code from exercises carried out in class
This material represents the main support for the course; however, the following supplementary books are suggested:
Learning Assessment
Learning Assessment Procedures
Written test with multiple-choice questions, and an exercise.
Optional oral interview.
Information for students with disabilities and/or learning disabilities (LDs)
To ensure equal opportunities and in compliance with applicable laws, interested students may request a personal conversation to plan any compensatory and/or extenuating measures, based on their educational objectives and specific needs. Students may also contact the CInAP (Center for Active and Participatory Integration - Services for Disabilities and/or Learning Disabilities) representative at the Department of Biomedical and Biotechnological Sciences.
Examples of frequently asked questions and / or exercises
a. Vector
b. Matrix
c. List
d. None of the above
What is the correct way to assign a matrix to the variable my_matrix in R?
a. my_matrix = array([ [1,2], [5,3], [7,8] ])
b. my_matrix = [ [1,2], [5,3], [7,8] ]
c. my_matrix = matrix(c(1,2, 5,3, 7,8), nrow=3, ncol=2)
d. my_matrix = m(c(1,2, 5,3, 7,8), nrow=3, ncol=2)
What is the assignment symbol in R?
a. =
b. <-
c. <=
d. ==
In RStudio, which window is used to display the contents of variables and objects loaded into the workspace?
a. Console
b. Plots
c. Script Editor
d. Environment
EXERCISE
Use a language of your choice (R or Python) to create a function that, given two input numbers, returns the maximum of the two.
Provide an example of calling the function with input numbers chosen by the student.