| 1 | #!/usr/bin/env perl | ||
| 2 | |||
| 3 | 20 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 20 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 20 | ▶ | use v5.10; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 20 | ▶ | use rlib '../lib'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 20 | ▶ | use Bio::BPWrapper::SeqManipulations; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 8 | use Getopt::Long qw( :config bundling permute no_getopt_compat ); | ||
| 9 | use Pod::Usage; | ||
| 10 | |||
| 11 | ####################### Option parsing ###################### | ||
| 12 | my %opts; | ||
| 13 | GetOptions( | ||
| 14 | \%opts, | ||
| 15 | "help|h", | ||
| 16 | "man", | ||
| 17 | "composition|c", | ||
| 18 | "delete|d=s", | ||
| 19 | "fetch|f=s", # Retrieve sequence by accession number | ||
| 20 | "nogaps|g", | ||
| 21 | "input|i=s", | ||
| 22 | "length|l", | ||
| 23 | "numseq|n", | ||
| 24 | "output|o=s", | ||
| 25 | "pick|p=s", | ||
| 26 | "revcom|r", | ||
| 27 | "subseq|s=s", | ||
| 28 | "translate|t=i", #Needs error checking | ||
| 29 | "restrict|x=s", | ||
| 30 | "anonymize|A:10", # default 10 char (for phylip) (prefix + num_digits) | ||
| 31 | "break|B", | ||
| 32 | "count-codons|C", | ||
| 33 | "feat2fas|F", | ||
| 34 | "leadgaps|G", | ||
| 35 | "hydroB|H", | ||
| 36 | "linearize|L", | ||
| 37 | "reloop|R=i", # recircularize a genome at "loop_at" | ||
| 38 | "version|V", | ||
| 39 | "removestop|X", # for PAML/codeml | ||
| 40 | "split-cdhit=s", | ||
| 41 | # "longest-orf|C", | ||
| 42 | # "extract|e", | ||
| 43 | # "dotplot|D=s", | ||
| 44 | # "rename|N=s", | ||
| 45 | # "slidingwindow|S=i", | ||
| 46 | # "prefix=s", | ||
| 47 | # "split|S=i", | ||
| 48 | ) or pod2usage(2); | ||
| 49 | |||
| 50 | use Pod::Usage; | ||
| 51 | pod2usage(1) if $opts{"help"}; | ||
| 52 | pod2usage(-exitstatus => 0, -verbose => 2) if $opts{"man"}; | ||
| 53 | |||
| 54 | use constant PROGRAM => File::Basename::basename(__FILE__); | ||
| 55 | Bio::BPWrapper::print_version(PROGRAM) if $opts{"version"}; | ||
| 56 | |||
| 57 | ######################## Main ##################### | ||
| 58 | |||
| 59 | # This sets all internal variables, and loads Bio::Seq objects | ||
| 60 | initialize(\%opts); | ||
| 61 | |||
| 62 | for my $option (keys %opts) { | ||
| 63 | # Don't process these options: they are for SeqIO | ||
| 64 | next if $option eq 'input' || $option eq 'output'; | ||
| 65 | |||
| 66 | # If there is a function to handle the current option, execute it | ||
| 67 | if (can_handle($option)) { handle_opt($option); exit } | ||
| 68 | else { warn "Missing handler for: $option\n" } | ||
| 69 | } | ||
| 70 | |||
| 71 | # Let seq-manipulations act as a converter when no other options are given. | ||
| 72 | write_out(); | ||
| 73 | |||
| 74 | ################# POD Documentation ################## | ||
| 75 | |||
| 76 | __END__ | ||