Difference between revisions of "Motif search"

From Biolecture.org
imported>Seung-hoon Kim
(Created page with "<p>What is motif?</p> <p>Motif is a sequence which has a special meaning in DNA, RNA, and protein</p> <p> </p> <p>To find a motif, we can use</p> <p>1. subroutine (...")
 
imported>Seung-hoon Kim
 
Line 52: Line 52:
  
 
<p>1) <a href="http://stackoverflow.com/questions/4563485/what-is-the-meaning-of-in-perl">http://stackoverflow.com/questions/4563485/what-is-the-meaning-of-in-perl</a></p>
 
<p>1) <a href="http://stackoverflow.com/questions/4563485/what-is-the-meaning-of-in-perl">http://stackoverflow.com/questions/4563485/what-is-the-meaning-of-in-perl</a></p>
 +
 +
<p>&nbsp;</p>
 +
 +
<p>&nbsp;</p>
 +
 +
<p><a href="http://biolecture.org/index.php/KSH_0608_Bioinformatics_with_Bioperl" title="KSH 0608 Bioinformatics with Bioperl">KSH_0608 Bioinformatics with Bioperl</a></p>

Latest revision as of 11:29, 16 June 2016

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

1) http://stackoverflow.com/questions/4563485/what-is-the-meaning-of-in-perl

 

 

KSH_0608 Bioinformatics with Bioperl