Category Archives: lesson

Perl slides

Dear fellows, here you are the slides we used yesterday. Don’t forget to study this example, too.

Download link:Perl slides 2.

Tagged

Lab04: passing arguments to Perl scripts

This post will review how to pass arguments to a Perl script. This is something you can’t test online with codepad (unfortunately), because codepad only runs the script, without emulating a whole system with a shell and files to read…


 

What arguments are

Learning how to play with the Linux shell we understood that each program (or command) can be launched alone, or with parameters. We refer to these parameters as “arguments”.

An example below:

ls
ls -l
ls /usr/bin

The three commands always start with the program to run, but the first only ask the shell to execute the ls program, while the second and the third one also pass some “arguments” to it.

This is a core functionality of any Perl program: its the way we, the user, can ask the Perl program what to do.

How to pass parameters to a Perl script

If we save a Perl script as demo.pl, we know that to launch it we should type (provided that the script is in our current directory):

perl demo.pl

provided that this is the way we launch the command we now want to pass parameters the same way we did with ls, like:

perl demo.pl -l -n ciao

In the line above I gave three parameters to the script. As we cant figure out how many parameter a program needs, Perl stores all the passed arguments into an array, called @ARGV (remember that Perl is case sensitive!!!).

A first example

We are going to create a param1.pl (lab04 folder, of course) program that prints the first parameter you passed to it. It’s very simple:

print "The first parameter is $ARGV[0].\n";

It’s your turn now hw4.1

Now create a script that will print all the parameters passed, not just the first. Save it as params.pl in the lab04 folder.

We want to print one parameter per line, like “The parameter is …“, and at the end it will print “You passed # total parameters“.

Submit it as usual, using hw4.1 as code.

 

Tagged

Lab03: Cribi Crash Course

Today we met at the Vallisneri to play with the foundamentals of Perl (slides below).
Now you have some time to practice with Perl, so if you want to start from the basics here you are a step-by-step guide.
As always remember to “appello Nome Cognome” before starting, and say “goodbye” before leaving.

Screenshot 2014-04-03 13.59.43PDF of Perl slides

References

We are going to place useful links to presentations and manuals found on the Internet. We’ll try keeping this up to date.

Continue reading

Tagged , ,

Tursday lessons

Dear all, the Dept. organized a workshop on RNA world. You’ll attend the seminars as part of the course.

RNA world: a never ending story

Speakers:

  • Katia Basso (Institute for Cancer Genetics, Columbia University, NY, USA)
  • Paola Guglielmelli (Dept. of Hematology, University of Florence, Italy)
  • Sergio Marchini (“Mario Negri” Institute for Pharmacological Research, Dept. of Oncology, Milan, Italy)
  • Irene Bozzoni (Dept. of Biology and Biotechnology “Charles Darwin”, Sapienza University of Rome, Italy)
  • Daniela Taverna (Molecular Biotechnology Center, University of Turin, Italy)

Further info here.

Tagged , ,

Choose your next lesson!

On Monday we’ll have 2 hours lesson together (standard GV time)… Help us realizing a useful lesson!

prepare to tell us about you curiosities and questions concerning what we have done during the practicals or what we’re going to do next, concerning perl and concerning what you can do with genomics and bioinformatics.. and what you would do if you were a researcher !

Second lesson: slides

Today we had an extremely fast introduction to Perl (crash course). In particular we

  • Reviewed variables and learned what hashes are and how to use them
  • Reviewed the for and foreach cycles
  • Introduced the while loop
  • Introduced mathematical and string operators and functions
  • Introduced the if test
  • Saw how to open a file and get parameters (@ARGV).

 Download slides

Tagged

A “primer” on Genome Assembly

During our first lesson we had a brief overview of the sequencing strategy used for Nannochloropsis.

First, a whole genome shotgun approach was used to have a first draft (see picture below). In particular we used the Roche 454 machine that provides reads ~500bp long, and we assembled them with the Newbler package.

As we saw both read length and sequence coverage affects the quality of the assembly. In particular repeated regions make the assembly program to “break” the sequence. This happens if the length of the repeated region is longer than the single fragments (reads) sequenced. Repeated regions collapse in the same contig, that will have a higher coverage (approximately n-times the average, where n is the number of repeats in the genome).

Continue reading

Tagged , , ,

First class lesson: project overview and first Perl script!

Lesson date: March 8th, 2012

We discussed the project goal: a program to design primers for genome finishing.

We introduced the three main tools of the bioinformaticisists: scripting languages, relational databases and HTML for web interfaces.

You were suggested to download and install a programming editor, with syntax highlighting and other advanced features usually lacking on simpler editors and to install Perl if you use Windows.

 Download slides

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 ,