Bio-MUST-Apps-FortyTwo

 view release on metacpan or  search on metacpan

bin/debrief-42.pl  view on Meta::CPAN

#!/usr/bin/env perl
# PODNAME: debrief-42.pl
# ABSTRACT: Summarize the results of a 42 metagenomic run
# CONTRIBUTOR: Mick VAN VLIERBERGHE <mvanvlierberghe@doct.ulg.ac.be>

use autodie;
use Modern::Perl '2011';

use Getopt::Euclid qw(:vars);

use File::Basename;
use File::Find::Rule;
use List::AllUtils qw(uniq);
use Path::Class qw(dir file);
use Tie::IxHash;

use Bio::MUST::Core;
use aliased 'Bio::MUST::Core::SeqId';
use aliased 'Bio::MUST::Core::IdList';
use aliased 'Bio::MUST::Core::Taxonomy';
use aliased 'Bio::MUST::Apps::Debrief42::TaxReport';


## no critic (RequireLocalizedPunctuationVars)
BEGIN{
    $ENV{Smart_Comments} = $ARGV_verbosity
        ? join q{ }, map { '#' x (2 + $_) } 1..$ARGV_verbosity
        : q{}
    ;
}
use Smart::Comments -ENV;


die <<'EOT' if !$ARGV_taxdir && ($ARGV_seq_labeling || $ARGV_contam_labeling);
Missing required arguments:
    --taxdir=<dir>
EOT

# optionally build taxonomy object
my $tax;
if ($ARGV_taxdir) {
    $tax = Taxonomy->new_from_cache( tax_dir => $ARGV_taxdir );
}

# optionally build classifier objects
my ($seq_classifier, $contam_classifier);
if ($ARGV_seq_labeling) {
    my    $seq_labeling_list = IdList->load($ARGV_seq_labeling);
       $seq_classifier = $tax->tax_labeler_from_list($seq_labeling_list);
}
if ($ARGV_contam_labeling) {
    my $contam_labeling_list = IdList->load($ARGV_contam_labeling);
    $contam_classifier = $tax->tax_labeler_from_list($contam_labeling_list);
}

### Processing: $ARGV_indir
my @tax_reports = File::Find::Rule
    ->file()
    ->name( qr{ $ARGV_in_strip \.tax-report\z}xmsi )
    ->maxdepth(1)
    ->in($ARGV_indir)
;
my $ali_test = @tax_reports;
#### @tax_reports

# TODO: rewrap long lines (>80 chars)
my %data_for;



( run in 0.732 second using v1.01-cache-2.11-cpan-5b529ec07f3 )