Mercurial > repos > jackcurragh > ribogalaxy_bowtie_genome
comparison bowtie_genome_wrapper/bowtie_genomic_wrapper.py @ 9:5b1395ac1501 draft
Uploaded
author | jackcurragh |
---|---|
date | Fri, 13 May 2022 09:31:48 +0000 |
parents | 71f778b04f6e |
children | 1ee2d07cfb72 |
comparison
equal
deleted
inserted
replaced
8:fe590b3f8b1a | 9:5b1395ac1501 |
---|---|
409 stop_err( 'Something is wrong with the alignment parameters and the alignment could not be run\n' + str( e ) ) | 409 stop_err( 'Something is wrong with the alignment parameters and the alignment could not be run\n' + str( e ) ) |
410 try: | 410 try: |
411 # have to nest try-except in try-finally to handle 2.4 | 411 # have to nest try-except in try-finally to handle 2.4 |
412 try: | 412 try: |
413 # prepare actual mapping commands | 413 # prepare actual mapping commands |
414 | |
414 if options.paired == 'paired': | 415 if options.paired == 'paired': |
415 cmd2 = 'bowtie %s %s -1 %s -2 %s > %s' % ( aligning_cmds, ref_file_name, options.input1, options.input2, options.output ) | 416 # cmd2 = 'bowtie %s %s -1 %s -2 %s > %s | samtools view -bS > %s' % ( aligning_cmds, ref_file_name, options.input1, options.input2, options.output, options.output ) |
416 else: | 417 cmd2 = 'bowtie %s %s -1 %s -2 %s > %s' % ( aligning_cmds, ref_file_name, options.input1, options.input2, options.output ) |
418 | |
419 else: | |
420 print('bowtie %s %s %s | samtools view -bS > %s' % ( aligning_cmds, ref_file_name, options.input1, options.output )) | |
421 # cmd2 = 'bowtie %s %s %s | samtools view -bS > %s' % ( aligning_cmds, ref_file_name, options.input1, options.output ) | |
417 cmd2 = 'bowtie %s %s %s > %s' % ( aligning_cmds, ref_file_name, options.input1, options.output ) | 422 cmd2 = 'bowtie %s %s %s > %s' % ( aligning_cmds, ref_file_name, options.input1, options.output ) |
423 | |
418 # align | 424 # align |
419 tmp = tempfile.NamedTemporaryFile( dir=tmp_index_dir ).name | 425 tmp = tempfile.NamedTemporaryFile( dir=tmp_index_dir ).name |
420 with open(tmp, 'w') as tmp_stderr: | 426 with open(tmp, 'w') as tmp_stderr: |
421 returncode = subprocess.call(args=cmd2, shell=True, cwd=tmp_index_dir, stderr=tmp_stderr.fileno()) | 427 returncode = subprocess.call(args=cmd2, shell=True, cwd=tmp_index_dir, stderr=tmp_stderr.fileno()) |
422 # get stderr, allowing for case where it's very large | 428 # get stderr, allowing for case where it's very large |