As it is obvious to think, a bioinformatician works with the computer and to communicate better with it he needs to speak to him, or rather write to him, in a way that is understandable to him. We can say that a good part of the bioinformatician's day is spent writing codes in specific programming languages to command the PC to perform certain actions on the available data, in order to solve biological problems.
But what does it mean to program?
Imagine you are in front of a robotic arm and want to use it to pour water, present inside a bottle, into a glass. First you need to tell the arm to grab the bottle above a table, unscrew the cap, tilt the bottle towards the glass and when enough water has entered the glass it must tilt the bottle away from the glass, close the cap and release it above a table.
This series of elementary information that I have just listed constitutes the algorithm of a program. In fact, if I want to communicate these actions to the robotic arm, I cannot speak to him as I would with my cousin, I have to communicate by writing in a language that he understands, said programming language. This can be understood by the robotic arm CPU, which is then programmed to pour water into a glass. I don't know if I have given the idea of what it means to program, but at this point I feel I can give you a more rigorous definition of what it means to program, we can in fact say that with the term "to program" we intend to create a program equipped with a special algorithm that is executed by the computer, or more specifically by the processor of a machine, in order to perform a specific task allowing any user to solve a problem. The one who builds and writes the algorithm of a program is called programmer.
Easy right? Well actually it's a bit more complicated than that, in fact we humans find it hard to write and understand directly in the machine language, in fact this is a language called binary (or low level), and consisting of a series of 1's and 0's. For us, it is certainly easier to use a programming language, which is user-oriented, called high level, that is understandable by us and which will be translated into machine language.
Wanting to be even more precise we can say that, the programmer writes the algorithm with a programming language creating the so-called source code which will be translated into machine language by two possible ways:
- Through a compilation with a compiler. A compiler is a computer program which translates a series of instructions written in a specific programming language (called source code) in machine language, whose code will be defined object code.
- Through an interpretation by means of a interpreter. An interpreter is a program capable of executing other programs starting directly from the relative source code written in a programming language, without first compiling it into object code, i.e. executing the instructions in the language used by translating them from time to time into language machine understandable by the processor.
I bet you are wondering how and where does a programmer write source code? Well, the programmer can write to the computer by three different methods:
- The virtual terminal, which is a native computer program that emulates the operation of a text terminal, that is a device that allows you to send data as input to a computer and receive as many as output. For example, during my projects, I often find myself writing commands and codes in different programming languages on the Ubuntu terminal, "launching" different interpreters in order to have a translation of what I write in a machine language.
- Text editor. A widely used editor is definitely gedit. Usually gedit is used associated with the terminal, in fact it is common to write a code in a text editor and then execute it from the terminal.
- Integrated development environment (Integrated Development Environment, IDE), this is a program that provides a user with a graphical interface in order to facilitate the writing of the code and the correction of errors (the so-called debugging). An example of this is R studio.
Now that you have, at least I hope, a little clearer what is meant by programming, let's tackle another important question.
What kind of programming language does a bioinformatician primarily use?
From what I have been able to notice, observing those who have more experience than me in the sector, the most used programming languages are certainly Python, Perl and above all R. In any case, up to now, I have mainly used R in my studies, very little Perl, not Python at all, but as you know I'm just starting out so my experience is still very limited. Be careful though, it often happens to launch commands or programs using bash. This is not a programming language but a text shell, in fact bash stands for Bourne-Again SHell, that is a command interpreter that allows the user to interact better with Unix and Unix-Like operating systems such as Linux. The shell, in fact, allows you to launch programs and execute commands with ease.
Before concluding I would like to introduce you to some equally useful terms and concepts but, in order not to burden the discussion, I thought I'd talk about them separately:
- A program needs a input, that is an initial information, and thanks to the execution of the program by the processor we obtain as a result a output.
- A script, a small program written in a language of scripting, that is a programming language that is interpreted in machine language and which is useful for automating system routines. In bioinformatics it is very common to use script in order to make repeated actions automatic and rapid, such as searching for specific sequences in different genomes. So beware of the script, they are always around the corner.
- Debugging that means the activity of correcting errors, called bug, which can be detected in a program during programming or while using it.
Well for now let's stop here, if you don't want to miss the next articles, subscribe to the blog and let me know if the content of the blog is to your liking by leaving a comment or putting a "like".
Bye and see you soon.