]> git.donarmstrong.com Git - biopieces.git/blob - bp_bin/list_genomes
fixed seq qual length check
[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 Term::ANSIColor;
32 use Maasha::Common;
33 use Maasha::Biopieces;
34
35
36 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
37
38
39 my ( $options, @genomes, $genome, @formats, $format, %hash, %found, @row );
40
41 $options = Maasha::Biopieces::parse_options();
42
43 @genomes = Maasha::Filesys::ls_dirs( "$ENV{ 'BP_DATA' }/genomes" );
44
45 foreach $genome ( @genomes )
46 {
47     next if $genome =~ /\.$/;
48
49     @formats = Maasha::Filesys::ls_dirs( $genome );
50
51     foreach $format ( @formats )
52     {
53         if ( $format =~ /\/([^\/]+)\/(\w+)$/ )
54         {
55             $hash{ $1 }{ $2 } = 1;
56
57             $found{ $2 } = 1;
58         }
59     }
60 }
61
62 @row = "Genome";
63
64 map { push @row, $_ } sort keys %found;
65
66 print join( "\t", @row ), "\n";
67
68 foreach $genome ( sort keys %hash )
69 {
70     @row = $genome;
71
72     foreach $format ( sort keys %found )
73     {
74         if ( exists $hash{ $genome }{ $format } ) {
75             push @row, colored( "yes", "green" );
76         } else {
77             push @row, colored( "no", "red" );
78         }
79     }
80
81     print join( "\t", @row ), "\n";
82 }
83
84
85 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
86
87
88 BEGIN
89 {
90     Maasha::Biopieces::status_set();
91 }
92
93
94 END
95 {
96     Maasha::Biopieces::status_log();
97 }
98
99
100 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
101
102
103 __END__