Dear fellows, here you are the slides we used yesterday. Don’t forget to study this example, too.
Download link:Perl slides 2.
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…
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.
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):
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!!!).
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.\n";
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.
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.
Dear all, the Dept. organized a workshop on RNA world. You’ll attend the seminars as part of the course.
Further info here.
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 !
Today we had an extremely fast introduction to Perl (crash course). In particular we
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).
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.
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
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?