details: http://www.bx.psu.edu/hg/galaxy/rev/cbdd394a265c changeset: 2503:cbdd394a265c user: Kelly Vincent <kpvincent@bx.psu.edu> date: Fri Jul 24 17:06:12 2009 -0400 description: Removed option to select indexing algorithm from BWA wrapper and have it automatically determine the algorithm by file size. 2 file(s) affected in this change: tools/sr_mapping/bwa_wrapper.py tools/sr_mapping/bwa_wrapper.xml diffs (76 lines): diff -r 472bc69143be -r cbdd394a265c tools/sr_mapping/bwa_wrapper.py --- a/tools/sr_mapping/bwa_wrapper.py Fri Jul 24 16:39:48 2009 -0400 +++ b/tools/sr_mapping/bwa_wrapper.py Fri Jul 24 17:06:12 2009 -0400 @@ -17,7 +17,6 @@ #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 @@ 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 -r 472bc69143be -r cbdd394a265c tools/sr_mapping/bwa_wrapper.xml --- a/tools/sr_mapping/bwa_wrapper.xml Fri Jul 24 16:39:48 2009 -0400 +++ b/tools/sr_mapping/bwa_wrapper.xml Fri Jul 24 17:06:12 2009 -0400 @@ -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 @@ </param> <when value="history"> <param name="ownFile" type="data" label="Select a reference genome" /> - <param name="algorithm" type="select" label="Select an indexing algorithm" help="IS works on databses 2GB or less, and is linear-time. BWT-SW works on database 10MB and larger, and trades speed for memory."> - <option value="is">IS</option> - <option value="bwtsw">BWT-SW</option> - </param> </when> <when value="indexed"> <param name="indices" type="select" label="Select a reference genome"> @@ -98,10 +92,6 @@ </param> <when value="history"> <param name="ownFile" type="data" label="Select a reference genome" /> - <param name="algorithm" type="select" label="Select an indexing algorithm" help="IS works on databses 2GB or less, and is linear-time. BWT-SW works on database 10MB and larger, and trades speed for memory."> - <option value="is">IS</option> - <option value="bwtsw">BWT-SW</option> - </param> </when> <when value="indexed"> <param name="indices" type="select" label="Select a reference genome"> @@ -177,7 +167,6 @@ <param name="solidSolexa" value="solid" /> <param name="refGenomeSource" value="history" /> <param name="ownFile" value="phiX.fa" /> - <param name="algorithm" value="is" /> <param name="sPaired" value="single" /> <param name="input1" value="bwa_phiX_sanger.fastq" /> <param name="source_select" value="pre_set" />