]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/bwa_seq
added calc_N50 biopiece
[biopieces.git] / bp_bin / bwa_seq
index ff1818516c69cf58f7833a4bfb41b6555d7ad8aa..a9cbe186c9563e957afa3251443da6a7dcaa5e39 100755 (executable)
@@ -57,7 +57,7 @@ $in  = Maasha::Biopieces::read_stream( $options->{ "stream_in" } );
 $out = Maasha::Biopieces::write_stream( $options->{ "stream_out" } );
 
 if ( defined $options->{ 'genome' } ) {
-    $index = "$ENV{ 'BP_DATA' }/genomes/$options->{ 'genome' }/bowtie/$options->{ 'genome' }";
+    $index = "$ENV{ 'BP_DATA' }/genomes/$options->{ 'genome' }/bwa/$options->{ 'genome' }";
 } elsif (defined $options->{ 'index_name' } ) {
     $index = $options->{ 'index_name' };
 }
@@ -71,7 +71,9 @@ $fh_out = Maasha::Filesys::file_write_open( $tmp_fq );
 
 while ( $record = Maasha::Biopieces::get_record( $in ) ) 
 {
-    if ( $entry = Maasha::Fastq::biopiece2fastq( $record ) ) {
+    if ( $entry = Maasha::Fastq::biopiece2fastq( $record ) )
+    {
+        $entry->[ 2 ] =~ s/(.)/chr( ( ord( $1 ) - 64 ) + 33 )/ge; # convert scores from phred-64 to phred-33
         Maasha::Fastq::put_entry( $entry, $fh_out );
     }