From 5d43709a76b16f35a09a29675b20ae11503c8d54 Mon Sep 17 00:00:00 2001 From: Kelly Vincent Date: Fri, 24 Jul 2009 17:06:12 -0400 Subject: [PATCH] Removed option to select indexing algorithm from BWA wrapper and have it automatically determine the algorithm by file size. --- tools/sr_mapping/bwa_wrapper.py | 13 ++++++++++--- tools/sr_mapping/bwa_wrapper.xml | 11 ----------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/tools/sr_mapping/bwa_wrapper.py b/tools/sr_mapping/bwa_wrapper.py index 3d3ab310f49..696555bc59c 100644 --- a/tools/sr_mapping/bwa_wrapper.py +++ b/tools/sr_mapping/bwa_wrapper.py @@ -17,7 +17,6 @@ def __main__(): #Parse Command Line parser = optparse.OptionParser() parser.add_option('', '--ref', dest='ref', help='The reference genome to use or index') - parser.add_option('', '--indexingAlg', dest='indexingAlg', help='The algorithm to use while indexing') parser.add_option('', '--fastq', dest='fastq', help='The (forward) fastq file to use for the mapping') parser.add_option('', '--rfastq', dest='rfastq', help='The reverse fastq file to use for mapping if paired-end data') parser.add_option('', '--output', dest='output', help='The file to save the output (SAM format)') @@ -53,10 +52,18 @@ def __main__(): os.system('cp %s %s' % (options.ref, tmp_dir)) except Exception, erf: stop_err('Error creating temp directory for indexing purposes\n' + str(erf)) + try: + size = os.stat(options.ref).st_size + if size <= 2**30: + indexingAlg = 'is' + else: + indexingAlg = 'bwtsw' + except: + indexingAlg = 'is' if options.fileType == 'solid': - indexing_cmds = '-c -a %s' % options.indexingAlg + indexing_cmds = '-c -a %s' % indexingAlg else: - indexing_cmds = '-a %s' % options.indexingAlg + indexing_cmds = '-a %s' % indexingAlg options.ref = os.path.join(tmp_dir,os.path.split(options.ref)[1]) cmd1 = 'bwa index %s %s 2> /dev/null' % (indexing_cmds, options.ref) try: diff --git a/tools/sr_mapping/bwa_wrapper.xml b/tools/sr_mapping/bwa_wrapper.xml index ae4efaba4b6..2a28145bb35 100644 --- a/tools/sr_mapping/bwa_wrapper.xml +++ b/tools/sr_mapping/bwa_wrapper.xml @@ -4,10 +4,8 @@ bwa_wrapper.py #if $solidOrSolexa.solidRefGenomeSource.refGenomeSource == "history": --ref=$solidOrSolexa.solidRefGenomeSource.ownFile - --indexingAlg=$solidOrSolexa.solidRefGenomeSource.algorithm #else: --ref=$solidOrSolexa.solidRefGenomeSource.indices.value - --indexingAlg="None" #end if --fastq=$paired.input1 #if $paired.sPaired == "paired": @@ -74,10 +72,6 @@ - - - - @@ -98,10 +92,6 @@ - - - - @@ -177,7 +167,6 @@ -