Add simple read group options for Bowtie2.

This commit is contained in:
Jeremy Goecks
2012-12-18 12:08:47 -05:00
parent 435079f6cd
commit 1149f1fcf3
2 changed files with 38 additions and 3 deletions
+16 -1
View File
@@ -25,6 +25,12 @@ def __main__():
parser.add_option( '', '--local', dest='local', action="store_true" )
parser.add_option( '', '--preset-alignment', dest='preset_alignment')
# Read group options.
parser.add_option( '', '--rgid', dest='rgid', help='Read group identifier' )
parser.add_option( '', '--rglb', dest='rglb', help='Library name' )
parser.add_option( '', '--rgpl', dest='rgpl', help='Platform/technology used to produce the reads' )
parser.add_option( '', '--rgsm', dest='rgsm', help='Sample' )
(options, args) = parser.parse_args()
# Creat bowtie index if necessary.
@@ -86,7 +92,16 @@ def __main__():
if options.local:
opts += ' --local'
if options.preset_alignment:
opts += " --" + options.preset_alignment
opts += ' --' + options.preset_alignment
# Read group options.
if options.rgid:
if not options.rglb or not options.rgpl or not options.rgsm:
stop_err( 'If you want to specify read groups, you must include the ID, LB, PL, and SM tags.' )
opts += ' --rg-id %s' % options.rgid
opts += ' --rg %s:%s' % ( 'LB', options.rglb )
opts += ' --rg %s:%s' % ( 'PL', options.rgpl )
opts += ' --rg %s:%s' % ( 'SM', options.rgsm )
# Final command:
cmd = cmd % ( opts, index_path, reads, options.output )
+22 -2
View File
@@ -44,6 +44,14 @@
--local --preset-alignment=$params.preset.align_preset_select-local
#end if
#end if
## Read group information.
#if $params.readGroup.specReadGroup == "yes"
--rgid="$params.readGroup.rgid"
--rglb="$params.readGroup.rglb"
--rgpl="$params.readGroup.rgpl"
--rgsm="$params.readGroup.rgsm"
#end if
</command>
<inputs>
<conditional name="singlePaired">
@@ -80,7 +88,7 @@
</when> <!-- history -->
</conditional> <!-- refGenomeSource -->
<conditional name="params">
<param name="settingsType" type="select" label="Bowtie settings to use" help="You can use the default settings or set custom values for any of Bowtie's parameters.">
<param name="settingsType" type="select" label="Parameter Settings" help="You can use the default settings or set custom values for any of Bowtie's parameters.">
<option value="preSet">Use Defaults</option>
<option value="full">Full parameter list</option>
</param>
@@ -104,9 +112,21 @@
<option value="very-sensitive">Very sensitive</option>
</param>
</when>
<!-- TODO: -->
<when value="No" />
</conditional>
<conditional name="readGroup">
<param name="specReadGroup" type="select" label="Specify the read group for this file?">
<option value="yes">Yes</option>
<option value="no" selected="True">No</option>
</param>
<when value="yes">
<param name="rgid" type="text" size="25" label="Read group identifier (ID). Each @RG line must have a unique ID. The value of ID is used in the RG tags of alignment records. Must be unique among all read groups in header section." help="Required if RG specified. Read group IDs may be modified when merging SAM files in order to handle collisions." />
<param name="rglb" type="text" size="25" label="Library name (LB)" help="Required if RG specified" />
<param name="rgpl" type="text" size="25" label="Platform/technology used to produce the reads (PL)" help="Required if RG specified. Valid values : CAPILLARY, LS454, ILLUMINA, SOLID, HELICOS, IONTORRENT and PACBIO" />
<param name="rgsm" type="text" size="25" label="Sample (SM)" help="Required if RG specified. Use pool name where a pool is being sequenced" />
</when>
<when value="no" />
</conditional>
</when> <!-- full -->
</conditional> <!-- params -->
</inputs>