Skip to content
Snippets Groups Projects

Non-extended summary retrieval for BigWigs.

Merged Marek Szuba requested to merge github/fork/ens-ds23/master into master
1 file
+ 23
1
Compare changes
  • Side-by-side
  • Inline
@@ -77,7 +77,7 @@ sub munge_chr_id {
return $ret_id;
}
sub fetch_extended_summary_array {
sub fetch_summary_array {
my ($self, $chr_id, $start, $end, $bins, $has_chrs) = @_;
my $bw = $self->bigwig_open;
@@ -88,6 +88,28 @@ sub fetch_extended_summary_array {
my $seq_id = $has_chrs ? $self->munge_chr_id($chr_id) : $chr_id;
return [] if !defined($seq_id);
# Remember this method takes half-open coords (subtract 1 from start)
my $summary = $bw->bigWigSummaryArray("$seq_id",$start-1,$end,0,$bins);
if ($DEBUG) {
warn " *** fetch extended summary: $chr_id:$start-$end : found ", scalar(@$summary), " summary points\n";
}
return $summary;
}
sub fetch_extended_summary_array {
my ($self, $chr_id, $start, $end, $bins, $has_chrs) = @_;
my $bw = $self->bigwig_open;
warn "Failed to open BigWig file" . $self->url unless $bw;
return [] unless $bw;
# Maybe need to add 'chr' (only try if species has chromosomes)
my $seq_id = $has_chrs ? $self->munge_chr_id($chr_id) : $chr_id;
return [] if !defined($seq_id);
# Remember this method takes half-open coords (subtract 1 from start)
my $summary_e = $bw->bigWigSummaryArrayExtended("$seq_id",$start-1,$end,$bins);