script/bed62bed12.pl untested

filter: Statementstmt 0.0% 0 / 32 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod n/a totaltotal 0.0% 0 / 42 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/env perl
2 # -*-CPerl-*-
3 # Last changed Time-stamp: <2017-06-08 18:07:36 michl>
4 #
5 # Converts bed6 to bed12
6 #
7 # usage: bed62bed12.pl -i <STRING>
8 #
9 # ***********************************************************************
10 # * Copyright notice
11 # *
12 # * Copyright 2017 Michael T. Wolfinger <michael@wolfinger.eu>
13 # * All rights reserved
14 # *
15 # * This program is free software: you can redistribute it and/or modify
16 # * it under the terms of the GNU General Public License as published by
17 # * the Free Software Foundation, either version 3 of the License, or
18 # * (at your option) any later version.
19 # *
20 # * This program is distributed in the hope that it will be useful,
21 # * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # * GNU General Public License for more details.
24 # *
25 # * You should have received a copy of the GNU General Public License
26 # * along with this program. If not, see <http://www.gnu.org/licenses/>.
27 # *
28 # * This copyright notice MUST APPEAR in all copies of the script!
29 # ***********************************************************************
30 #
31  
32 use strict;
33 use warnings;
34 use Getopt::Long qw( :config posix_default bundling no_ignore_case );
35 use Data::Dumper;
36 use Pod::Usage;
37 use Bio::ViennaNGS::FeatureIO;
38  
39 #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#
40 #^^^^^^^^^^ Variables ^^^^^^^^^^^#
41 #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#
42  
43 my ($fio);
44 my $infile = undef;
45 my $name = "foobar";
46  
47  
48 #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#
49 #^^^^^^^^^^^^^^ Main ^^^^^^^^^^^^^#
50 #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#
51  
52 Getopt::Long::config('no_ignore_case');
53 pod2usage(-verbose => 1) unless GetOptions("input|i=s" => \$infile,
54 "man" => sub{pod2usage(-verbose => 2)},
55 "help|h" => sub{pod2usage(1)}
56 );
57  
58 unless (-f $infile){
59 warn "Could not find input file provided via --input|-i option";
60 pod2usage(-verbose => 0);
61 }
62  
63 #unless (defined $pattern) {
64 # warn "No search pattern/substring provided";
65 # pod2usage(-verbose => 0);
66 #}
67  
68 $fio = Bio::ViennaNGS::FeatureIO->new(
69 file => $infile,
70 filetype => 'Bed6',
71 instanceOf => 'FeatureChain',
72 );
73  
74 #print Dumper($fio);
75 foreach my $d (@{$fio->data}){
76 # print " >> processing a ".ref($d)." object\n";
77 print $d->as_bed12_line(undef,undef,undef) ."\n";
78 }
79  
80  
81 __END__