SlideShare ist ein Scribd-Unternehmen logo
1 von 30
FBW
             23-10-2012




Wim Van Criekinge
Programming


              • Variables
              • Flow control (if, regex …)
              • Loops

              • input/output
              • Subroutines/object
Three Basic Data Types


                  • Scalars - $
                  • Arrays of scalars - @
                  • Associative arrays of
                    scalers or Hashes - %
• [m]/PATTERN/[g][i][o]
• s/PATTERN/PATTERN/[g][i][e][o]
• tr/PATTERNLIST/PATTERNLIST/[c][d][s]
The „structure‟ of a Hash

 • An array looks something like this:
                      0       1     2      Index
      @array =
                    'val1' 'val2' 'val3'   Value


 • A hash looks something like this:
                Rob          Matt    Joe_A         Key (name)
%phone =
             353-7236 353-7122 555-1212            Value
Printing a hash (continued)
• First, create a list of keys. Fortunately, there is
  a function for that:
   – keys %hash (returns a list of keys)
• Next, visit each key and print its associated
  value:
   foreach (keys %hash){
       print “The key $_ has the value $hash{$_}n”;
       }
• One complication. Hashes do not maintain any
  sort of order. In other words, if you put
  key/value pairs into a hash in a particular
  order, you will not get them out in that order!!
my %AA1 = (       'AUU','I',
     'UUU','F',                  'AUC','I',
     'UUC','F',                  'AUA','I',
     'UUA','L',                'AUG','M',
     'UUG','L',                 'ACU','T',
     'UCU','S',                 'ACC','T',
     'UCC','S',                 'ACA','T',
     'UCA','S',                 'ACG','T',
     'UCG','S',                'AAU','N',
     'UAU','Y',                'AAC','N',
     'UAC','Y',                 'AAA','K',
     'UAA','*',                'AAG','K',
     'UAG','*',                'AGU','S',
     'UGU','C',                'AGC','S',
     'UGC','C',                'AGA','R',
     'UGA','*',                'AGG','R',
     'UGG','W',
                           'GUU','V',
     'CUU','L',            'GUC','V',
     'CUC','L',             'GUA','V',
     'CUA','L',            'GUG','V',
     'CUG','L',            'GCU','A',
     'CCU','P',            'GCC','A',
     'CCC','P',             'GCA','A',
     'CCA','P',            'GCG','A',
     'CCG','P',            'GAU','D',
     'CAU','H',            'GAC','D',
     'CAC','H',             'GAA','E',
     'CAA','Q',            'GAG','E',
     'CAG','Q',            'GGU','G',
     'CGU','R',            'GGC','G',
     'CGC','R',            'GGA','G',
     'CGA','R',           'GGG','G' );
     'CGG','R',
Programming in general and Perl in particular
• There is more than one right way to do it. Unfortunately, there are also
  many wrong ways.
   – 1. Always check and make sure the output is correct and logical
        • Consider what errors might occur, and take steps to ensure that you are
          accounting for them.
    – 2. Check to make sure you are using every variable you declare.
        • Use Strict !
    – 3. Always go back to a script once it is working and see if you can
      eliminate unnecessary steps.
        • Concise code is good code.
        • You will learn more if you optimize your code.
        • Concise does not mean comment free. Please use as many comments as
          you think are necessary.
        • Sometimes you want to leave easy to understand code in, rather than
          short but difficult to understand tricks. Use your judgment.
        • Remember that in the future, you may wish to use or alter the code you
          wrote today. If you don‟t understand it today, you won‟t tomorrow.
Programming in general and Perl in particular

Develop your program in stages. Once part of it works, save the
  working version to another file (or use a source code control
  system like RCS) before continuing to improve it.
When running interactively, show the user signs of activity.
  There is no need to dump everything to the screen (unless
  requested to), but a few words or a number change every few
  minutes will show that your program is doing something.
Comment your script. Any information on what it is doing or why
  might be useful to you a few months later.
Decide on a coding convention and stick to it. For example,
    – for variable names, begin globals with a capital letter and privates
      (my) with a lower case letter
    – indent new control structures with (say) 2 spaces
    – line up closing braces, as in: if (....) { ... ... }
    – Add blank lines between sections to improve readibility
>ultimate-sequence
ACTCGTTATGATATTTTTTTTGAACGTGAAAATACTTTTCGTGC
   TATGGAAGGACTCGTTATCGTGAAGTTGAACGTTCTGAATG
   TATGCCTCTTGAAATGGAAAATACTCATTGTTTATCTGAAAT
   TTGAATGGGAATTTTATCTACAATGTTTTATTCTTACAGAAC
   ATTAAATTGTGTTATGTTTCATTTCACATTTTAGTAGTTTTTT
   CAGTGAAAGCTTGAAAACCACCAAGAAGAAAAGCTGGTAT
   GCGTAGCTATGTATATATAAAATTAGATTTTCCACAAAAAAT
   GATCTGATAAACCTTCTCTGTTGGCTCCAAGTATAAGTACG
   AAAAGAAATACGTTCCCAAGAATTAGCTTCATGAGTAAGAA
   GAAAAGCTGGTATGCGTAGCTATGTATATATAAAATTAGATT
   TTCCACAAAAAATGATCTGATAA
File input / output

Opening a filehandle
• In order to use a filehandle other than STDIN,
  STDOUT and STDERR, the filehandle needs to be
  opened. The open function opens a file or device and
  associates it with a filehandle.
• It returns 1 upon success and undef otherwise.
Examples
• # open a filehandle for reading: open
  (SOURCE_FILE, "filename");
• # or open (SOURCE_FILE, "<filename");
• # open a filehandle for writing: open (RESULT_FILE,
  ">filename");
• # open a filehandle for appending: open (LOGFILE,
  ">>filename";
File input / output


    Closing a filehandle
    • When you are finished with a filehandle, you
      may close it with the close function. The close
      function closes the file or device associated
      with the filehandle.
    Example:
    • close (MY_FILE_HANDLE); Filehandles are
      automatically closed when the program exits,
      or when the filehandle is reopened.
File input / output
    The die function
    • Sometimes the open function fails. For example, opening a file
      for input might fail because the file does not exist, and opening a
      file for output might fail because the file does not have a write
      permission. A perl program will nevertheless use the
      filehandle, and will not warn you that all input and output
      activities are actually meaningless.
    • Therefore, it is recommended to explicitly check the result of the
      open command, and if it fails to print an error message and exit
      the program.
    • This is easily done using the die function.
    Example:
    • my $k = open (FILEHANDLE, "filename"); unless ($k) { die
      ("cannot open file filename: $!"); } # in case file "filename"
      cannot be opened, # the argument of die will be printed on # the
      screen and the program will exit. # $! is a special variable that
      contains the respective # error message sent by the operating
      system.. A short hand:
    • open (FILEHANDLE, "filename") || die "cannot open file
      filename: $!";
Using filehandles for writing


     Example:
     #!/usr/local/bin/perl use strict;
     use warnings;
     open (OUTF, ">out_file") || die "cannot open out_file:
        $!"; open (LOGF, ">>log_file") || die "cannot open
        log_file: $!";
     print OUTF "Here is my program outputn";
     print LOGF "First task of my program completedn";
     print "Nice, isn't it?n"; # will be printed on the screen
        close (OUTF);
     close (LOGF);
Using filehandles for reading (2/3)


    When <FILEHANDLE> is assigned into an array variable, all lines up to the end of
        the file are read at once. Each line becomes a separate element of the array.
    #!/usr/local/bin/perl
    use strict;
    use warnings;

    my $infile = "CEACAM3.txt";
    open (FH, $infile) || die "cannot open "$infile": $!";
    my @lines = <FH>;
    chomp (@lines); # chomp each element of @lines
    close (FH);

    # to process the lines you might wish to iterate
    # over the @lines array with a foreach loop:
    my $line;
    foreach $line (@lines) {
      # process $line. here we just print it.
      print "$linen";
    }
Using filehandles for reading (1/3)

    #!/usr/local/bin/perl
    use strict;
    use warnings;

    my $infile = "CEACAM3.txt";
    my ($line1, $line2, $line3);

    open (FH, $infile) || die "cannot open "$infile": $!";

    $line1 = <FH>; # read first line
    print $line1; # proccess line (here we only print it)
    $line2 = <FH>; # read next line
    print $line2; # proccess line (here we only print it)
    $line3 = <FH>; # read next line
    print $line3; # proccess line (here we only print it)

    close (FH);
Using filehandles for reading (3/3)

    Using a while loop, read one line at a time and assign it into a scalar variable, as
       long as the variable is not an empty string (which will happen at end-of-file).
    Note that a blank line read from the file will not result in an empty string, since it still
       contains the terminating n.

    #!/usr/local/bin/perl
    use strict;
    use warnings;

    my $infile = "CEACAM3.txt";
    open (FH, $infile) || die "cannot open "$infile": $!";

    my $line;             # or, in one line:
    while ($line = <FH>) { # while (my $line = <FH>) {
     chomp ($line);
     print "$linen"; # process line. here we just print it.

    }

    close (FH);
• Demo: Prosite Parser
1. Swiss-Knife.pl

• Database
   – http://www.ebi.ac.uk/swissprot/FTP/ftp.html

   – How many entries are there ?
   – Average Protein Length (in aa and MW)
   – Relative frequency of amino acids
       • Compare to the ones used to construct the PAM
         scoring matrixes from 1978 – 1991
Amino acid frequencies

           Second step: Frequencies of Occurence
                            1978    1991
                      L    0.085   0.091
                      A    0.087   0.077
                      G    0.089   0.074
                      S    0.070   0.069
                      V    0.065   0.066
                      E    0.050   0.062
                      T    0.058   0.059
                      K    0.081   0.059
                      I    0.037   0.053
                      D    0.047   0.052
                      R    0.041   0.051
                      P    0.051   0.051
                      N    0.040   0.043
                      Q    0.038   0.041
                      F    0.040   0.040
                      Y    0.030   0.032
                      M    0.015   0.024
                      H    0.034   0.023
                      C    0.033   0.020
                      W    0.010   0.014
Parser.pl
•   #! C:Perlbinperl.exe -w
•   # (Vergeet niet het pad van perl.exe hierboven aan te passen aan de plaats op je eigen computer)

•   # Voorbeeld van het gebruik van substrings en files
•   # in een parser van sequentie-informatie-records

•   use strict;
•   use warnings;

•   my ($sp_file,$line,$id,$ac,$de);

•   $sp_file= "sp.txt";
•   open (SP,$sp_file) || die "cannot open "$sp_file":$!";

•   while ($line=<SP>){
•        chomp($line);

•        my $field = substr ($line,0,2);
•        my $value = substr ($line,5);

•        if ($field eq "ID"){e
•               $id = $value
•        }
•        if ($field eq "AC"){
•               $ac = $value
•        }
•        if ($field eq "DE"){
•               $de = $value
•        }
•   }

•   print "Identification: $idn";
•   print "Accession No.: $acn";
•   print "Description: $den";
2. PAM-simulator.pl
   – Check transition matrix with and without randomizing the
     rows of evolutions

   – Adapt the program to simulate evolving DNA

   – Adapt the program so it generates random proteins taking
     into account the relative frequences found in step 1

   – Write the output to a multi-fasta file
      >PAM1
      AHFALKJHFDLKFJHALSKJFH
      >PAM2
      AHGALKJHFDLKFJHALSKJFH
      >PAM3
      AHGALKJHFDLKFJHALSKJFH
Experiment: pam-simulator.pl


• Initialize:
    – Generate Random protein (1000 aa)
• Simulate evolution (eg 250 for PAM250)
    – Apply PAM1 Transition matrix to each amino
      acid
    – Use Weighted Random Selection
• Iterate
    – Measure difference to orginal protein
Dayhoff’s PAM1 mutation probability matrix (Transition Matrix)

      A       R      N       D      C       Q      E       G      H      I
      A la    A rg   A sn    A sp   C ys    G ln   G lu    G ly   H is   Ile
      9867    2      9       10     3       8      17      21     2      6
 A
      1       9913   1       0      1       10     0       0      10     3
 R
      4       1      9822    36     0       4      6       6      21     3
 N
      6       0      42      9859   0       6      53      6      4      1
 D
      1       1      0       0      9973    0      0       0      1      1
 C
      3       9      4       5      0       9876   27      1      23     1
 Q
      10      0      7       56     0       35     9865    4      2      3
 E
      21      1      12      11     1       3      7       9935   1      0
 G
      1       8      18      3      1       20     1       0      9912   0
 H
      2       2      3       1      2       1      2       0      0      9872
 I
Weighted Random Selection

• Ala => Xxx (%)
                            A
                            R
                            N
                            D
                            C
                            Q
                            E
                            G
                            H
                            I
                            L
                            K
                            M
                            F
                            P
                            S
                            T
                            W
                            Y
                            V
PAM-Simulator


                                   PAM-simulator

              120


              100


               80
  %identity




               60


               40


               20


                0
                    0   50   100          150      200   250   300
                                          PAM
3. Palindromes

What is the longest palindroom in palin.fasta ?

Why are restriction sites palindromic ?
How long is the longest palindroom in the genome ?

Hints:
  http://www.man.poznan.pl/cmst/papers/5/art_2/vol5a
  rt2.html
  Palingram.pl
Palin.fasta
• >palin.fasta
• ATGGCTTATTTATTTGCCCACAAGAACTTAGGTGCATTGAAATCTAAA
  GCTAATTGCTTATTTAGCTTTGCTTGGCCTTTTCACTTAAATAAAACA
  TAGCATCAACTTCAGCAGGAATGGGTGCACATGCTGATCGAGGTGG
  AAGAAGGGCACATATGGCATCGGCATCCTTATGGCTAATTTTAAATG
  GAGAACTTTCTAAAGTCACGTTTTCACATGCAATATTCTTAACATTTT
  CAATTTTTTTTGTAACTAATTCTTCCCATCTACTATGTGTTTGCAAGAC
  AATCTCAGTAGCAAACTCCTTATGCTTAGCCTCACCGTTAAAAGCAA
  ACTTATTTGGGGGATCTCCACCAGGCATTTTATATATTTTGAACCACT
  CTACTGACGCGTTAGCTTCAAGTAAACCAGGCATCACTTCTTTTACG
  TCATCAATATCATTAAGCTTTGAAGCTAGAGGATCATTTACATCAATT
  GCTATTACTTAGCTTAGCCCTTCAAGTACTTGAAGGGCTAAGCTTCC
  AATCTGTTTCACCATTGTCAATCATAGCTAAGACACCCAGCAACTTAA
  CTTGCAAAACAGATCCTCTTTCTGCAACTTTGTAACCTATCTCTATTA
  CATCAACAGGATCACCATCACCAAATGCATTAGTGTGCTCATCAATA
  AGATTTGGATCCTCCCAAGTCTGTGGCAAAGCTCCATAATTCCAAGG
  ATAACC
Palingram.pl
 #!E:perlbinperl -w
 $line_input = "edellede parterretrap trap op sirenes en er is popart test";
 $line_input =~ s/s//g;
 $l = length($line_input);
 for ($m = 0;$m<=$l-1;$m++)
 {
 $line = substr($line_input,$m);
 print "length=$m:$lt".$line."n";
 for $n (8..25)
   {                                                                    print "Set van palingramn";
   $re = qr /[a-z]{$n}/;
   print "pattern ($n) = $ren";                                        while(($key, $value) = each    (%palhash))
   $regexes[$n-8] = $re;                                                   {
   }
 foreach (@regexes)                                                        print "$key => $valuen";
      {                                                                    }
      while ($line =~ m/$_/g)
        {
        $endline = $';
        $match = $&;
        $all = $match.$endline;
        $revmatch = reverse($match);
        if ($all =~ /^($revmatch)/)
                  {
                  $palindrome = $revmatch . "*" . $1 ;
                  $palhash{$palindrome}++;
                  }
        }
      }
 }

Weitere ähnliche Inhalte

Was ist angesagt?

Scroll pHAT HD に美咲フォント
Scroll pHAT HD に美咲フォントScroll pHAT HD に美咲フォント
Scroll pHAT HD に美咲フォントYuriko IKEDA
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Kang-min Liu
 
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101hendrikvb
 
Introduction to shell scripting
Introduction to shell scriptingIntroduction to shell scripting
Introduction to shell scriptingCorrado Santoro
 
The Joy of Smartmatch
The Joy of SmartmatchThe Joy of Smartmatch
The Joy of SmartmatchAndrew Shitov
 
OpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpen Gurukul
 
Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)brian d foy
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworksdiego_k
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojobpmedley
 
Hypers and Gathers and Takes! Oh my!
Hypers and Gathers and Takes! Oh my!Hypers and Gathers and Takes! Oh my!
Hypers and Gathers and Takes! Oh my!Workhorse Computing
 
Creating "Secure" PHP Applications, Part 1, Explicit Code & QA
Creating "Secure" PHP Applications, Part 1, Explicit Code & QACreating "Secure" PHP Applications, Part 1, Explicit Code & QA
Creating "Secure" PHP Applications, Part 1, Explicit Code & QAarchwisp
 
Replacing "exec" with a type and provider: Return manifests to a declarative ...
Replacing "exec" with a type and provider: Return manifests to a declarative ...Replacing "exec" with a type and provider: Return manifests to a declarative ...
Replacing "exec" with a type and provider: Return manifests to a declarative ...Puppet
 
BSDM with BASH: Command Interpolation
BSDM with BASH: Command InterpolationBSDM with BASH: Command Interpolation
BSDM with BASH: Command InterpolationWorkhorse Computing
 
(Parameterized) Roles
(Parameterized) Roles(Parameterized) Roles
(Parameterized) Rolessartak
 
Good Evils In Perl
Good Evils In PerlGood Evils In Perl
Good Evils In PerlKang-min Liu
 

Was ist angesagt? (20)

Memory Manglement in Raku
Memory Manglement in RakuMemory Manglement in Raku
Memory Manglement in Raku
 
Vim Hacks
Vim HacksVim Hacks
Vim Hacks
 
Perl6 in-production
Perl6 in-productionPerl6 in-production
Perl6 in-production
 
Scroll pHAT HD に美咲フォント
Scroll pHAT HD に美咲フォントScroll pHAT HD に美咲フォント
Scroll pHAT HD に美咲フォント
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
 
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101
 
Introduction to shell scripting
Introduction to shell scriptingIntroduction to shell scripting
Introduction to shell scripting
 
Chap06
Chap06Chap06
Chap06
 
The Joy of Smartmatch
The Joy of SmartmatchThe Joy of Smartmatch
The Joy of Smartmatch
 
OpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell Scripting
 
Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)Benchmarking Perl (Chicago UniForum 2006)
Benchmarking Perl (Chicago UniForum 2006)
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojo
 
Hypers and Gathers and Takes! Oh my!
Hypers and Gathers and Takes! Oh my!Hypers and Gathers and Takes! Oh my!
Hypers and Gathers and Takes! Oh my!
 
Creating "Secure" PHP Applications, Part 1, Explicit Code & QA
Creating "Secure" PHP Applications, Part 1, Explicit Code & QACreating "Secure" PHP Applications, Part 1, Explicit Code & QA
Creating "Secure" PHP Applications, Part 1, Explicit Code & QA
 
Replacing "exec" with a type and provider: Return manifests to a declarative ...
Replacing "exec" with a type and provider: Return manifests to a declarative ...Replacing "exec" with a type and provider: Return manifests to a declarative ...
Replacing "exec" with a type and provider: Return manifests to a declarative ...
 
BSDM with BASH: Command Interpolation
BSDM with BASH: Command InterpolationBSDM with BASH: Command Interpolation
BSDM with BASH: Command Interpolation
 
(Parameterized) Roles
(Parameterized) Roles(Parameterized) Roles
(Parameterized) Roles
 
C99
C99C99
C99
 
Good Evils In Perl
Good Evils In PerlGood Evils In Perl
Good Evils In Perl
 

Andere mochten auch

Bioinformatica t9-t10-biocheminformatics
Bioinformatica t9-t10-biocheminformaticsBioinformatica t9-t10-biocheminformatics
Bioinformatica t9-t10-biocheminformaticsProf. Wim Van Criekinge
 
2012 12 02_epigenetic_profiling_environmental_health_sciences
2012 12 02_epigenetic_profiling_environmental_health_sciences2012 12 02_epigenetic_profiling_environmental_health_sciences
2012 12 02_epigenetic_profiling_environmental_health_sciencesProf. Wim Van Criekinge
 
2016 bioinformatics i_score_matrices_wim_vancriekinge
2016 bioinformatics i_score_matrices_wim_vancriekinge2016 bioinformatics i_score_matrices_wim_vancriekinge
2016 bioinformatics i_score_matrices_wim_vancriekingeProf. Wim Van Criekinge
 
2016 bioinformatics i_python_part_2_strings_wim_vancriekinge
2016 bioinformatics i_python_part_2_strings_wim_vancriekinge2016 bioinformatics i_python_part_2_strings_wim_vancriekinge
2016 bioinformatics i_python_part_2_strings_wim_vancriekingeProf. Wim Van Criekinge
 
2016 bioinformatics i_io_wim_vancriekinge
2016 bioinformatics i_io_wim_vancriekinge2016 bioinformatics i_io_wim_vancriekinge
2016 bioinformatics i_io_wim_vancriekingeProf. Wim Van Criekinge
 
2016 bioinformatics i_phylogenetics_wim_vancriekinge
2016 bioinformatics i_phylogenetics_wim_vancriekinge2016 bioinformatics i_phylogenetics_wim_vancriekinge
2016 bioinformatics i_phylogenetics_wim_vancriekingeProf. Wim Van Criekinge
 
2016 bioinformatics i_database_searching_wimvancriekinge
2016 bioinformatics i_database_searching_wimvancriekinge2016 bioinformatics i_database_searching_wimvancriekinge
2016 bioinformatics i_database_searching_wimvancriekingeProf. Wim Van Criekinge
 
2016 bioinformatics i_bio_python_ii_wimvancriekinge
2016 bioinformatics i_bio_python_ii_wimvancriekinge2016 bioinformatics i_bio_python_ii_wimvancriekinge
2016 bioinformatics i_bio_python_ii_wimvancriekingeProf. Wim Van Criekinge
 
2016 bioinformatics i_proteins_wim_vancriekinge
2016 bioinformatics i_proteins_wim_vancriekinge2016 bioinformatics i_proteins_wim_vancriekinge
2016 bioinformatics i_proteins_wim_vancriekingeProf. Wim Van Criekinge
 
2016 bioinformatics i_bio_cheminformatics_wimvancriekinge
2016 bioinformatics i_bio_cheminformatics_wimvancriekinge2016 bioinformatics i_bio_cheminformatics_wimvancriekinge
2016 bioinformatics i_bio_cheminformatics_wimvancriekingeProf. Wim Van Criekinge
 
2016 bioinformatics i_bio_python_wimvancriekinge
2016 bioinformatics i_bio_python_wimvancriekinge2016 bioinformatics i_bio_python_wimvancriekinge
2016 bioinformatics i_bio_python_wimvancriekingeProf. Wim Van Criekinge
 
2016 bioinformatics i_python_part_3_io_and_strings_wim_vancriekinge
2016 bioinformatics i_python_part_3_io_and_strings_wim_vancriekinge2016 bioinformatics i_python_part_3_io_and_strings_wim_vancriekinge
2016 bioinformatics i_python_part_3_io_and_strings_wim_vancriekingeProf. Wim Van Criekinge
 

Andere mochten auch (17)

Bioinformatica t9-t10-biocheminformatics
Bioinformatica t9-t10-biocheminformaticsBioinformatica t9-t10-biocheminformatics
Bioinformatica t9-t10-biocheminformatics
 
Bioinformatics life sciences_2012
Bioinformatics life sciences_2012Bioinformatics life sciences_2012
Bioinformatics life sciences_2012
 
2012 12 02_epigenetic_profiling_environmental_health_sciences
2012 12 02_epigenetic_profiling_environmental_health_sciences2012 12 02_epigenetic_profiling_environmental_health_sciences
2012 12 02_epigenetic_profiling_environmental_health_sciences
 
Bioinformatica p6-bioperl
Bioinformatica p6-bioperlBioinformatica p6-bioperl
Bioinformatica p6-bioperl
 
Bioinformatica t6-phylogenetics
Bioinformatica t6-phylogeneticsBioinformatica t6-phylogenetics
Bioinformatica t6-phylogenetics
 
Bioinformatica t7-protein structure
Bioinformatica t7-protein structureBioinformatica t7-protein structure
Bioinformatica t7-protein structure
 
Bioinformatica t8-go-hmm
Bioinformatica t8-go-hmmBioinformatica t8-go-hmm
Bioinformatica t8-go-hmm
 
2016 bioinformatics i_score_matrices_wim_vancriekinge
2016 bioinformatics i_score_matrices_wim_vancriekinge2016 bioinformatics i_score_matrices_wim_vancriekinge
2016 bioinformatics i_score_matrices_wim_vancriekinge
 
2016 bioinformatics i_python_part_2_strings_wim_vancriekinge
2016 bioinformatics i_python_part_2_strings_wim_vancriekinge2016 bioinformatics i_python_part_2_strings_wim_vancriekinge
2016 bioinformatics i_python_part_2_strings_wim_vancriekinge
 
2016 bioinformatics i_io_wim_vancriekinge
2016 bioinformatics i_io_wim_vancriekinge2016 bioinformatics i_io_wim_vancriekinge
2016 bioinformatics i_io_wim_vancriekinge
 
2016 bioinformatics i_phylogenetics_wim_vancriekinge
2016 bioinformatics i_phylogenetics_wim_vancriekinge2016 bioinformatics i_phylogenetics_wim_vancriekinge
2016 bioinformatics i_phylogenetics_wim_vancriekinge
 
2016 bioinformatics i_database_searching_wimvancriekinge
2016 bioinformatics i_database_searching_wimvancriekinge2016 bioinformatics i_database_searching_wimvancriekinge
2016 bioinformatics i_database_searching_wimvancriekinge
 
2016 bioinformatics i_bio_python_ii_wimvancriekinge
2016 bioinformatics i_bio_python_ii_wimvancriekinge2016 bioinformatics i_bio_python_ii_wimvancriekinge
2016 bioinformatics i_bio_python_ii_wimvancriekinge
 
2016 bioinformatics i_proteins_wim_vancriekinge
2016 bioinformatics i_proteins_wim_vancriekinge2016 bioinformatics i_proteins_wim_vancriekinge
2016 bioinformatics i_proteins_wim_vancriekinge
 
2016 bioinformatics i_bio_cheminformatics_wimvancriekinge
2016 bioinformatics i_bio_cheminformatics_wimvancriekinge2016 bioinformatics i_bio_cheminformatics_wimvancriekinge
2016 bioinformatics i_bio_cheminformatics_wimvancriekinge
 
2016 bioinformatics i_bio_python_wimvancriekinge
2016 bioinformatics i_bio_python_wimvancriekinge2016 bioinformatics i_bio_python_wimvancriekinge
2016 bioinformatics i_bio_python_wimvancriekinge
 
2016 bioinformatics i_python_part_3_io_and_strings_wim_vancriekinge
2016 bioinformatics i_python_part_3_io_and_strings_wim_vancriekinge2016 bioinformatics i_python_part_3_io_and_strings_wim_vancriekinge
2016 bioinformatics i_python_part_3_io_and_strings_wim_vancriekinge
 

Ähnlich wie Bioinformatica p4-io

Bioinformatics p4-io v2013-wim_vancriekinge
Bioinformatics p4-io v2013-wim_vancriekingeBioinformatics p4-io v2013-wim_vancriekinge
Bioinformatics p4-io v2013-wim_vancriekingeProf. Wim Van Criekinge
 
Lecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationLecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationMohammed Farrag
 
Bioinformatica: Esercizi su Perl, espressioni regolari e altre amenità (BMR G...
Bioinformatica: Esercizi su Perl, espressioni regolari e altre amenità (BMR G...Bioinformatica: Esercizi su Perl, espressioni regolari e altre amenità (BMR G...
Bioinformatica: Esercizi su Perl, espressioni regolari e altre amenità (BMR G...Andrea Telatin
 
How Xslate Works
How Xslate WorksHow Xslate Works
How Xslate WorksGoro Fuji
 
Dealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter ScottDealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter ScottO'Reilly Media
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to PerlDave Cross
 
Internet Technology and its Applications
Internet Technology and its ApplicationsInternet Technology and its Applications
Internet Technology and its Applicationsamichoksi
 
Introduction to Perl - Day 1
Introduction to Perl - Day 1Introduction to Perl - Day 1
Introduction to Perl - Day 1Dave Cross
 
Clean & Typechecked JS
Clean & Typechecked JSClean & Typechecked JS
Clean & Typechecked JSArthur Puthin
 
Fundamentals of programming angeli
Fundamentals of programming angeliFundamentals of programming angeli
Fundamentals of programming angelibergonio11339481
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsDr.Ravi
 
An introduction to Raku
An introduction to RakuAn introduction to Raku
An introduction to RakuSimon Proctor
 
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkTYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkChristian Trabold
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentationbrian_dailey
 
Beautiful PHP CLI Scripts
Beautiful PHP CLI ScriptsBeautiful PHP CLI Scripts
Beautiful PHP CLI ScriptsJesse Donat
 

Ähnlich wie Bioinformatica p4-io (20)

Bioinformatics p4-io v2013-wim_vancriekinge
Bioinformatics p4-io v2013-wim_vancriekingeBioinformatics p4-io v2013-wim_vancriekinge
Bioinformatics p4-io v2013-wim_vancriekinge
 
Bioinformatica 27-10-2011-p4-files
Bioinformatica 27-10-2011-p4-filesBioinformatica 27-10-2011-p4-files
Bioinformatica 27-10-2011-p4-files
 
Lecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administrationLecture 3 Perl & FreeBSD administration
Lecture 3 Perl & FreeBSD administration
 
Bioinformatica: Esercizi su Perl, espressioni regolari e altre amenità (BMR G...
Bioinformatica: Esercizi su Perl, espressioni regolari e altre amenità (BMR G...Bioinformatica: Esercizi su Perl, espressioni regolari e altre amenità (BMR G...
Bioinformatica: Esercizi su Perl, espressioni regolari e altre amenità (BMR G...
 
Perl Presentation
Perl PresentationPerl Presentation
Perl Presentation
 
Easy R
Easy REasy R
Easy R
 
How Xslate Works
How Xslate WorksHow Xslate Works
How Xslate Works
 
Dealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter ScottDealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter Scott
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
 
Internet Technology and its Applications
Internet Technology and its ApplicationsInternet Technology and its Applications
Internet Technology and its Applications
 
Introduction to Perl - Day 1
Introduction to Perl - Day 1Introduction to Perl - Day 1
Introduction to Perl - Day 1
 
Clean & Typechecked JS
Clean & Typechecked JSClean & Typechecked JS
Clean & Typechecked JS
 
Fuzzing - A Tale of Two Cultures
Fuzzing - A Tale of Two CulturesFuzzing - A Tale of Two Cultures
Fuzzing - A Tale of Two Cultures
 
Fundamentals of programming angeli
Fundamentals of programming angeliFundamentals of programming angeli
Fundamentals of programming angeli
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
An introduction to Raku
An introduction to RakuAn introduction to Raku
An introduction to Raku
 
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkTYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase framework
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentation
 
Beautiful PHP CLI Scripts
Beautiful PHP CLI ScriptsBeautiful PHP CLI Scripts
Beautiful PHP CLI Scripts
 
Prototype js
Prototype jsPrototype js
Prototype js
 

Mehr von Prof. Wim Van Criekinge

2019 03 05_biological_databases_part5_v_upload
2019 03 05_biological_databases_part5_v_upload2019 03 05_biological_databases_part5_v_upload
2019 03 05_biological_databases_part5_v_uploadProf. Wim Van Criekinge
 
2019 03 05_biological_databases_part4_v_upload
2019 03 05_biological_databases_part4_v_upload2019 03 05_biological_databases_part4_v_upload
2019 03 05_biological_databases_part4_v_uploadProf. Wim Van Criekinge
 
2019 03 05_biological_databases_part3_v_upload
2019 03 05_biological_databases_part3_v_upload2019 03 05_biological_databases_part3_v_upload
2019 03 05_biological_databases_part3_v_uploadProf. Wim Van Criekinge
 
2019 02 21_biological_databases_part2_v_upload
2019 02 21_biological_databases_part2_v_upload2019 02 21_biological_databases_part2_v_upload
2019 02 21_biological_databases_part2_v_uploadProf. Wim Van Criekinge
 
2019 02 12_biological_databases_part1_v_upload
2019 02 12_biological_databases_part1_v_upload2019 02 12_biological_databases_part1_v_upload
2019 02 12_biological_databases_part1_v_uploadProf. Wim Van Criekinge
 
Bio ontologies and semantic technologies[2]
Bio ontologies and semantic technologies[2]Bio ontologies and semantic technologies[2]
Bio ontologies and semantic technologies[2]Prof. Wim Van Criekinge
 
2018 03 27_biological_databases_part4_v_upload
2018 03 27_biological_databases_part4_v_upload2018 03 27_biological_databases_part4_v_upload
2018 03 27_biological_databases_part4_v_uploadProf. Wim Van Criekinge
 
2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_uploadProf. Wim Van Criekinge
 
2018 02 20_biological_databases_part1_v_upload
2018 02 20_biological_databases_part1_v_upload2018 02 20_biological_databases_part1_v_upload
2018 02 20_biological_databases_part1_v_uploadProf. Wim Van Criekinge
 

Mehr von Prof. Wim Van Criekinge (20)

2020 02 11_biological_databases_part1
2020 02 11_biological_databases_part12020 02 11_biological_databases_part1
2020 02 11_biological_databases_part1
 
2019 03 05_biological_databases_part5_v_upload
2019 03 05_biological_databases_part5_v_upload2019 03 05_biological_databases_part5_v_upload
2019 03 05_biological_databases_part5_v_upload
 
2019 03 05_biological_databases_part4_v_upload
2019 03 05_biological_databases_part4_v_upload2019 03 05_biological_databases_part4_v_upload
2019 03 05_biological_databases_part4_v_upload
 
2019 03 05_biological_databases_part3_v_upload
2019 03 05_biological_databases_part3_v_upload2019 03 05_biological_databases_part3_v_upload
2019 03 05_biological_databases_part3_v_upload
 
2019 02 21_biological_databases_part2_v_upload
2019 02 21_biological_databases_part2_v_upload2019 02 21_biological_databases_part2_v_upload
2019 02 21_biological_databases_part2_v_upload
 
2019 02 12_biological_databases_part1_v_upload
2019 02 12_biological_databases_part1_v_upload2019 02 12_biological_databases_part1_v_upload
2019 02 12_biological_databases_part1_v_upload
 
P7 2018 biopython3
P7 2018 biopython3P7 2018 biopython3
P7 2018 biopython3
 
P6 2018 biopython2b
P6 2018 biopython2bP6 2018 biopython2b
P6 2018 biopython2b
 
P4 2018 io_functions
P4 2018 io_functionsP4 2018 io_functions
P4 2018 io_functions
 
P3 2018 python_regexes
P3 2018 python_regexesP3 2018 python_regexes
P3 2018 python_regexes
 
T1 2018 bioinformatics
T1 2018 bioinformaticsT1 2018 bioinformatics
T1 2018 bioinformatics
 
P1 2018 python
P1 2018 pythonP1 2018 python
P1 2018 python
 
Bio ontologies and semantic technologies[2]
Bio ontologies and semantic technologies[2]Bio ontologies and semantic technologies[2]
Bio ontologies and semantic technologies[2]
 
2018 05 08_biological_databases_no_sql
2018 05 08_biological_databases_no_sql2018 05 08_biological_databases_no_sql
2018 05 08_biological_databases_no_sql
 
2018 03 27_biological_databases_part4_v_upload
2018 03 27_biological_databases_part4_v_upload2018 03 27_biological_databases_part4_v_upload
2018 03 27_biological_databases_part4_v_upload
 
2018 03 20_biological_databases_part3
2018 03 20_biological_databases_part32018 03 20_biological_databases_part3
2018 03 20_biological_databases_part3
 
2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload
 
2018 02 20_biological_databases_part1_v_upload
2018 02 20_biological_databases_part1_v_upload2018 02 20_biological_databases_part1_v_upload
2018 02 20_biological_databases_part1_v_upload
 
P7 2017 biopython3
P7 2017 biopython3P7 2017 biopython3
P7 2017 biopython3
 
P6 2017 biopython2
P6 2017 biopython2P6 2017 biopython2
P6 2017 biopython2
 

Kürzlich hochgeladen

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 

Kürzlich hochgeladen (20)

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 

Bioinformatica p4-io

  • 1.
  • 2. FBW 23-10-2012 Wim Van Criekinge
  • 3. Programming • Variables • Flow control (if, regex …) • Loops • input/output • Subroutines/object
  • 4. Three Basic Data Types • Scalars - $ • Arrays of scalars - @ • Associative arrays of scalers or Hashes - %
  • 6. The „structure‟ of a Hash • An array looks something like this: 0 1 2 Index @array = 'val1' 'val2' 'val3' Value • A hash looks something like this: Rob Matt Joe_A Key (name) %phone = 353-7236 353-7122 555-1212 Value
  • 7. Printing a hash (continued) • First, create a list of keys. Fortunately, there is a function for that: – keys %hash (returns a list of keys) • Next, visit each key and print its associated value: foreach (keys %hash){ print “The key $_ has the value $hash{$_}n”; } • One complication. Hashes do not maintain any sort of order. In other words, if you put key/value pairs into a hash in a particular order, you will not get them out in that order!!
  • 8. my %AA1 = ( 'AUU','I', 'UUU','F', 'AUC','I', 'UUC','F', 'AUA','I', 'UUA','L', 'AUG','M', 'UUG','L', 'ACU','T', 'UCU','S', 'ACC','T', 'UCC','S', 'ACA','T', 'UCA','S', 'ACG','T', 'UCG','S', 'AAU','N', 'UAU','Y', 'AAC','N', 'UAC','Y', 'AAA','K', 'UAA','*', 'AAG','K', 'UAG','*', 'AGU','S', 'UGU','C', 'AGC','S', 'UGC','C', 'AGA','R', 'UGA','*', 'AGG','R', 'UGG','W', 'GUU','V', 'CUU','L', 'GUC','V', 'CUC','L', 'GUA','V', 'CUA','L', 'GUG','V', 'CUG','L', 'GCU','A', 'CCU','P', 'GCC','A', 'CCC','P', 'GCA','A', 'CCA','P', 'GCG','A', 'CCG','P', 'GAU','D', 'CAU','H', 'GAC','D', 'CAC','H', 'GAA','E', 'CAA','Q', 'GAG','E', 'CAG','Q', 'GGU','G', 'CGU','R', 'GGC','G', 'CGC','R', 'GGA','G', 'CGA','R', 'GGG','G' ); 'CGG','R',
  • 9. Programming in general and Perl in particular • There is more than one right way to do it. Unfortunately, there are also many wrong ways. – 1. Always check and make sure the output is correct and logical • Consider what errors might occur, and take steps to ensure that you are accounting for them. – 2. Check to make sure you are using every variable you declare. • Use Strict ! – 3. Always go back to a script once it is working and see if you can eliminate unnecessary steps. • Concise code is good code. • You will learn more if you optimize your code. • Concise does not mean comment free. Please use as many comments as you think are necessary. • Sometimes you want to leave easy to understand code in, rather than short but difficult to understand tricks. Use your judgment. • Remember that in the future, you may wish to use or alter the code you wrote today. If you don‟t understand it today, you won‟t tomorrow.
  • 10. Programming in general and Perl in particular Develop your program in stages. Once part of it works, save the working version to another file (or use a source code control system like RCS) before continuing to improve it. When running interactively, show the user signs of activity. There is no need to dump everything to the screen (unless requested to), but a few words or a number change every few minutes will show that your program is doing something. Comment your script. Any information on what it is doing or why might be useful to you a few months later. Decide on a coding convention and stick to it. For example, – for variable names, begin globals with a capital letter and privates (my) with a lower case letter – indent new control structures with (say) 2 spaces – line up closing braces, as in: if (....) { ... ... } – Add blank lines between sections to improve readibility
  • 11. >ultimate-sequence ACTCGTTATGATATTTTTTTTGAACGTGAAAATACTTTTCGTGC TATGGAAGGACTCGTTATCGTGAAGTTGAACGTTCTGAATG TATGCCTCTTGAAATGGAAAATACTCATTGTTTATCTGAAAT TTGAATGGGAATTTTATCTACAATGTTTTATTCTTACAGAAC ATTAAATTGTGTTATGTTTCATTTCACATTTTAGTAGTTTTTT CAGTGAAAGCTTGAAAACCACCAAGAAGAAAAGCTGGTAT GCGTAGCTATGTATATATAAAATTAGATTTTCCACAAAAAAT GATCTGATAAACCTTCTCTGTTGGCTCCAAGTATAAGTACG AAAAGAAATACGTTCCCAAGAATTAGCTTCATGAGTAAGAA GAAAAGCTGGTATGCGTAGCTATGTATATATAAAATTAGATT TTCCACAAAAAATGATCTGATAA
  • 12. File input / output Opening a filehandle • In order to use a filehandle other than STDIN, STDOUT and STDERR, the filehandle needs to be opened. The open function opens a file or device and associates it with a filehandle. • It returns 1 upon success and undef otherwise. Examples • # open a filehandle for reading: open (SOURCE_FILE, "filename"); • # or open (SOURCE_FILE, "<filename"); • # open a filehandle for writing: open (RESULT_FILE, ">filename"); • # open a filehandle for appending: open (LOGFILE, ">>filename";
  • 13. File input / output Closing a filehandle • When you are finished with a filehandle, you may close it with the close function. The close function closes the file or device associated with the filehandle. Example: • close (MY_FILE_HANDLE); Filehandles are automatically closed when the program exits, or when the filehandle is reopened.
  • 14. File input / output The die function • Sometimes the open function fails. For example, opening a file for input might fail because the file does not exist, and opening a file for output might fail because the file does not have a write permission. A perl program will nevertheless use the filehandle, and will not warn you that all input and output activities are actually meaningless. • Therefore, it is recommended to explicitly check the result of the open command, and if it fails to print an error message and exit the program. • This is easily done using the die function. Example: • my $k = open (FILEHANDLE, "filename"); unless ($k) { die ("cannot open file filename: $!"); } # in case file "filename" cannot be opened, # the argument of die will be printed on # the screen and the program will exit. # $! is a special variable that contains the respective # error message sent by the operating system.. A short hand: • open (FILEHANDLE, "filename") || die "cannot open file filename: $!";
  • 15. Using filehandles for writing Example: #!/usr/local/bin/perl use strict; use warnings; open (OUTF, ">out_file") || die "cannot open out_file: $!"; open (LOGF, ">>log_file") || die "cannot open log_file: $!"; print OUTF "Here is my program outputn"; print LOGF "First task of my program completedn"; print "Nice, isn't it?n"; # will be printed on the screen close (OUTF); close (LOGF);
  • 16. Using filehandles for reading (2/3) When <FILEHANDLE> is assigned into an array variable, all lines up to the end of the file are read at once. Each line becomes a separate element of the array. #!/usr/local/bin/perl use strict; use warnings; my $infile = "CEACAM3.txt"; open (FH, $infile) || die "cannot open "$infile": $!"; my @lines = <FH>; chomp (@lines); # chomp each element of @lines close (FH); # to process the lines you might wish to iterate # over the @lines array with a foreach loop: my $line; foreach $line (@lines) { # process $line. here we just print it. print "$linen"; }
  • 17. Using filehandles for reading (1/3) #!/usr/local/bin/perl use strict; use warnings; my $infile = "CEACAM3.txt"; my ($line1, $line2, $line3); open (FH, $infile) || die "cannot open "$infile": $!"; $line1 = <FH>; # read first line print $line1; # proccess line (here we only print it) $line2 = <FH>; # read next line print $line2; # proccess line (here we only print it) $line3 = <FH>; # read next line print $line3; # proccess line (here we only print it) close (FH);
  • 18. Using filehandles for reading (3/3) Using a while loop, read one line at a time and assign it into a scalar variable, as long as the variable is not an empty string (which will happen at end-of-file). Note that a blank line read from the file will not result in an empty string, since it still contains the terminating n. #!/usr/local/bin/perl use strict; use warnings; my $infile = "CEACAM3.txt"; open (FH, $infile) || die "cannot open "$infile": $!"; my $line; # or, in one line: while ($line = <FH>) { # while (my $line = <FH>) { chomp ($line); print "$linen"; # process line. here we just print it. } close (FH);
  • 20. 1. Swiss-Knife.pl • Database – http://www.ebi.ac.uk/swissprot/FTP/ftp.html – How many entries are there ? – Average Protein Length (in aa and MW) – Relative frequency of amino acids • Compare to the ones used to construct the PAM scoring matrixes from 1978 – 1991
  • 21. Amino acid frequencies Second step: Frequencies of Occurence 1978 1991 L 0.085 0.091 A 0.087 0.077 G 0.089 0.074 S 0.070 0.069 V 0.065 0.066 E 0.050 0.062 T 0.058 0.059 K 0.081 0.059 I 0.037 0.053 D 0.047 0.052 R 0.041 0.051 P 0.051 0.051 N 0.040 0.043 Q 0.038 0.041 F 0.040 0.040 Y 0.030 0.032 M 0.015 0.024 H 0.034 0.023 C 0.033 0.020 W 0.010 0.014
  • 22. Parser.pl • #! C:Perlbinperl.exe -w • # (Vergeet niet het pad van perl.exe hierboven aan te passen aan de plaats op je eigen computer) • # Voorbeeld van het gebruik van substrings en files • # in een parser van sequentie-informatie-records • use strict; • use warnings; • my ($sp_file,$line,$id,$ac,$de); • $sp_file= "sp.txt"; • open (SP,$sp_file) || die "cannot open "$sp_file":$!"; • while ($line=<SP>){ • chomp($line); • my $field = substr ($line,0,2); • my $value = substr ($line,5); • if ($field eq "ID"){e • $id = $value • } • if ($field eq "AC"){ • $ac = $value • } • if ($field eq "DE"){ • $de = $value • } • } • print "Identification: $idn"; • print "Accession No.: $acn"; • print "Description: $den";
  • 23. 2. PAM-simulator.pl – Check transition matrix with and without randomizing the rows of evolutions – Adapt the program to simulate evolving DNA – Adapt the program so it generates random proteins taking into account the relative frequences found in step 1 – Write the output to a multi-fasta file >PAM1 AHFALKJHFDLKFJHALSKJFH >PAM2 AHGALKJHFDLKFJHALSKJFH >PAM3 AHGALKJHFDLKFJHALSKJFH
  • 24. Experiment: pam-simulator.pl • Initialize: – Generate Random protein (1000 aa) • Simulate evolution (eg 250 for PAM250) – Apply PAM1 Transition matrix to each amino acid – Use Weighted Random Selection • Iterate – Measure difference to orginal protein
  • 25. Dayhoff’s PAM1 mutation probability matrix (Transition Matrix) A R N D C Q E G H I A la A rg A sn A sp C ys G ln G lu G ly H is Ile 9867 2 9 10 3 8 17 21 2 6 A 1 9913 1 0 1 10 0 0 10 3 R 4 1 9822 36 0 4 6 6 21 3 N 6 0 42 9859 0 6 53 6 4 1 D 1 1 0 0 9973 0 0 0 1 1 C 3 9 4 5 0 9876 27 1 23 1 Q 10 0 7 56 0 35 9865 4 2 3 E 21 1 12 11 1 3 7 9935 1 0 G 1 8 18 3 1 20 1 0 9912 0 H 2 2 3 1 2 1 2 0 0 9872 I
  • 26. Weighted Random Selection • Ala => Xxx (%) A R N D C Q E G H I L K M F P S T W Y V
  • 27. PAM-Simulator PAM-simulator 120 100 80 %identity 60 40 20 0 0 50 100 150 200 250 300 PAM
  • 28. 3. Palindromes What is the longest palindroom in palin.fasta ? Why are restriction sites palindromic ? How long is the longest palindroom in the genome ? Hints: http://www.man.poznan.pl/cmst/papers/5/art_2/vol5a rt2.html Palingram.pl
  • 29. Palin.fasta • >palin.fasta • ATGGCTTATTTATTTGCCCACAAGAACTTAGGTGCATTGAAATCTAAA GCTAATTGCTTATTTAGCTTTGCTTGGCCTTTTCACTTAAATAAAACA TAGCATCAACTTCAGCAGGAATGGGTGCACATGCTGATCGAGGTGG AAGAAGGGCACATATGGCATCGGCATCCTTATGGCTAATTTTAAATG GAGAACTTTCTAAAGTCACGTTTTCACATGCAATATTCTTAACATTTT CAATTTTTTTTGTAACTAATTCTTCCCATCTACTATGTGTTTGCAAGAC AATCTCAGTAGCAAACTCCTTATGCTTAGCCTCACCGTTAAAAGCAA ACTTATTTGGGGGATCTCCACCAGGCATTTTATATATTTTGAACCACT CTACTGACGCGTTAGCTTCAAGTAAACCAGGCATCACTTCTTTTACG TCATCAATATCATTAAGCTTTGAAGCTAGAGGATCATTTACATCAATT GCTATTACTTAGCTTAGCCCTTCAAGTACTTGAAGGGCTAAGCTTCC AATCTGTTTCACCATTGTCAATCATAGCTAAGACACCCAGCAACTTAA CTTGCAAAACAGATCCTCTTTCTGCAACTTTGTAACCTATCTCTATTA CATCAACAGGATCACCATCACCAAATGCATTAGTGTGCTCATCAATA AGATTTGGATCCTCCCAAGTCTGTGGCAAAGCTCCATAATTCCAAGG ATAACC
  • 30. Palingram.pl #!E:perlbinperl -w $line_input = "edellede parterretrap trap op sirenes en er is popart test"; $line_input =~ s/s//g; $l = length($line_input); for ($m = 0;$m<=$l-1;$m++) { $line = substr($line_input,$m); print "length=$m:$lt".$line."n"; for $n (8..25) { print "Set van palingramn"; $re = qr /[a-z]{$n}/; print "pattern ($n) = $ren"; while(($key, $value) = each (%palhash)) $regexes[$n-8] = $re; { } foreach (@regexes) print "$key => $valuen"; { } while ($line =~ m/$_/g) { $endline = $'; $match = $&; $all = $match.$endline; $revmatch = reverse($match); if ($all =~ /^($revmatch)/) { $palindrome = $revmatch . "*" . $1 ; $palhash{$palindrome}++; } } } }