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>.
102
102
=head1 CONSTRUCTORS
108
108
$seqIO = Bio::AlignIO->new(-format => $format);
109
109
$seqIO = Bio::AlignIO->new(-fh => \*STDOUT, -format => $format);
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:
180
180
# read from STDIN or use @ARGV:
181
181
$fh = Bio::AlignIO->newFh(-format => $format);
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:
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;