# HG changeset patch # User devteam # Date 1437498119 14400 # Node ID 42bb952b4e3ccd8fea06c0809ac7bd512d5c40ce # Parent 1fc845afa3acdcba0cebd6c0f07f15b4263f38b9 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/bowtie2 commit d0e3412c58bd3bdc1a483a1e2f7f9c2aa5c87a1f-dirty diff -r 1fc845afa3ac -r 42bb952b4e3c bowtie2_wrapper.xml --- a/bowtie2_wrapper.xml Tue Jul 21 13:00:51 2015 -0400 +++ b/bowtie2_wrapper.xml Tue Jul 21 13:01:59 2015 -0400 @@ -1,6 +1,9 @@ - + - map reads against reference genome + + read_group_macros.xml + bowtie2 --version bowtie2 @@ -70,12 +73,30 @@ #end if #end if - ## Readgroups - #if str( $read_group.read_group_selector ) == "yes": - --rg-id "${read_group.rgid}" - --rg "SM:${read_group.rgsm}" - --rg "LB:${read_group.rglb}" - --rg "PL:${read_group.rgpl}" + ## Read group information. + @define_read_group_helpers@ + #if str( $library.type ) == "single": + #set $rg_auto_name = $read_group_name_default($library.input_1) + #elif str( $library.type ) == "paired": + #set $rg_auto_name = $read_group_name_default($library.input_1, $library.input_2) + #else + #set $rg_auto_name = $read_group_name_default($library.input_1) + #end if + @set_use_rg_var@ + @set_read_group_vars@ + #if $use_rg + $format_read_group("", $rg_id, '"', arg='--rg-id ') + $format_read_group("SM:", $rg_sm, '"', arg='--rg ') + $format_read_group("PL:", $rg_pl, '"', arg='--rg ') + $format_read_group("LB:", $rg_lb, '"', arg='--rg ') + $format_read_group("CN:", $rg_cn, '"', arg='--rg ') + $format_read_group("DS:", $rg_ds, '"', arg='--rg ') + $format_read_group("DT:", $rg_dt, '"', arg='--rg ') + $format_read_group("FO:", $rg_fo, '"', arg='--rg ') + $format_read_group("KS:", $rg_ks, '"', arg='--rg ') + $format_read_group("PG:", $rg_pg, '"', arg='--rg ') + $format_read_group("PI:", $rg_pi, '"', arg='--rg ') + $format_read_group("PU:", $rg_pu, '"', arg='--rg ') #end if ## Analysis type @@ -257,20 +278,7 @@ - - - - - - - - - - - - - - + @@ -479,6 +487,22 @@ + + + + + + + + + + + + + + + + diff -r 1fc845afa3ac -r 42bb952b4e3c read_group_macros.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/read_group_macros.xml Tue Jul 21 13:01:59 2015 -0400 @@ -0,0 +1,294 @@ + + + +#import re +#def identifier_or_name($input1) + #if hasattr($input1, 'element_identifier') + #return $input1.element_identifier + #else + #return $input1.name.rstrip('.gz').rstrip('.fastq').rstrip('.fq') + #end if +#end def + +#def clean(name) + #set $name_clean = re.sub('[^\w\-_\.]', '_', $name) + #return $name_clean +#end def + +#def read_group_name_default($input1, $input2=None) + #if $input2 is None + #return $clean($identifier_or_name($input1)) + #else + #import itertools + #set $input_name1 = $clean($identifier_or_name($input1)) + #set $input_name2 = $clean($identifier_or_name($input2)) + #set $common_prefix = ''.join([c[0] for c in itertools.takewhile(lambda x: all(x[0] == y for y in x), itertools.izip(*[$input_name1, $input_name2]))]) + #if len($common_prefix) > 3 + #return $common_prefix + #else + #return $input_name1 + #end if + #end if +#end def + +#def format_read_group(prefix, value, quote='', arg='') + #if $value + #return $arg + $quote + $prefix + $value + $quote + #else + #return '' + #end if +#end def + +#def rg_param(name) + #if $varExists("rg") + #return $rg.get($name, None) + #else + #return $getVar($name, None) + #end if +#end def + +#set $use_rg = True + + + +#if $use_rg + #if $rg_param('read_group_id_conditional') is None + #set $rg_id = $rg_auto_name + #elif $rg_param('read_group_id_conditional').do_auto_name + #set $rg_id = $rg_auto_name + #else + #set $rg_id = str($rg_param('read_group_id_conditional').ID) + #end if + + #if $rg_param('read_group_sm_conditional') is None + #set $rg_sm = '' + #elif $rg_param('read_group_sm_conditional').do_auto_name + #set $rg_sm = $rg_auto_name + #else + #set $rg_sm = str($rg_param('read_group_sm_conditional').SM) + #end if + + #if $rg_param('PL') + #set $rg_pl = str($rg_param('PL')) + #else + #set $rg_pl = '' + #end if + + #if $rg_param('read_group_lb_conditional') is None + #set $rg_lb = '' + #elif $rg_param('read_group_lb_conditional')do_auto_name + #set $rg_lb = $rg_auto_name + #else + #set $rg_lb = str($rg_param('read_group_lb_conditional').LB) + #end if + + #if $rg_param('CN') + #set $rg_cn = str($rg_param('CN')) + #else + #set $rg_cn = '' + #end if + + #if $rg_param("DS") + #set $rg_ds = str($rg_param("DS")) + #else + #set $rg_ds = '' + #end if + + #if $rg_param("DT") + #set $rg_dt = str($rg_param("DT")) + #else + #set $rg_dt = '' + #end if + + #if $rg_param("FO") + #set $rg_fo = str($rg_param("FO")) + #else + #set $rg_fo = '' + #end if + + #if $rg_param("KS") + #set $rg_ks = str($rg_param("KS")) + #else + #set $rg_ks = '' + #end if + + #if $rg_param("PG") + #set $rg_pg = str($rg_param("PG")) + #else + #set $rg_pg = '' + #end if + + #if str($rg_param("PI")) + #set $rg_pi = str($rg_param("PI")) + #else + #set $rg_pi = '' + #end if + + #if $rg_param("PU") + #set $rg_pu = str($rg_param("PU")) + #else + #set $rg_pu = '' + #end if +#end if + + +#set $use_rg = str($rg.rg_selector) != "do_not_set" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \*|[ACMGRSVTWYHKDBN]+$ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 1fc845afa3ac -r 42bb952b4e3c test-data/bowtie2-test2.bam Binary file test-data/bowtie2-test2.bam has changed