Skip to content

Commit

Permalink
move ExternalSorter perl module into Bio::JBrowse namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuels committed Jan 21, 2013
1 parent 43ea9d1 commit 7efa497
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions bin/ucsc-to-json.pl
Expand Up @@ -115,7 +115,7 @@ =head1 EXAMPLE
use JSON 2;
use GenomeDB;
use NameHandler;
use ExternalSorter;
use Bio::JBrowse::ExternalSorter;

my $trackdb = "trackDb";
my ($indir, $tracks, $arrowheadClass, $subfeatureClasses, $clientConfig, $db,
Expand Down Expand Up @@ -274,7 +274,7 @@ =head1 EXAMPLE
};

my %chromCounts;
my $sorter = ExternalSorter->new($compare, $sortMem);
my $sorter = Bio::JBrowse::ExternalSorter->new($compare, $sortMem);
for_columns("$indir/" . $trackMeta->{tableName},
sub {
$chromCounts{$_[0]->[$chromCol]} += 1;
Expand Down
6 changes: 3 additions & 3 deletions src/perl5/Bio/JBrowse/Cmd/NCFormatter.pm
Expand Up @@ -3,7 +3,7 @@ package Bio::JBrowse::Cmd::NCFormatter;
use base 'Bio::JBrowse::Cmd';

use GenomeDB;
use ExternalSorter;
use Bio::JBrowse::ExternalSorter;

sub _format {
my ( $self, %args ) = @_;
Expand All @@ -13,9 +13,9 @@ sub _format {
my $types = $self->opt('type');
@$types = split /,/, join ',', @$types;

# The ExternalSorter will get flattened [chrom, [start, end, ...]]
# The Bio::JBrowse::ExternalSorter will get flattened [chrom, [start, end, ...]]
# arrays from the feature_stream
my $sorter = ExternalSorter->new(
my $sorter = Bio::JBrowse::ExternalSorter->new(
do {
my $startIndex = $feature_stream->startIndex;
my $endIndex = $feature_stream->endIndex;
Expand Down
@@ -1,11 +1,11 @@
=head1 NAME
ExternalSorter - efficiently sort arrayrefs with a given comparison function
Bio::JBrowse::ExternalSorter - efficiently sort arrayrefs with a given comparison function
=head1 SYNOPSIS
# make a new sorter that sorts by column 4, then column 3
my $sorter = ExternalSorter->new(
my $sorter = Bio::JBrowse::ExternalSorter->new(
sub ($$) {
$_[0]->[4] <=> $_[1]->[4]
||
Expand All @@ -29,7 +29,7 @@ ExternalSorter - efficiently sort arrayrefs with a given comparison function
=cut


package ExternalSorter;
package Bio::JBrowse::ExternalSorter;

use strict;
use warnings;
Expand Down Expand Up @@ -128,7 +128,7 @@ sub flush {

# each segment must have at least one element
return if ($#sorted < 0);
croak "ExternalSorter is already finished"
croak "Bio::JBrowse::ExternalSorter is already finished"
if $self->{finished};

my $fh = File::Temp->new( $self->{tmpDir} ? (DIR => $self->{tmpDir}) : (),
Expand Down
4 changes: 2 additions & 2 deletions src/perl5/Bio/JBrowse/HashStore.pm
Expand Up @@ -36,7 +36,7 @@ use File::Path ();

use Cache::Ref::FIFO ();

use ExternalSorter;
use Bio::JBrowse::ExternalSorter;

my $bucket_class = 'Bio::JBrowse::HashStore::Bucket';

Expand Down Expand Up @@ -137,7 +137,7 @@ reading them back in sorted order.
sub sort_stream {
my ( $self, $in_stream ) = @_;

my $sorter = ExternalSorter->new(
my $sorter = Bio::JBrowse::ExternalSorter->new(
sub ($$) {
$_[0]->[0] cmp $_[1]->[0]
}, 32_000_000 );
Expand Down

0 comments on commit 7efa497

Please sign in to comment.