Bio-NEXUS

 view release on metacpan or  search on metacpan

doc/Tutorial.pod  view on Meta::CPAN

=item *

C<system$> is the command prompt for the shell running in your terminal window. 

=item *

C<Fixed width> is used for Perl codes and outputs produced in the shell. C<Fixed width> is also used for the shell commands 
shown after the command prompt C<system$>.

=item *

I<Italic> is used for shell commands, when shell commands are NOT shown after the command prompt.

=back

=head2 Getting started with your UN*X shell, Perl, and Bio::NEXUS

Before getting started with Bio::NEXUS methods, begin by opening a terminal window and checking a few things using your shell (i.e., UNIX or UNIX-work-alike shell, or Windoze shell). 

=over 

=item *

Check for Perl.  If it isn't installed, have your system administrator install it.

 system$ perl -e 'print "hello!\n" '
 hello!

=item *

Check for Bio::NEXUS.  If it isn't installed, read the Bio::NEXUS installation document. 

 system$ perl -MBio::NEXUS -e 'print "hello!\n" '
 hello!

=item *

Check that nextool.pl and nexplot.pl are in your $PATH (if not, read the installation docs). 

 system$ nextool.pl -h
 (this should result in a page of command-line options)

 system$ nexplot.pl -h
 (this should result in a page of command-line options)

=item *

Execute commands saved in a file

 system$ echo ' print "hello!\n"; ' > my_commands.pl
 system$ perl my_commands.pl 
 hello!

=item *

Make an executable script (note where the semi-colon and >> symbol are used)

 system$ echo '#!/usr/bin/env perl' > my_script.pl
 system$ echo 'print "hello!\n"; ' >> my_script.pl
 system$ echo 'exit;' >> my_script.pl
 system$ chmod +x my_script.pl
 system$ cat my_script.pl

 #!/usr/bin/env perl
 print "hello!\n";
 exit;

 system$ ./my_script.pl
 hello!

=back

=head2 Basic manipulations with trees, OTU sets, and characters

=head3 Creating the example1.nex NEXUS file used in several exercises

=over 

=item I<Rationale> 

For the first few exercises, we will use a sample NEXUS file with a taxa block, a characters block and a trees block. For this reason, please create a file named "example1.nex" from the following text:   

=item example1.nex

 #NEXUS
 BEGIN TAXA;
       DIMENSIONS ntax=4;
       TAXLABELS  A B C D;
 END;
 BEGIN CHARACTERS;
       DIMENSIONS ntax=4 nchar=25;
       FORMAT DATATYPE=protein;
 MATRIX
   A     IKKGANLFKTRCAQCHTVEKDGGNI
   B     LKKGEKLFTTRCAQCHTLKEGEGNL
   C     STKGAKLFETRCKQCHTVENGGGHV
   D     LTKGAKLFTTRCAQCHTLEGDGGNI
 ;
 END;
 BEGIN TREES;
       TREE my_tree = (((A:1,B:1):1,D:0.5):1,C:2)root;
 END;

Use the "cat" command to check the file (this should reproduce the text given above): 

 system$ cat example1.nex

=item I<Discussion>

NEXUS files can have many different types of blocks.  Each block has commands, e.g., the TAXA block has two possible commands, dimensions and taxlabels.  Some further blocks and commands will be introduced in the examples below.  A complete presentat...

=back

=head3 Renaming some or all OTU names

=over

=item I<Rationale>

We often have the need to rename OTUs systematically for purposes of compatibility. 



( run in 1.826 second using v1.01-cache-2.11-cpan-39bf76dae61 )