Mercurial > repos > iuc > bamtools_split_ref
comparison bamtools_split_ref.xml @ 0:09470ab960f1 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/bamtools/bamtools_split commit 1cacd14cfb2429fefa91fdd05c82d2e36d23283a"
author | iuc |
---|---|
date | Sat, 27 Nov 2021 10:03:33 +0000 |
parents | |
children | 9dbf707bebb0 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:09470ab960f1 |
---|---|
1 <tool id="bamtools_split_ref" name="Split BAM by Reference" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@"> | |
2 <description>into dataset list collection</description> | |
3 <macros> | |
4 <import>macros.xml</import> | |
5 </macros> | |
6 <expand macro="requirements" /> | |
7 <command> | |
8 <![CDATA[ | |
9 ln -s '${input_bam}' 'localbam.bam' && | |
10 ln -s '${input_bam.metadata.bam_index}' 'localbam.bam.bai' && | |
11 bamtools split -reference | |
12 -in localbam.bam | |
13 -stub split_bam | |
14 ## Preserve order from metadata in the output collection | |
15 #import re | |
16 #set $name = $re.sub('\W','_',$re.sub('\.bam$','',$input_bam.name)) | |
17 #if str($refs) != 'None': | |
18 #set $ref_list = ' '.join(str($refs).split(",")) | |
19 #else | |
20 #set $ref_list = ' '.join([$re.sub('^.*__sq__(.+)__sq__.*$','\\1',n) if n.find('__sq__') >= 0 else n for n in str($input_bam.metadata.reference_names).split(',')]) | |
21 #end if | |
22 && mkdir -p outputs | |
23 && (export I=0; | |
24 for i in $ref_list; | |
25 do I=\$((++I)); SN=`printf "split_bam.REF_%s.bam" "\$i"`; | |
26 if [ -e \$SN ]; then FN=`printf "outputs/split_bam%05d%s.%s.bam" \$((I)) '$name' "\$i"`; mv \$SN \$FN; fi; | |
27 done) | |
28 ]]> | |
29 </command> | |
30 <inputs> | |
31 <param name="input_bam" type="data" format="bam" label="BAM dataset to split by reference"/> | |
32 <param name="refs" type="select" optional="True" multiple="True" label="Select references (chromosomes and contigs) you would like to restrict bam to" > | |
33 <help><![CDATA[Click and type in the box above to see options. You can select multiple entries. | |
34 If "No options available" is displayed, you need to re-detect metadata on the input dataset. | |
35 ]]></help> | |
36 <options> | |
37 <filter type="data_meta" ref="input_bam" key="reference_names" /> | |
38 </options> | |
39 </param> | |
40 </inputs> | |
41 <outputs> | |
42 <collection name="output_bams" type="list" label="${input_bam.name} Split List"> | |
43 <discover_datasets pattern="split_bam\d*(?P<designation>.+)\.bam" ext="bam" directory="outputs" visible="false"/> | |
44 </collection> | |
45 </outputs> | |
46 <tests> | |
47 <test> | |
48 <param name="input_bam" ftype="bam" value="bamtools-input2.bam"/> | |
49 <output_collection name="output_bams" type="list"> | |
50 <element name="bamtools_input2.chr1" file="bamtools_input2.chr1" compare="sim_size" delta="500" /> | |
51 </output_collection> | |
52 </test> | |
53 </tests> | |
54 <help> | |
55 **What is does** | |
56 | |
57 BAMTools split is a utility for splitting BAM files. It is based on BAMtools suite of tools by Derek Barnett (https://github.com/pezmaster31/bamtools). | |
58 | |
59 ----- | |
60 | |
61 .. class:: warningmark | |
62 | |
63 **DANGER: Multiple Outputs** | |
64 | |
65 As described below, splitting a BAM dataset(s) on reference name or a tag value can produce very large numbers of outputs. Read below and know what you are doing. | |
66 | |
67 ----- | |
68 | |
69 **How it works** | |
70 | |
71 Split alignments by reference name into a dataset list collection. The collection will be in the same order as the input BAM references. | |
72 | |
73 In cases of unfinished genomes with very large number of reference sequences (scaffolds) | |
74 it can generate thousands (if not millions) of output datasets. | |
75 | |
76 | |
77 ----- | |
78 | |
79 .. class:: infomark | |
80 | |
81 **More information** | |
82 | |
83 Additional information about BAMtools can be found at https://github.com/pezmaster31/bamtools/wiki | |
84 | |
85 </help> | |
86 <citations> | |
87 <citation type="doi">10.1093/bioinformatics/btr174</citation> | |
88 </citations> | |
89 </tool> |