This is the second part of the first computer lab.
in agreement with your request, the last practical is scheduled for Monday the 11th
see you at aula M piano rialzato at 2:30 pm to start with brief conclusions concerning the gap filling experiments
we will then move to “Paolotti” to perform the last fiew exercises in the bioinformatics laboratory
tomorrow, Jun the 8th 2012 there will be no classes
We used some very simple commands during our first lab. Let see a new command. This post shows how to use two handy features of the shell: output redirection and program piping.
grep look for a patter into a line, and print it only if the pattern is present in the line. If we have a multifasta file, each header has a “>” sign. If we want to view all headers we can type:
grep ">" multifasta.fa
Most UNIX commands prints their output to screen. If we want to save that output we can use the “>” character:
ls -l > filelist.txt
we won’t see as usual the file listing with this command, because the “>” redirects ls’s output to the filelist.txt file. If we print the file:
we will have a proof.
A very useful feature of the UNIX shell is the possibility to send the output of a program to another program. This is done with the pipe character: |.
ls -la | head -n 3
With this command we will see the first three lines of the ls output. Nice?
cat multifasta.fa | grep ">" | wc -l