Automatic handling of VERSION in all modules (issue #283)
[bioperl-live.git] / bin / bp_seqconvert
blobed325782851098829474b6ab2eaf2a1a2dc56111
1 #!/usr/bin/perl
3 use strict;
4 use warnings;
5 use Getopt::Long;
6 use Bio::SeqIO;
8 my $help;
9 my $from=undef;
10 my $to=undef;
12 ### please add to this list (see the modules under Bio/SeqIO):
13 my @known_formats=
14 qw(gcg fasta ace raw fastq phd pir scf swiss genbank locuslink
15 embl game qual bsml tab raw abi chado alf ctf exp ztr pln
16 chaosxml chadoxml yaml tigr tigrxml agave chaos kegg interpro
17 lasergene strider gbdriver embldriver swissdriver);
19 my $script=substr($0, 1+rindex($0,'/'));
20 my $usage="Usage:
22 $script --from in-format --to out-format < file.in-format > file.out-format
24 Known formats:\n " . join(' ', @known_formats) . "\n\n";
26 die $usage unless
27 &GetOptions( 'from:s' => \$from,
28 'to:s' => \$to,
29 'h|help' => \$help
31 && !$help && $from && $to
32 && grep($from eq $_, @known_formats)
33 && grep($to eq $_, @known_formats);
35 my $in = Bio::SeqIO->newFh(-fh => \*STDIN , '-format' => $from);
36 my $out = Bio::SeqIO->newFh(-fh=> \*STDOUT, '-format' => $to);
38 print $out $_ while <$in>;
41 __END__
43 =head1 NAME
45 bp_seqconvert - generic BioPerl sequence format converter
47 =head1 SYNOPSIS
49 bp_seqconvert --from in-format --to out-format < file.in-format > file.out-format
50 # or
51 bp_seqconvert -f in-format -t out-format < file.in-format > file.out-format
53 =head1 DESCRIPTION
55 This script gives command line interface to BioPerl Bio::SeqIO.
57 =head1 SEE ALSO
59 L<Bio::SeqIO>
60 L<bp_sreformat.PLS> for similar functionality which also supports AlignIO.
62 =head1 FEEDBACK
64 =head2 Mailing Lists
66 User feedback is an integral part of the evolution of this and other
67 Bioperl modules. Send your comments and suggestions preferably to
68 the Bioperl mailing list. Your participation is much appreciated.
70 bioperl-l@bioperl.org - General discussion
71 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
73 =head2 Reporting Bugs
75 Report bugs to the Bioperl bug tracking system to help us keep track
76 of the bugs and their resolution. Bug reports can be submitted via the
77 web:
79 https://github.com/bioperl/bioperl-live/issues
81 =head1 AUTHOR - Philip Lijnzaad
83 Email E<lt>p.lijnzaad-at-med.uu.nlE<gt>
85 =cut
87 __END__