1 / 5

Introduction to Perl

Introduction to Perl. The Perl programming language is: A scripting language Uses C-style formatting Very good at manipulating strings Object-oriented As of Perl 5 Open source Available from www.perl.org Available for most platforms Great portability. Perl Formatting.

marlin
Download Presentation

Introduction to Perl

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Perl • The Perl programming language is: • A scripting language • Uses C-style formatting • Very good at manipulating strings • Object-oriented • As of Perl 5 • Open source • Available from www.perl.org • Available for most platforms • Great portability

  2. Perl Formatting • Perl uses C-like formatting • Lines end in semicolons (‘;’) • White space is ignored • Variables start with a symbol • Dollar sign ($) for scalars • At symbol (@) for arrays • Percent sign (%) for hash arrays • Variables have no type • Control blocks (e.g. while, if, for) require curly brackets (‘{‘ and ‘}’) • Use the pound sign (‘#’) instead of slashes to comment a line • Multi-line comments are not supported • # This is a comment. We will show comments in red

  3. Calling Subroutines • Subroutines (functions) from a different class or library are called using ‘->’ • E.g. classA->subroutine1() • Objects are instantiated using the new subroutine • E.g. $instance=ClassA->new()

  4. Subroutines in BioPerl • BioPerl uses named parameters • Parameters are actually passed as a hash array • Each entry in the form • key=>value • Value is a string or number • Order or parameters doesn’t matter • E.g. Bio::Seq->new(-seq=>’ACTG’, -primary_id=>’1’); is the same as Bio::Seq->new(-primary_id=>’1’, -seq=>’ACTG’);

  5. Useful BioPerl Classes • Bio::Seq • The main class used for handling sequence data • Bio::SeqIO • Sequential input and output to various sequence file types • Bio::DB::Genbank • Allows retrieval of sequences from GenBank • Bio::Tools::RemoteBlast • Make a BLAST query against GenBank databases via the Internet • Bio::SeqFeatureI • An interface that allows for features to be associated with sequences • Bio::Tools::SeqStats • Retrieves various statistics (e.g molecular weight) for a given sequence • Bio::SimpleAlign • Manipulate alignment data

More Related