]> git.donarmstrong.com Git - biopieces.git/commitdiff
added strand specificity fo assemble_contigs
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 25 Jan 2010 20:14:05 +0000 (20:14 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 25 Jan 2010 20:14:05 +0000 (20:14 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@847 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/assemble_contigs

index 8976cc8e09a9b928a3d71ac425a556f51c81bf38..f76bd2326cf8ce9e8c806d5254c7c6b9c7d1c3b5 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env perl
 
-# Copyright (C) 2007-2009 Martin A. Hansen.
+# Copyright (C) 2007-2010 Martin A. Hansen.
 
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -42,6 +42,7 @@ my ( $options, $in, $out, $record, $contig_hash, $i, $s_id, $strand, $new_record
 
 $options = Maasha::Biopieces::parse_options(
     [
+        { long => 'strand', short => 's', type => 'flag', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
         { long => 'bridge', short => 'b', type => 'flag', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
     ]   
 );
@@ -53,6 +54,12 @@ while ( $record = Maasha::Biopieces::get_record( $in ) )
 {
     if ( $record->{ 'S_ID' } and $record->{ 'STRAND' } )
     {
+        if ( $options->{ 'strand' } ) {
+            next if not $record->{ 'STRAND' };
+        } else {
+            $record->{ 'STRAND' } = 'X';
+        }
+
         if ( $record->{ 'Q_ID' } and $record->{ 'S_BEG' } and $record->{ 'S_END' } )
         {
             for ( $i = $record->{ 'S_BEG' }; $i <= $record->{ 'S_END' }; $i++ ) {
@@ -105,7 +112,7 @@ foreach $s_id ( keys %{ $contig_hash } )
             $mean          = Maasha::Calc::mean( \@array );
 
             $new_record->{ 'S_ID' }        = $s_id;
-            $new_record->{ 'STRAND' }      = $strand;
+            $new_record->{ 'STRAND' }      = $strand if $options->{ 'strand' };
             $new_record->{ 'S_BEG' }       = $beg;
             $new_record->{ 'S_END' }       = $end;
             $new_record->{ 'CONTIG_ID' }   = $contig;