Changes
From Biolecture.org
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 (..."
<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 (you can refer to basic perl grammar)</p>
<p>2. my : an operator to make a new variable in a local space</p>
<p>3. @_; : Within a subroutine the array <code>@_</code> contains the parameters passed to that subroutine <sup>1)</sup></p>
<p> </p>
<p>Ex) Make a subroutine to find a motif 'GAATTC' which is a recognition site of restriction enzyme EcoRI</p>
<p> </p>
<p>sub motif_search {</p>
<p> use strict;</p>
<p> use warnings;</p>
<p> my ($seq) = @_;</p>
<p> my $motif = 'GAATTC';</p>
<p> print "Motif Search Results\n";</p>
<p> if ( $seq =~ /$motif/ ) {</p>
<p> print "$motif found!\n";</p>
<p> } else {</p>
<p> print $motif not found!\n";</p>
<p> }</p>
<p>}</p>
<p> </p>
<p>We can use the subroutine in main program by adding this line</p>
<p>motif_search($seq);</p>
<h3>Reference</h3>
<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>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 (you can refer to basic perl grammar)</p>
<p>2. my : an operator to make a new variable in a local space</p>
<p>3. @_; : Within a subroutine the array <code>@_</code> contains the parameters passed to that subroutine <sup>1)</sup></p>
<p> </p>
<p>Ex) Make a subroutine to find a motif 'GAATTC' which is a recognition site of restriction enzyme EcoRI</p>
<p> </p>
<p>sub motif_search {</p>
<p> use strict;</p>
<p> use warnings;</p>
<p> my ($seq) = @_;</p>
<p> my $motif = 'GAATTC';</p>
<p> print "Motif Search Results\n";</p>
<p> if ( $seq =~ /$motif/ ) {</p>
<p> print "$motif found!\n";</p>
<p> } else {</p>
<p> print $motif not found!\n";</p>
<p> }</p>
<p>}</p>
<p> </p>
<p>We can use the subroutine in main program by adding this line</p>
<p>motif_search($seq);</p>
<h3>Reference</h3>
<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>