From: martinahansen Date: Tue, 24 Nov 2009 17:26:35 +0000 (+0000) Subject: kiss_sort() X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=631f074917d4608da0553c8d7d68c4bd676e7fe0;p=biopieces.git kiss_sort() git-svn-id: http://biopieces.googlecode.com/svn/trunk@769 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/bp_bin/upload_to_KISS b/bp_bin/upload_to_KISS index cbf88fe..bb5c208 100755 --- a/bp_bin/upload_to_KISS +++ b/bp_bin/upload_to_KISS @@ -118,6 +118,7 @@ if ( $options->{ 'track_name' } ) Maasha::Filesys::file_copy( "$tmp_dir/$key", "$dst_dir/track_data.kiss" ); + Maasha::KISS::IO::kiss_sort( "$dst_dir/track_data.kiss" ); Maasha::KISS::IO::kiss_index( "$dst_dir/track_data.kiss" ); unlink "$tmp_dir/$key"; diff --git a/code_perl/Maasha/KISS/IO.pm b/code_perl/Maasha/KISS/IO.pm index f013d2f..f64af41 100644 --- a/code_perl/Maasha/KISS/IO.pm +++ b/code_perl/Maasha/KISS/IO.pm @@ -154,13 +154,30 @@ sub kiss_sql_get } +sub kiss_sort +{ + # Martin A. Hansen, November 2009. + + # Sorts a KISS file on S_BEG and S_END + + my ( $file, # KISS file + ) = @_; + + # Returns nothing. + + `sort -k 2,2n -k 3,3n > $file.sort`; + + rename "$file.sort" $file; +} + + sub kiss_index { # Martin A, Hansen, November 2009. # Creates an index of a sorted KISS file. - my ( $file, # KISS file to index + my ( $file, # KISS file ) = @_; # Returns a hashref.