X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Flist_genomes;h=accaffe9ca1e4953d8e3e57caa17a54225aa172f;hb=5de6112b70b59420b245ce636a8b2e3c90acbe00;hp=2ad4d09f75e7372493bfb3462c667b4bba8eb4f7;hpb=f7e5c1b54c562cc1b25fe419cacd4da9ac01f129;p=biopieces.git diff --git a/bp_bin/list_genomes b/bp_bin/list_genomes deleted file mode 120000 index 2ad4d09..0000000 --- a/bp_bin/list_genomes +++ /dev/null @@ -1 +0,0 @@ -../code_perl/Maasha/bin/list_genomes \ No newline at end of file diff --git a/bp_bin/list_genomes b/bp_bin/list_genomes new file mode 100755 index 0000000..accaffe --- /dev/null +++ b/bp_bin/list_genomes @@ -0,0 +1,103 @@ +#!/usr/bin/env perl + +# Copyright (C) 2007-2009 Martin A. Hansen. + +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# http://www.gnu.org/copyleft/gpl.html + + +# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DESCRIPTION <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + +# Display available genomes. + +# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + +use warnings; +use strict; +use Term::ANSIColor; +use Maasha::Common; +use Maasha::Biopieces; + + +# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + +my ( $options, @genomes, $genome, @formats, $format, %hash, %found, @row ); + +$options = Maasha::Biopieces::parse_options(); + +@genomes = Maasha::Filesys::ls_dirs( "$ENV{ 'BP_DATA' }/genomes" ); + +foreach $genome ( @genomes ) +{ + next if $genome =~ /\.$/; + + @formats = Maasha::Filesys::ls_dirs( $genome ); + + foreach $format ( @formats ) + { + if ( $format =~ /\/([^\/]+)\/(\w+)$/ ) + { + $hash{ $1 }{ $2 } = 1; + + $found{ $2 } = 1; + } + } +} + +@row = "Genome"; + +map { push @row, $_ } sort keys %found; + +print join( "\t", @row ), "\n"; + +foreach $genome ( sort keys %hash ) +{ + @row = $genome; + + foreach $format ( sort keys %found ) + { + if ( exists $hash{ $genome }{ $format } ) { + push @row, colored( "yes", "green" ); + } else { + push @row, colored( "no", "red" ); + } + } + + print join( "\t", @row ), "\n"; +} + + +# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + +BEGIN +{ + Maasha::Biopieces::status_set(); +} + + +END +{ + Maasha::Biopieces::status_log(); +} + + +# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + +__END__