80 likes | 301 Views
Modules. A Perl module is a self-contained piece of Perl code that can be used by a Perl program or by other Perl modules. It is conceptually similar to a C link library, or a C++ class. http://www.cpan.org/. How to install Modules.
E N D
Modules • A Perl module is a self-contained piece of Perl code that can be used by a Perl program or by other Perl modules. It is conceptually similar to a C link library, or a C++ class. • http://www.cpan.org/
How to install Modules • You'll need to switch to your root user. To fire up the CPAN module, just get to your command line and run this: • perl -MCPAN -e shell • If this is the first time you've run CPAN, it's going to ask you a series of questions - in most cases the default answer is fine. Once you find yourself staring at the cpan> command prompt, installing a module is as easy as install MODULE::NAME • cpan> install HTML::Template • Let's say you're on your system command line and you just want to install a module as quickly as possible - you can run the Perl CPAN module via command line perl and get it installed in a single line: • perl -MCPAN -e 'install HTML::Template'
Bioperl Bioperl is a collection of Perl Modules that developed for bioinformatics applicatons
How to install bioperl • Determine the platform: windows vs. unix • Bioperl-I@bioperl.org to ask for help • Getting better with perl
Object-Oriented Programming Use Bio:: Perl $rev_com = revcom($sequence); Vs. $rev_com2 = $seq_obj->revcom;
Sample script use Bio::Perl; #tell perl which module(library) it should loof for #query swissport database for ROA1 $seq_object = get_sequence(‘genbank’,”ROA1_HUMAN”); write_sequences(“>roa1.fasta”,’fasta’,$seq_object); # uses the default database - nr in this case $blast_result = blast_sequence($seq); write_blast(">roa1.blast",$blast_result);