]> git.donarmstrong.com Git - biopieces.git/commitdiff
fixed KISS align code
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 5 Nov 2009 13:02:13 +0000 (13:02 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 5 Nov 2009 13:02:13 +0000 (13:02 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@748 74ccb610-7750-0410-82ae-013aeee3265d

code_perl/Maasha/KISS/IO.pm

index f7fa8d9b8801eddcb42e7d1a01f307f74ebe5f6c..965560f72165ccbb0bf5b9950a7e1c2b2117af2b 100644 (file)
@@ -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 ] );
 }