diff --git a/tools/sr_mapping/bowtie2_wrapper.py b/tools/sr_mapping/bowtie2_wrapper.py index 4b132d53393..c4971686de2 100644 --- a/tools/sr_mapping/bowtie2_wrapper.py +++ b/tools/sr_mapping/bowtie2_wrapper.py @@ -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 ) diff --git a/tools/sr_mapping/bowtie2_wrapper.xml b/tools/sr_mapping/bowtie2_wrapper.xml index 416fdc0f0bf..f74526a631e 100644 --- a/tools/sr_mapping/bowtie2_wrapper.xml +++ b/tools/sr_mapping/bowtie2_wrapper.xml @@ -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 @@ -80,7 +88,7 @@ - + @@ -104,9 +112,21 @@ - + + + + + + + + + + + + +