+__END__
+
+sub kiss_index_nc
+{
+ # Martin A. Hansen, February 2010.
+
+ # Creates a NC list index of a sorted KISS file.
+
+ my ( $file, # path to KISS file
+ ) = @_;
+
+ # Returns nothing.
+
+ my ( $fh, $line, @fields, $nc_list );
+
+ $fh = Maasha::Filesys::file_read_open( $file );
+
+ while ( $line = <$fh> )
+ {
+ chomp $line;
+
+ @fields = split "\t", $line;
+
+ if ( not defined $nc_list ) {
+ $nc_list = [ [ @fields ] ];
+ } else {
+ Maasha::NClist::nc_list_add( $nc_list, [ @fields ], INDEX_END, INDEX );
+ }
+ }
+
+ close $fh;
+
+ Maasha::NClist::nc_list_store( $nc_list, "$file.json" );
+}
+
+
+sub kiss_index_get_entries_nc
+{
+ # Martin A. Hansen, November 2009.
+
+ # Given a path to a KISS file and a KISS index
+ # along with a beg/end interval, locate all entries
+ # in that interval and return those.
+
+ my ( $index, # KISS index
+ $beg, # interval begin
+ $end, # interval end
+ ) = @_;
+
+ # Returns a list.
+
+ my ( $features );
+
+ $features = Maasha::NClist::nc_list_get_interval( $index, $beg, $end, INDEX_BEG, INDEX_END, INDEX );
+
+ return wantarray ? @{ $features } : $features;
+}
+
+
+sub kiss_index_retrieve_nc
+{
+ # Martin A. Hansen, November 2009.
+
+ # Retrieves a KISS index from a file.
+
+ my ( $path, # Path to KISS index
+ ) = @_;
+
+ # Returns a data structure.
+
+ my ( $index );
+
+ $index = Maasha::NClist::nc_list_retrieve( $path );
+
+ return wantarray ? @{ $index } : $index;
+}