App-Fasops
view release on metacpan or search on metacpan
lib/App/Fasops/Common.pm view on Meta::CPAN
# T G----C
# Q G----C
# O GAAAAC
sub trim_outgroup {
my $seq_refs = shift;
my $seq_count = scalar @{$seq_refs};
Carp::confess "Need three or more sequences\n" if $seq_count < 3;
# Don't expand indel set here. Last seq is outgroup
my @indel_intspans;
for my $i ( 0 .. $seq_count - 2 ) {
my $indel_intspan = indel_intspan( $seq_refs->[$i] );
push @indel_intspans, $indel_intspan;
}
# find trim_region
my $union_set = AlignDB::IntSpan::union(@indel_intspans);
my $intersect_set = AlignDB::IntSpan::intersect(@indel_intspans);
lib/App/Fasops/Common.pm view on Meta::CPAN
# Q G--C
# O GGAC
sub trim_complex_indel {
my $seq_refs = shift;
my $seq_count = scalar @{$seq_refs};
my @ingroup_idx = ( 0 .. $seq_count - 2 );
Carp::confess "Need three or more sequences\n" if $seq_count < 3;
# Don't expand indel set here. Last seq is outgroup
my @indel_intspans;
for my $i (@ingroup_idx) {
my $indel_intspan = indel_intspan( $seq_refs->[$i] );
push @indel_intspans, $indel_intspan;
}
my $outgroup_indel_intspan = indel_intspan( $seq_refs->[ $seq_count - 1 ] );
# find trim_region
my $union_set = AlignDB::IntSpan::union(@indel_intspans);
my $intersect_set = AlignDB::IntSpan::intersect(@indel_intspans);
( run in 0.415 second using v1.01-cache-2.11-cpan-97f6503c9c8 )