From: martinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Date: Thu, 5 Nov 2009 13:02:13 +0000 (+0000)
Subject: fixed KISS align code
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7dd63c24aaa2d6cb617a553cf4e8e3469b0526a5;p=biopieces.git

fixed KISS align code

git-svn-id: http://biopieces.googlecode.com/svn/trunk@748 74ccb610-7750-0410-82ae-013aeee3265d
---

diff --git a/code_perl/Maasha/KISS/IO.pm b/code_perl/Maasha/KISS/IO.pm
index f7fa8d9..965560f 100644
--- a/code_perl/Maasha/KISS/IO.pm
+++ b/code_perl/Maasha/KISS/IO.pm
@@ -35,6 +35,7 @@ use strict;
 use Data::Dumper;
 use Maasha::Common;
 use Maasha::Filesys;
+use Maasha::Align;
 use Maasha::SQL;
 use vars qw( @ISA @EXPORT );
 
@@ -326,52 +327,7 @@ sub kiss_align
         }
     }
 
-    print Dumper( "s_seq: $s_seq", "q_seq: $q_seq" ) and exit;
-}
-
-
-sub sam2kiss
-{
-    my ( $sam_entry,   # SAM entry
-       ) = @_;
-
-    # Returns a hashref
-
-    my ( $cigar, $offset, $op, $len, @descriptors, $kiss_entry );
-    
-    $cigar = $sam_entry->{ 'CIGAR' };
-
-    $cigar =~ tr/\*//d;
-
-    $offset = 0;
-
-    while ( length $cigar > 0 )
-    {
-        if ( $cigar =~ s/^([MINDSHP])(\d+)// )
-        {
-            $op  = $1;
-            $len = $2;
-
-            print "CIGAR: $cigar   OP: $op   LEN: $len\n";
-
-            if ( $op eq 'I' )
-            {
-            
-            }
-            elsif ( $op eq 'D' )
-            {
-            
-            }
-
-            $offset += $len;
-        }
-        else
-        {
-            Maasha::Common::error( qq(Bad CIGAR format: "$cigar") );
-        }
-    }
-
-    return wantarray ? %{ $kiss_entry } : $kiss_entry;
+    Maasha::Align::align_print_pairwise( [ $entry->{ 'S_ID' }, $s_seq ], [ $entry->{ 'Q_ID' }, $q_seq ] );
 }