~ubuntu-branches/ubuntu/saucy/bioperl/saucy-proposed

« back to all changes in this revision

Viewing changes to Bio/AlignIO.pm

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: AlignIO.pm,v 1.46.4.4 2006/10/02 23:10:11 sendu Exp $
 
1
# $Id: AlignIO.pm 14710 2008-06-10 00:42:00Z heikki $
2
2
#
3
3
# BioPerl module for Bio::AlignIO
4
4
#
97
97
multiple alignments is not. The only current exception is format
98
98
C<bl2seq> which parses results of the BLAST C<bl2seq> program and which
99
99
may produce several alignment pairs.  This set of alignment pairs can
100
 
be read using multiple calls to L<next_aln()>.
 
100
be read using multiple calls to L<next_aln>.
101
101
 
102
102
=head1 CONSTRUCTORS
103
103
 
108
108
   $seqIO = Bio::AlignIO->new(-format => $format);
109
109
   $seqIO = Bio::AlignIO->new(-fh => \*STDOUT, -format => $format);
110
110
 
111
 
The L<new()> class method constructs a new L<Bio::AlignIO> object.  
 
111
The L<new> class method constructs a new L<Bio::AlignIO> object.  
112
112
The returned object can be used to retrieve or print alignment
113
 
objects. L<new()> accepts the following parameters:
 
113
objects. L<new> accepts the following parameters:
114
114
 
115
115
=over 4
116
116
 
180
180
   # read from STDIN or use @ARGV:
181
181
   $fh = Bio::AlignIO->newFh(-format => $format);
182
182
 
183
 
This constructor behaves like L<new()>, but returns a tied filehandle
 
183
This constructor behaves like L<new>, but returns a tied filehandle
184
184
rather than a L<Bio::AlignIO> object.  You can read sequences from this
185
185
object using the familiar E<lt>E<gt> operator, and write to it using
186
 
L<print()>. The usual array and $_ semantics work.  For example, you can
 
186
L<print>. The usual array and $_ semantics work.  For example, you can
187
187
read all sequence objects into an array like this:
188
188
 
189
189
  @sequences = <$fh>;
452
452
sub _guess_format {
453
453
my $class = shift;
454
454
   return unless $_ = shift;
455
 
   return 'clustalw' if /\.aln$/i;
456
 
   return 'emboss'   if /\.(water|needle)$/i;
457
 
   return 'metafasta'if /\.metafasta$/;
458
 
   return 'fasta'    if /\.(fasta|fast|seq|fa|fsa|nt|aa)$/i;
459
 
   return 'maf'      if /\.maf/i;
460
 
   return 'mega'     if /\.(meg|mega)$/i;
461
 
   return 'meme'     if /\.meme$/i;
462
 
   return 'msf'      if /\.(msf|pileup|gcg)$/i;
463
 
   return 'nexus'    if /\.(nexus|nex)$/i;
464
 
   return 'pfam'     if /\.(pfam|pfm)$/i;
465
 
   return 'phylip'   if /\.(phylip|phlp|phyl|phy|ph)$/i;
466
 
   return 'psi'      if /\.psi$/i;
467
 
   return 'selex'    if /\.(selex|slx|selx|slex|sx)$/i;
 
455
   return 'clustalw'    if /\.aln$/i;
 
456
   return 'emboss'      if /\.(water|needle)$/i;
 
457
   return 'metafasta'   if /\.metafasta$/;
 
458
   return 'fasta'       if /\.(fasta|fast|seq|fa|fsa|nt|aa)$/i;
 
459
   return 'maf'         if /\.maf/i;
 
460
   return 'mega'        if /\.(meg|mega)$/i;
 
461
   return 'meme'        if /\.meme$/i;
 
462
   return 'msf'         if /\.(msf|pileup|gcg)$/i;
 
463
   return 'nexus'       if /\.(nexus|nex)$/i;
 
464
   return 'pfam'        if /\.(pfam|pfm)$/i;
 
465
   return 'phylip'      if /\.(phylip|phlp|phyl|phy|ph)$/i;
 
466
   return 'psi'         if /\.psi$/i;
 
467
   return 'stockholm'   if /\.stk$/i;
 
468
   return 'selex'       if /\.(selex|slx|selx|slex|sx)$/i;
 
469
   return 'xmfa'        if /\.xmfa$/i;
468
470
}
469
471
 
470
472
sub DESTROY {