Bio-MUST-Apps-HmmCleaner

 view release on metacpan or  search on metacpan

lib/Bio/MUST/Apps/HmmCleaner.pm  view on Meta::CPAN

        }

        ##### Number of removed positions : $erased

        say $self->ali->file."\t".$seq->full_id."\t".$erased;
    }

    return;
}

# get log for simulation from non gap seq
sub get_log_simu {
    my $self = shift;

    my %log;
    for my $cleaner ($self->all_cleaners) {
        my $seq = $cleaner->seq;

        my $shifts = $cleaner->nogap_shifts;
        for(my $i = 0; $i < $#$shifts; $i+=2){

            push @{$log{$self->ali->file}->{$seq->full_id}}, [(1+$$shifts[$i] ), ( $$shifts[$i+1] )];
        }

    }

    return \%log;
}

# get log for simulation from gap seq
sub get_log_simualign {
    my $self = shift;

    my %log;
    for my $cleaner ($self->all_cleaners) {
        my $seq = $cleaner->seq;

        my $shifts_withgaps = $cleaner->shifts;
        for(my $i = 0; $i < $#$shifts_withgaps; $i+=2){

            push @{$log{$self->ali->file}->{$seq->full_id}}, [(1+$$shifts_withgaps[$i] ), ( $$shifts_withgaps[$i+1] )];
        }

    }

    return \%log;
}

sub get_matrix_seqmask {
    my $self = shift;

    my %matrix;
    for my $cleaner ($self->all_cleaners) {
        my $seqid = $cleaner->seq->full_id;
        $matrix{$seqid} = $cleaner->get_seqmask;
    }

    return \%matrix;
}

sub update_cleaners {
    my $self = shift;
    my $threshold = shift;
    $self->_set_threshold($threshold);
    my $costs = shift // $self->_get_default_cost;

    for my $cleaner ($self->all_cleaners) {
        $cleaner->update($threshold,$costs);
    }

    return;
}

sub store_all {
    my $self = shift;

    $self->store_results;
    $self->store_score;
    $self->store_log;

    return;
}

__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

Bio::MUST::Apps::HmmCleaner - Main class for HmmCleaner

=head1 VERSION

version 0.243280

=head1 AUTHOR

Arnaud Di Franco <arnaud.difranco@gmail.fr>

=head1 CONTRIBUTOR

=for stopwords Denis BAURAIN

Denis BAURAIN <denis.baurain@uliege.be>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by Arnaud Di Franco.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut



( run in 1.400 second using v1.01-cache-2.11-cpan-9581c071862 )