Difference between revisions of "Strawberry Perl"

From Biolecture.org
imported>Doyeon Kwak
(Created page with "<p>Q1. What is Strawberry Perl?</p> <p>A1. A kind of the Perl programming language for the Microsoft Windows platform. (Usually, Perl including BioPerl ...")
 
imported>Doyeon Kwak
 
Line 1: Line 1:
 +
<p>(Although Q&amp;As are poor, Homework 1 process&nbsp;is included in this document.)</p>
 +
 +
<p>&nbsp;</p>
 +
 
<p>Q1.&nbsp;What is Strawberry Perl?</p>
 
<p>Q1.&nbsp;What is Strawberry Perl?</p>
  
Line 16: Line 20:
  
 
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bad - Strawberry Perl is more like Unix program, as its principle is&nbsp;also based on Unix. Although it is efficient to implement Perl tasks(somewhat like text processing),&nbsp;Strawberry&nbsp;Perl shows low&nbsp;compatibility since it&nbsp;is&nbsp;hard to&nbsp;support Windows GUI framework,&nbsp;or enable&nbsp;direct Win32 API access, while other&nbsp;Perl working program&nbsp;does very well.</p>
 
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bad - Strawberry Perl is more like Unix program, as its principle is&nbsp;also based on Unix. Although it is efficient to implement Perl tasks(somewhat like text processing),&nbsp;Strawberry&nbsp;Perl shows low&nbsp;compatibility since it&nbsp;is&nbsp;hard to&nbsp;support Windows GUI framework,&nbsp;or enable&nbsp;direct Win32 API access, while other&nbsp;Perl working program&nbsp;does very well.</p>
 +
 +
<p>&nbsp;</p>
 +
 +
<p>Q. Write&nbsp;a&nbsp;simple&nbsp;program&nbsp;to&nbsp;open&nbsp;and&nbsp;write&nbsp;a&nbsp;FASTA&nbsp;file&nbsp;with&nbsp;the&nbsp;content below:<br />
 +
<br />
 +
&gt;Your_first_seq<br />
 +
ATATATATATATATATAATATATATATATATATAATATATATATATATATAATATATATATATATATA<br />
 +
ATATATATATATATATAATATATATATATATATAATATATATATATATATAATATATATATATATATA<br />
 +
ATATATATATATATATAATATATATATATATATAATATATATATATATATAATATATATATATATATA<br />
 +
ATATATATATATATATAATATATATATATATATAATATATATATATATATAATATATATATATATATA</p>
 +
 +
<p>&nbsp;</p>
 +
 +
<p>A1. Write a Perl code.</p>
 +
 +
<p>#!/usr/bin/perl<br />
 +
use strict;<br />
 +
use Bio::SeqIO;<br />
 +
my $reader=new Bio::SeqIO(-format=&gt;&#39;fasta&#39;,-file=&gt;shift);<br />
 +
while (my $seqRec=$reader-&gt;next_seq)<br />
 +
{<br />
 +
&nbsp;&nbsp;&nbsp; print join(&quot;\t&quot;,$seqRec-&gt;id,$seqRec-&gt;length),&quot;\n&quot;;<br />
 +
}</p>
 +
 +
<p>A2. When running in console...</p>
 +
 +
<p><img alt="" src="/ckfinder/userfiles/images/bandicam%202015-12-09%2021-56-33-538.png" style="height:92px; width:637px" /></p>
 +
 +
<p>Then we need to get Bio::SeqIO module.</p>
 +
 +
<p>&nbsp;</p>
 +
 +
<p>A3. Go to <a href="http://www.bioperl.org/wiki/Module:Bio::SeqIO">http://www.bioperl.org/wiki/Module:Bio::SeqIO</a>&nbsp;to get Bio::SeqIO module</p>
 +
 +
<p><img alt="" src="/ckfinder/userfiles/images/bandicam%202015-12-09%2021-58-54-516.png" style="height:103px; width:264px" /></p>
 +
 +
<p>A4. Download Bio::SeqIO, and find Bio/SeqIO.pm. As error ment says Bio/SeqIO.pm should be in @INC (C:/Strawberry/perl/site/lib, C:/Strawberry/perl/vendor/lib, C:/Strawberry/perl/lib),</p>
 +
 +
<p>&nbsp;Copy and paste Bio folder to the @INC. Even in BioPerl wiki doesn&#39;t teach me where I need to install the module, I added this explanation.</p>
 +
 +
<p><img alt="" src="/ckfinder/userfiles/images/bandicam%202015-12-09%2022-02-39-345.png" style="height:67px; width:417px" /></p>
 +
 +
<p>&nbsp;</p>
 +
 +
<p>A5. Running in the module again, but...</p>
 +
 +
<p><img alt="" src="/ckfinder/userfiles/images/bandicam%202015-12-09%2022-06-36-305.png" style="height:84px; width:539px" /></p>
 +
 +
<p>&nbsp;</p>
 +
 +
<p>A6. Need to revise the code again.</p>
 +
 +
<p>Maybe proper input requiring statement would be needed. (Still ongoing)</p>

Latest revision as of 22:32, 9 December 2015

(Although Q&As are poor, Homework 1 process is included in this document.)

 

Q1. What is Strawberry Perl?

A1. A kind of the Perl programming language for the Microsoft Windows platform. (Usually, Perl including BioPerl is for Linux, Mac OSX, Ubuntu, and so on) While most other kinds of Perl which are distributed to other people require some rsoftware development tools already set up to install certain Perl components, Strawberry Perl ships with packaging of the most commonly used tools which are already configured. This is an unique feature of Strawberry Perl from other Perl distributions, and has influenced other distributions to give other tools with their own Perl system. (i.g. ActivePerl) Strawberry Perl is designed to be as close as possible to perl environment on UNIX systems.

Q2. Where can I get Strawberry Perl?

A2. http://strawberryperl.com/

Q3. What other tools Strawberry Perl contains?

A3. According to developer, Adam Kennedy and etc., Strawberry Perl includes Perl binaries, compiler(GCC) and its related tools, as well as all the external libraries(crypto, math, graphics, xml, ...).

Q4. Good/Bad things of Strawberry Perl?

A4. Good - Strawberry Perl could apply kinds of modules and add them into CPAN. Also, it can be relatively easy to find new or uncommon modules in the PPMs repositories, comparing with ActivePerl. Easier devices, PPM, are prepackaged on Strawberry Perl already.

     Bad - Strawberry Perl is more like Unix program, as its principle is also based on Unix. Although it is efficient to implement Perl tasks(somewhat like text processing), Strawberry Perl shows low compatibility since it is hard to support Windows GUI framework, or enable direct Win32 API access, while other Perl working program does very well.

 

Q. Write a simple program to open and write a FASTA file with the content below:

>Your_first_seq
ATATATATATATATATAATATATATATATATATAATATATATATATATATAATATATATATATATATA
ATATATATATATATATAATATATATATATATATAATATATATATATATATAATATATATATATATATA
ATATATATATATATATAATATATATATATATATAATATATATATATATATAATATATATATATATATA
ATATATATATATATATAATATATATATATATATAATATATATATATATATAATATATATATATATATA

 

A1. Write a Perl code.

#!/usr/bin/perl
use strict;
use Bio::SeqIO;
my $reader=new Bio::SeqIO(-format=>'fasta',-file=>shift);
while (my $seqRec=$reader->next_seq)
{
    print join("\t",$seqRec->id,$seqRec->length),"\n";
}

A2. When running in console...

Then we need to get Bio::SeqIO module.

 

A3. Go to http://www.bioperl.org/wiki/Module:Bio::SeqIO to get Bio::SeqIO module

A4. Download Bio::SeqIO, and find Bio/SeqIO.pm. As error ment says Bio/SeqIO.pm should be in @INC (C:/Strawberry/perl/site/lib, C:/Strawberry/perl/vendor/lib, C:/Strawberry/perl/lib),

 Copy and paste Bio folder to the @INC. Even in BioPerl wiki doesn't teach me where I need to install the module, I added this explanation.

 

A5. Running in the module again, but...

 

A6. Need to revise the code again.

Maybe proper input requiring statement would be needed. (Still ongoing)