sub collate_variants {
my( $collation, @reading_sets ) = @_;
+
+ # Make sure the reading sets are unique, but retain their ordering.
+ my %unique_sets;
+ my @sets;
+ foreach( @reading_sets ) {
+ push( @sets, $_ ) unless $unique_sets{$_};
+ $unique_sets{$_} = $_;
+ }
# Two different ways to do this, depending on whether we want
# transposed reading nodes to be merged into one (producing a
# nonlinear, bidirectional graph) or not (producing a relatively
# linear, unidirectional graph.)
- return $collation->linear ? _collate_linearly( @_ )
- : _collate_nonlinearly( @_ );
+ return $collation->linear ? _collate_linearly( $collation, @sets )
+ : _collate_nonlinearly( $collation, @sets );
}
sub _collate_linearly {