Tag Archives: perl

LAB05: Some real programming!

Lab05: Some real programming!

In the exercises until now we worked with input values that were written in the beginning of the programs. This is not how real programs work. Since we now know how to read files and pass parameters, we can start writing useful programs, that work in the same way as the shell commands we saw: taking their input from files.

Continue reading

Tagged ,

Reading a file from Perl

This post explains how to read a file from Perl. This is an optional part of laboratory04, so don’t try this unless you really feel confident about all the rest.

Continue reading

Tagged , ,


HomeworksDear guys,

we are really happy as we can see your efforts and your improvements. On Friday we’ll meet in Aula M Pr at 11.30, for a comprehensive course on Perl, so remember to repeat this part at home, try changing things in the scripts…

It’s going to be a long journey!


Lab02/3: first steps with Perl

This post is a part of the second laboratory session. Please refer to the main post. 

Ready to start programming? We hope so. This post will teach you the very first things 🙂

What a Perl program is

As we already said in class, a Perl program (or script, better), is a plain text file, as a FASTQ or SAM file is. It contains a set of instructions that the computer can execute. Unlike human beings, computers love repetitive tasks…

We are going to give you an actual lesson of Perl next Friday, but we think it is a good idea to make you touch it in advance.

Every programming language has:

  • variables: basically they are a piece of memory that can store an information, and has a name.
  • conditionals: we execute an instruction IF some condition is verified.
  • loops: we execute a set of instruction as many times as needed. Example: for every sequence in a FASTA file, calculate the reverse complement and print it.

Continue reading

Tagged , , ,

Calculate your oligonucleotide resuspension volume

As promised during today’s lecture, here you have your homework:

please calculate the amount  of water to be added to each of the primers in the list, in order to produce a working solution of 10 µM. You can produce a concentrated stock solution and then dilute the stock solution to a working solution of 10 µM, if it is needed.

Oligonucleotide datasheet containing all the information as provided by the supplier

Did you managed to find the right volume for each stock solution?

The Hamilton pipetter needs you to provide a coordinate and a volume separated by a tab for each of the primer. The information concerning each of the primers must be separated by a new line character, as shown in the example below

example of coordinate's file that you should pass to the Robot, to guide it (him?) doing the pipetting for you

Now try to translate the work that you performed to get this result into a list of actions (the algoritm).

For the most willing students, this is the moment for translating your algoritm into a Perl program and testing it at volume calculation for this short primer’s list.

Very soon you will find the solution on this blog. Stay tuned

Tagged , ,

Solutions to some Perl scripts

Here I post some scripts, with comments: minimum and maximum, reverse complement a sequence and reverse and complement a sequence stored into a file.

Continue reading

Tagged , ,

Second computer lab

After the brief introduction in class you are now ready to try by yourself a couple of command line programs: BLAST and Primer3. After having worked with these tools, you’ll have some more time to play with Perl. Today we will

  • Practice again with the shell
  • Perform a BLAST via command line
  • Perl scripts
  • Primer3 test

Now our servers are set up and we can monitor your activity… so remember: read carefully, and type filenames exactly as we suggest.

Continue reading

Tagged , ,

Installing and testing Perl

Installing Perl

If you have Linux or Mac OS X you have Perl installed by default. For Windows users there are different package to choose from, but a long used and tested is ActiveState Perl. Choose the X_86 version for Windows.
Download and execute the package following the instructions. You can watch this YouTube video to have and idea: the installation process is quite straightforward.

Installing a text editor

  • Under Linux you can use Gedit (in Ubuntu is under Application -> Accessories -> Text Editor). Kate is good as well.
  • Under Mac OS X you can download Text Wrangler, that is available for free at the App Store.
  • Under Windows you can use Crimson Editor.

Testing Perl

Open a shell terminal. (Under Windows hit Start, then choose “Run…” and type cmd in the text input, then hit Enter).

Type the “perl -v” command, without quotes, and hit enter. Is it working?

Tagged ,