File Coverage

bin/bioseq
Criterion Covered Total %
statement 41 42 97.6
branch 7 12 58.3
condition 5 6 83.3
subroutine 10 10 100.0
pod n/a
total 63 70 90.0


line stmt bran cond sub pod time code
1             #!/usr/bin/env perl
2              
3 19     19   97673 use strict;
  19         39  
  19         826  
4 19     19   88 use warnings;
  19         32  
  19         999  
5 19     19   225 use v5.10;
  19         79  
6              
7 19     19   10863 use Pod::Usage;
  19         1408600  
  19         2860  
8 19     19   14095 use Getopt::Long qw( :config bundling permute no_getopt_compat );
  19         282369  
  19         1778  
9 19     19   25703 use Path::Tiny;
  19         289506  
  19         2122  
10 19     19   11357 use lib path($0)->absolute->parent->sibling('lib')->stringify;
  19         14392  
  19         107  
11              
12 19     19   20566 use Bio::BPWrapper::SeqManipulations;
  19         90  
  19         12263  
13              
14             ####################### Option parsing ######################
15 19         1502030 my %opts;
16 19 50       226 GetOptions(
17             \%opts,
18             "help|h",
19             "man",
20             "version|V",
21             "anonymize|A:10", # default 10 char (for phylip) (prefix + num_digits)
22             "break|B",
23             "codon-info=s",
24             # "codon-sim=s", # disable: requires two external modules
25             "codon-table=s",
26             "composition|c",
27             "count-codons|C",
28             "delete|d=s",
29             "feat2fas|F",
30             "hydroB|H",
31             "iep",
32             "input|i=s",
33             "lead-gaps|G",
34             "length|l",
35             "longest-orf|z",
36             "linearize|L",
37             "mol-wt",
38             "no-gaps|g",
39             "num-gaps-dna",
40             "num-gaps-aa",
41             "num-seq|n",
42             "output|o=s",
43             "pick|p=s",
44             "reloop|R=i", # recircularize a genome at "loop_at"
45             "remove-stop|X", # for PAML/codeml
46             # "restrict|x=s",
47             # "restrict-coord=s",
48             "revcom|r",
49             "sort=s",
50             "split-cdhit=s",
51             "subseq|s=s",
52             "syn-code",
53             "translate|t=i",
54             "fetch|f=s", # Retrieve sequence by accession number; broken by NCBI protocol change
55             # "longest-orf|C",
56             # "extract|e",
57             # "dotplot|D=s",
58             "rename|N=s",
59             "no-revcom|Z",
60             # "slidingwindow|S=i",
61             # "prefix=s",
62             # "split|S=i",
63             ) or pod2usage(2);
64              
65 19     19   164 use Pod::Usage;
  19         40  
  19         3548  
66 19 50       50750 pod2usage(1) if $opts{"help"};
67 19 50       82 pod2usage(-exitstatus => 0, -verbose => 2) if $opts{"man"};
68              
69 19     19   140 use constant PROGRAM => File::Basename::basename(__FILE__);
  19         36  
  19         2420174  
70 19 50       81 Bio::BPWrapper::print_version(PROGRAM) if $opts{"version"};
71              
72             ######################## Main #####################
73              
74             # This sets all internal variables, and loads Bio::Seq objects
75 19         158 initialize(\%opts);
76              
77 19         20624 for my $option (keys %opts) {
78             # Don't process these options: they are for SeqIO
79 21 100 100     229 next if $option eq 'input' || $option eq 'output' || $option eq 'no-revcom';
      66        
80              
81             # If there is a function to handle the current option, execute it
82 18 50       87 if (can_handle($option)) { handle_opt($option); exit }
  18         104  
  17         3439  
83 0         0 else { warn "Missing handler for: $option\n" }
84             }
85              
86             # Let seq-manipulations act as a converter when no other options are given.
87 1         8 write_out();
88              
89             ################# POD Documentation ##################
90              
91             __END__