]> git.donarmstrong.com Git - biopieces.git/blob - bp_bin/list_genomes
added use strict to all biopieces
[biopieces.git] / bp_bin / list_genomes
1 #!/usr/bin/env perl
2
3 # Copyright (C) 2007-2009 Martin A. Hansen.
4
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
19 # http://www.gnu.org/copyleft/gpl.html
20
21
22 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DESCRIPTION <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
23
24 # Display available genomes.
25
26 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
27
28
29 use warnings;
30 use strict;
31 use Maasha::Common;
32 use Maasha::Biopieces;
33
34
35 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
36
37
38 my ( $options, @genomes, $genome, @formats, $format, %hash, %found, @row );
39
40 $options = Maasha::Biopieces::parse_options();
41
42 @genomes = Maasha::Filesys::ls_dirs( "$ENV{ 'BP_DATA' }/genomes" );
43
44 foreach $genome ( @genomes )
45 {
46     next if $genome =~ /\.$/;
47
48     @formats = Maasha::Filesys::ls_dirs( $genome );
49
50     foreach $format ( @formats )
51     {
52         if ( $format =~ /\/([^\/]+)\/(\w+)$/ )
53         {
54             $hash{ $1 }{ $2 } = 1;
55
56             $found{ $2 } = 1;
57         }
58     }
59 }
60
61 @row = "Genome";
62
63 map { push @row, $_ } sort keys %found;
64
65 print join( "\t", @row ), "\n";
66
67 foreach $genome ( sort keys %hash )
68 {
69     @row = $genome;
70
71     foreach $format ( sort keys %found )
72     {
73         if ( exists $hash{ $genome }{ $format } ) {
74             push @row, "yes";
75         } else {
76             push @row, "no";
77         }
78     }
79
80     print join( "\t", @row ), "\n";
81 }
82
83
84 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
85
86
87 BEGIN
88 {
89     Maasha::Biopieces::status_set();
90 }
91
92
93 END
94 {
95     Maasha::Biopieces::status_log();
96 }
97
98
99 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
100
101
102 __END__