Bio-DB-HTS
view release on metacpan or search on metacpan
lib/Bio/DB/HTS.pm view on Meta::CPAN
sub tam_fh {
my $self = shift;
return $self->features( -fh => 1 );
}
sub max_pileup_cnt {
my $self = shift;
return Bio::DB::HTSfile->max_pileup_cnt(@_);
}
# return a fragment of code that will be placed in the eval "" filter
# to eliminate alignments that don't match by name
sub _filter_by_name {
my $self = shift;
my $name = shift;
my $frag = "my \$name=\$a->qname; defined \$name or return; ";
if ( my $regexp = $self->_glob_match($name) ) {
$frag .= "return unless \$name =~ /^$regexp\$/i;\n";
}
else {
$frag .= "return unless lc \$name eq '$name';\n";
}
}
# return a fragment of code that will be placed in the eval "" filter
# to eliminate alignments that don't match by attribute
sub _filter_by_attribute {
my $self = shift;
my $attributes = shift;
my $result;
for my $tag ( keys %$attributes ) {
$result .= "my \$value = lc \$a->get_tag_values('$tag');\n";
$result .= "return unless defined \$value;\n";
my @comps =
ref $attributes->{$tag} eq 'ARRAY' ? @{ $attributes->{$tag} } :
( run in 1.637 second using v1.01-cache-2.11-cpan-364913b4093 )