commit/galaxy-central: kellyv: Removed unnecessary size check on BAM file produce in view step of sam-to-bam
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/61b493011087/ changeset: r5359:61b493011087 user: kellyv date: 2011-04-08 18:06:28 summary: Removed unnecessary size check on BAM file produce in view step of sam-to-bam affected #: 1 file (560 bytes) --- a/tools/samtools/sam_to_bam.py Fri Apr 08 09:45:38 2011 -0400 +++ b/tools/samtools/sam_to_bam.py Fri Apr 08 12:06:28 2011 -0400 @@ -125,8 +125,6 @@ tmp_aligns_file = tempfile.NamedTemporaryFile( dir=tmp_dir ) tmp_aligns_file_name = tmp_aligns_file.name tmp_aligns_file.close() - # IMPORTANT NOTE: for some reason the samtools view command gzips the resulting bam file without warning, - # and the docs do not currently state that this occurs ( very bad ). command = 'samtools view -bt %s -o %s %s' % ( fai_index_file_path, tmp_aligns_file_name, options.input1 ) tmp = tempfile.NamedTemporaryFile( dir=tmp_dir ).name tmp_stderr = open( tmp, 'wb' ) @@ -147,8 +145,6 @@ tmp_stderr.close() if returncode != 0: raise Exception, stderr - if len( open( tmp_aligns_file_name ).read() ) == 0: - raise Exception, 'Initial BAM file empty' except Exception, e: #clean up temp files if os.path.exists( tmp_dir ): @@ -188,11 +184,6 @@ stop_err( 'Error sorting alignments from (%s), %s' % ( tmp_aligns_file_name, str( e ) ) ) # Move tmp_aligns_file_name to our output dataset location sorted_bam_file = '%s.bam' % tmp_sorted_aligns_file_name - if os.path.getsize( sorted_bam_file ) == 0: - #clean up temp files - if os.path.exists( tmp_dir ): - shutil.rmtree( tmp_dir ) - stop_err( 'Error creating sorted version of BAM file' ) shutil.move( sorted_bam_file, options.output1 ) #clean up temp files if os.path.exists( tmp_dir ): @@ -201,6 +192,6 @@ if os.path.getsize( options.output1 ) > 0: sys.stdout.write( 'SAM file converted to BAM' ) else: - stop_err( 'The output file is empty, there may be an error with your input file or settings.' ) + stop_err( 'Error creating sorted version of BAM file.' ) if __name__=="__main__": __main__() Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket