Removed option to select indexing algorithm from BWA wrapper and have it automatically determine the algorithm by file size.

This commit is contained in:
Kelly Vincent
2009-07-24 17:06:12 -04:00
parent 07d06fefc7
commit 5d43709a76
2 changed files with 10 additions and 14 deletions
+10 -3
View File
@@ -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:
-11
View File
@@ -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" />