From 7dd63c24aaa2d6cb617a553cf4e8e3469b0526a5 Mon Sep 17 00:00:00 2001 From: martinahansen Date: Thu, 5 Nov 2009 13:02:13 +0000 Subject: [PATCH] fixed KISS align code git-svn-id: http://biopieces.googlecode.com/svn/trunk@748 74ccb610-7750-0410-82ae-013aeee3265d --- code_perl/Maasha/KISS/IO.pm | 48 ++----------------------------------- 1 file changed, 2 insertions(+), 46 deletions(-) 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 ] ); } -- 2.39.5