Mercurial > repos > peterjc > count_roi_variants
annotate tools/count_roi_variants/count_roi_variants.xml @ 2:167765a633c0 draft default tip
"Update all the pico_galaxy tools on main Tool Shed"
author | peterjc |
---|---|
date | Fri, 16 Apr 2021 22:34:00 +0000 |
parents | 3ee6f4d0ac80 |
children |
rev | line source |
---|---|
2 | 1 <tool id="count_roi_variants" name="Count sequence variants in region of interest" version="0.0.6"> |
0 | 2 <description>using samtools view</description> |
3 <requirements> | |
1
3ee6f4d0ac80
v0.0.5 Fix version inconsistency, using samtools v1.2 now.
peterjc
parents:
0
diff
changeset
|
4 <requirement type="package" version="1.2">samtools</requirement> |
0 | 5 </requirements> |
1
3ee6f4d0ac80
v0.0.5 Fix version inconsistency, using samtools v1.2 now.
peterjc
parents:
0
diff
changeset
|
6 <version_command> |
3ee6f4d0ac80
v0.0.5 Fix version inconsistency, using samtools v1.2 now.
peterjc
parents:
0
diff
changeset
|
7 python $__tool_directory__/count_roi_variants.py --version |
3ee6f4d0ac80
v0.0.5 Fix version inconsistency, using samtools v1.2 now.
peterjc
parents:
0
diff
changeset
|
8 </version_command> |
3ee6f4d0ac80
v0.0.5 Fix version inconsistency, using samtools v1.2 now.
peterjc
parents:
0
diff
changeset
|
9 <command detect_errors="aggressive"> |
3ee6f4d0ac80
v0.0.5 Fix version inconsistency, using samtools v1.2 now.
peterjc
parents:
0
diff
changeset
|
10 python $__tool_directory__/count_roi_variants.py '$input_bam' '${input_bam.metadata.bam_index}' '$out_tabular' '$region' |
3ee6f4d0ac80
v0.0.5 Fix version inconsistency, using samtools v1.2 now.
peterjc
parents:
0
diff
changeset
|
11 </command> |
0 | 12 <inputs> |
13 <param name="input_bam" type="data" format="bam" label="Input BAM file" /> | |
14 <param name="region" type="text" label="Region of interest" help="Use the reference:start-end syntax as in samtools."> | |
15 <sanitizer> | |
16 <!-- | |
17 SAM/BAM spec says the name must match regex [!-)+-<>-~][!-~]* | |
18 but will focus on ASCII 33 ("!") to ASCII 126 ("~"), i.e. | |
19 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ | |
20 of which some are going to be potential trouble like !, ", $, &, ', \, `, {, |, } | |
21 which is how I came to this hopefully safe set.. | |
22 --> | |
23 <valid initial="string.letters,string.digits"> | |
24 <add value="#%+,-./:;=@^_|~" /> | |
25 <remove value=" " /> | |
26 </valid> | |
27 <mapping initial="none" /> | |
28 </sanitizer> | |
29 </param> | |
30 </inputs> | |
31 <outputs> | |
32 <data name="out_tabular" format="tabular" label="$input_bam.name $region variants" /> | |
33 </outputs> | |
34 <tests> | |
35 <test> | |
36 <param name="input_bam" value="ex1.bam" ftype="bam" /> | |
37 <param name="region" value="chr2:400-406" /> | |
38 <output name="out_tabular" file="ex1.count_roi_variants.tabular" ftype="tabular" /> | |
39 <assert_stdout> | |
40 <has_line line="Counted 2 variants from 40 reads spanning chr2:400-406" /> | |
41 </assert_stdout> | |
42 </test> | |
43 <test> | |
44 <param name="input_bam" value="coverage_test.bam" ftype="bam" /> | |
45 <param name="region" value="ref:10-15" /> | |
46 <output name="out_tabular" file="coverage_test.count_roi_variants.tabular" ftype="tabular" /> | |
47 <assert_stdout> | |
48 <has_line line="Counted 1 variants from 1 reads spanning ref:10-15" /> | |
49 </assert_stdout> | |
50 </test> | |
51 <!-- This test is a tricky one due to the NCBI's love of pipe characters in identifiers --> | |
52 <test> | |
53 <param name="input_bam" value="SRR639755_mito_pairs_vs_NC_010642_clc.bam" ftype="bam" /> | |
54 <param name="region" value="gi|187250362|ref|NC_010642.1|:1695-1725" /> | |
55 <output name="out_tabular" file="SRR639755_mito_pairs_vs_NC_010642_clc.count-1695-1725.tabular" ftype="tabular" /> | |
56 <assert_stdout> | |
57 <has_line line="Counted 3 variants from 16 reads spanning gi|187250362|ref|NC_010642.1|:1695-1725" /> | |
58 </assert_stdout> | |
59 </test> | |
60 <test expect_failure="true" expect_exit_code="1"> | |
61 <param name="input_bam" value="SRR639755_mito_pairs_vs_NC_010642_clc.bam" ftype="bam" /> | |
62 <param name="region" value="ref:1695-1725" /> | |
63 <assert_stderr> | |
64 <has_line line="ERROR: samtools did not recognise the region requested, can't count any variants." /> | |
65 </assert_stderr> | |
66 </test> | |
67 </tests> | |
68 <help> | |
69 **What it does** | |
70 | |
71 This tool runs the command ``samtools view`` from the SAMtools toolkit, getting | |
72 all the reads in your BAM file mapped to the given region of interest (ROI). | |
73 It then counts all the different sequence variants in reads spanning that ROI, | |
74 which are returned as a tab-separated table. | |
75 | |
76 Reads mapped to the ROI but not spanning it completely are ignored. | |
77 | |
78 Input is a sorted and indexed BAM file, the output is tabular. The first column | |
79 is the observed sequence variants within the ROI, the second column is the number | |
80 of reads with that sequence, and the third column gives this as a percentage of | |
81 the reads spanning the ROI. | |
82 | |
83 ====== ================================================================================= | |
84 Column Description | |
85 ------ --------------------------------------------------------------------------------- | |
86 1 Sequence variant from ROI | |
87 2 Number of reads with that sequence variant | |
88 3 Percentage of reads with that sequence variant (2 dp) | |
89 ====== ================================================================================= | |
90 | |
91 | |
92 **Citation** | |
93 | |
94 If you use this Galaxy tool in work leading to a scientific publication please | |
95 cite: | |
96 | |
97 Heng Li et al (2009). The Sequence Alignment/Map format and SAMtools. | |
98 Bioinformatics 25(16), 2078-9. | |
2 | 99 https://doi.org/10.1093/bioinformatics/btp352 |
0 | 100 |
101 Peter J.A. Cock (2016), Count sequence variants in region of interest in BAM file. | |
102 http://toolshed.g2.bx.psu.edu/view/peterjc/count_roi_variants | |
103 | |
104 This wrapper is available to install into other Galaxy Instances via the Galaxy | |
105 Tool Shed at http://toolshed.g2.bx.psu.edu/view/peterjc/count_roi_variants | |
106 </help> | |
107 <citations> | |
108 <citation type="doi">10.1093/bioinformatics/btp352</citation> | |
109 </citations> | |
110 </tool> |