Open main menu

Biolecture.org β

Motif search

Revision as of 11:29, 16 June 2016 by imported>Seung-hoon Kim
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

What is motif?

Motif is a sequence which has a special meaning in DNA, RNA, and protein

 

To find a motif, we can use

1. subroutine (you can refer to basic perl grammar)

2. my : an operator to make a new variable in a local space

3. @_;   : Within a subroutine the array @_ contains the parameters passed to that subroutine 1)

 

Ex) Make a subroutine to find a motif 'GAATTC' which is a recognition site of restriction enzyme EcoRI

 

sub motif_search {

   use strict;

   use warnings;

   my ($seq) = @_;

   my $motif = 'GAATTC';

   print "Motif Search Results\n";

   if ( $seq =~ /$motif/ ) {

       print "$motif found!\n";

   } else {

       print $motif not found!\n";

   }

}

 

We can use the subroutine in main program by adding this line

motif_search($seq);

Reference