From: martinahansen Date: Mon, 25 Jan 2010 20:14:05 +0000 (+0000) Subject: added strand specificity fo assemble_contigs X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d854bf897e1d9e77f7651c4e3b7bb5faa2901aae;p=biopieces.git added strand specificity fo assemble_contigs git-svn-id: http://biopieces.googlecode.com/svn/trunk@847 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/bp_bin/assemble_contigs b/bp_bin/assemble_contigs index 8976cc8..f76bd23 100755 --- a/bp_bin/assemble_contigs +++ b/bp_bin/assemble_contigs @@ -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;