comparison bamtools_split_ref.xml @ 5:f66e109710bd draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tool_collections/bamtools/bamtools_split commit 7d29261847d2514a1ac4246e0b8bff1d32463434
author iuc
date Wed, 11 Feb 2026 14:31:36 +0000
parents 9b8feb118f9e
children
comparison
equal deleted inserted replaced
4:9b8feb118f9e 5:f66e109710bd
1 <tool id="bamtools_split_ref" name="Split BAM by reference" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.09"> 1 <tool id="bamtools_split_ref" name="Split BAM by reference" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2 <description>into a dataset list collection</description> 2 <description>into a dataset list collection</description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 </macros> 5 </macros>
6 <expand macro="xrefs"/> 6 <expand macro="xrefs"/>
7 <expand macro="requirements"> 7 <expand macro="requirements"/>
8 <requirement type="package" version="1.16.1">samtools</requirement>
9 </expand>
10 <command><![CDATA[ 8 <command><![CDATA[
11 ln -s '${input_bam}' localbam.bam && 9 ln -s '${input_bam}' localbam.bam &&
12 ln -s '${input_bam.metadata.bam_index}' 'localbam.bam.bai' && 10 ln -s '${input_bam.metadata.bam_index}' 'localbam.bam.bai' &&
13 samtools view -bH localbam.bam --no-PG -o header.bam && 11 samtools view -bH localbam.bam --no-PG -o header.bam &&
14 bamtools split -reference 12 bamtools split -reference
33 #echo ','.join($ref_list) 31 #echo ','.join($ref_list)
34 #end if 32 #end if
35 </environment_variable> 33 </environment_variable>
36 </environment_variables> 34 </environment_variables>
37 <configfiles> 35 <configfiles>
38 <configfile name="c1">#import re 36 <configfile name="c1"><![CDATA[#import re
39 ## need to extract ref names from Galaxy's safe string representation 37 ## need to extract ref names from Galaxy's safe string representation
40 #set $ref_list = [$re.sub('^.*__sq__(.+)__sq__.*$','\\1',n) if n.find('__sq__') >= 0 else n for n in str($input_bam.metadata.reference_names).split(',')] 38 #set $ref_list = [$re.sub('^.*__sq__(.+)__sq__.*$','\\1',n) if n.find('__sq__') >= 0 else n for n in str($input_bam.metadata.reference_names).split(',')]
41 #if str($refs) != 'None' 39 #if str($refs) != 'None'
42 #set $refs_selected = set(str($refs).split(",")) 40 #set $refs_selected = set(str($refs).split(","))
43 #set $ref_list = [r for r in $ref_list if r in refs_selected] 41 #set $ref_list = [r for r in $ref_list if r in refs_selected]
44 #end if 42 #end if
45 #set $elems = [{'name': '%s: %s' % ($input_bam.name, r), 'filename': 'split_bam.REF_%s.bam' % r, 'dbkey': str($input_bam.dbkey)} for r in $ref_list] 43 #set $elems = [{'name': '%s: %s' % ($input_bam.name, r), 'filename': 'split_bam.REF_%s.bam' % r, 'dbkey': str($input_bam.dbkey)} for r in $ref_list]
46 #import json 44 #import json
47 #echo json.dumps({'output_bams': {'elements': $elems}})</configfile> 45 #echo json.dumps({'output_bams': {'elements': $elems}})]]></configfile>
48 </configfiles> 46 </configfiles>
49 <inputs> 47 <inputs>
50 <param name="input_bam" type="data" format="bam" label="BAM dataset to split by reference"/> 48 <param name="input_bam" type="data" format="bam" label="BAM dataset to split by reference"/>
51 <param name="refs" type="select" optional="True" multiple="True" label="Select references (chromosomes and contigs) you would like to restrict bam to" > 49 <param name="refs" type="select" optional="True" multiple="True" label="Select references (chromosomes and contigs) you would like to restrict bam to" >
52 <help><![CDATA[Click and type in the box above to see options. You can select multiple entries. 50 <help><![CDATA[Click and type in the box above to see options. You can select multiple entries.