Bio-MUST-Core

 view release on metacpan or  search on metacpan

bin/idealize-ali.pl  view on Meta::CPAN

#!/usr/bin/env perl
# PODNAME: idealize-ali.pl
# ABSTRACT: Discard (nearly) gap-only sites from ALI files

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

use Getopt::Euclid qw(:vars);
use Smart::Comments;

use Bio::MUST::Core;
use Bio::MUST::Core::Utils qw(secure_outfile);
use aliased 'Bio::MUST::Core::Ali';
use aliased 'Bio::MUST::Core::SeqMask';


for my $infile (@ARGV_infiles) {

    ### Processing: $infile
    my $ali = Ali->load($infile);

    my $mask = SeqMask->ideal_mask($ali, $ARGV_max_res_drop_site);
    $mask = $mask->codon_mask( {
        frame => $ARGV_coding_frame,
          max => $ARGV_codon_max_nt_drop,
    } ) if $ARGV_keep_codons;
    $ali->apply_mask($mask);

    my $outfile = secure_outfile($infile, $ARGV_out_suffix);
    $ali->store($outfile);
}

__END__

=pod

=head1 NAME

idealize-ali.pl - Discard (nearly) gap-only sites from ALI files

=head1 VERSION

version 0.251810

=head1 USAGE

    idealize-ali.pl <infiles> [optional arguments]

=head1 REQUIRED ARGUMENTS

=over

=item <infiles>

Path to input ALI files [repeatable argument].

=for Euclid: infiles.type: readable
    repeatable

=back

=head1 OPTIONAL ARGUMENTS

=over



( run in 0.532 second using v1.01-cache-2.11-cpan-0d8aa00de5b )