comparison diversity_pi.xml @ 31:a631c2f6d913

Update to Miller Lab devshed revision 3c4110ffacc3
author Richard Burhans <burhans@bx.psu.edu>
date Fri, 20 Sep 2013 13:25:27 -0400
parents 8997f2ca8c7a
children
comparison
equal deleted inserted replaced
30:4188853b940b 31:a631c2f6d913
1 <tool id="gd_diversity_pi" name="Diversity" version="1.0.0"> 1 <tool id="gd_diversity_pi" name="Diversity" version="1.1.0">
2 <description>&amp;pi;</description> 2 <description>: pi, allowing for unsequenced intervals</description>
3 3
4 <command interpreter="python"> 4 <command interpreter="python">
5 #import json 5 #import json
6 #import base64 6 #import base64
7 #import zlib 7 #import zlib
8 #set $ind_names = $input.dataset.metadata.individual_names 8 #set $snp_names = $input.dataset.metadata.individual_names
9 #set $ind_colms = $input.dataset.metadata.individual_columns 9 #set $snp_colms = $input.dataset.metadata.individual_columns
10 #set $ind_dict = dict(zip($ind_names, $ind_colms)) 10 #set $snp_dict = dict(zip($snp_names, $snp_colms))
11 #set $ind_json = json.dumps($ind_dict, separators=(',',':')) 11 #set $snp_json = json.dumps($snp_dict, separators=(',',':'))
12 #set $ind_comp = zlib.compress($ind_json, 9) 12 #set $snp_comp = zlib.compress($snp_json, 9)
13 #set $ind_arg = base64.b64encode($ind_comp) 13 #set $snp_arg = base64.b64encode($snp_comp)
14 diversity_pi.py '$input' '$coverage_input' '$indiv_input' '$min_coverage' '$output' '$ind_arg' 14 #if $use_cov.choice == '1'
15 #set $cov_file = $use_cov.cov_input
16 #set $cov_ext = $use_cov.cov_input.ext
17 #set $cov_names = $use_cov.cov_input.dataset.metadata.individual_names
18 #set $cov_colms = $use_cov.cov_input.dataset.metadata.individual_columns
19 #set $cov_dict = dict(zip($cov_names, $cov_colms))
20 #set $cov_json = json.dumps($cov_dict, separators=(',',':'))
21 #set $cov_comp = zlib.compress($cov_json, 9)
22 #set $cov_arg = base64.b64encode($cov_comp)
23 #set $cov_min = $use_cov.min_coverage
24 #set $cov_req = $use_cov.req_thresh
25 #else
26 #set $cov_file = '/dev/null'
27 #set $cov_ext = ''
28 #set $cov_arg = ''
29 #set $cov_min = 0
30 #set $cov_req = 0
31 #end if
32 diversity_pi.py '$input' '$input.ext' '$snp_arg' '$cov_file' '$cov_ext' '$cov_arg' '$indiv_input' '$cov_min' '$cov_req' '$output'
15 </command> 33 </command>
16 34
17 <inputs> 35 <inputs>
18 <param name="input" type="data" format="gd_snp" label="SNP dataset" /> 36 <param name="input" type="data" format="gd_snp,gd_genotype" label="SNP/Genotype dataset" />
19 <param name="coverage_input" type="data" format="interval" label="Coverage dataset" /> 37 <conditional name="use_cov">
38 <param name="choice" type="select" format="integer" label="Include Coverage dataset">
39 <option value="1" selected="true">yes</option>
40 <option value="0">no</option>
41 </param>
42 <when value="0" />
43 <when value="1">
44 <param name="cov_input" type="data" format="gd_snp,gd_genotype" label="Coverage dataset" />
45 <param name="min_coverage" type="integer" min="1" value="1" label="Minimum coverage" />
46 <param name="req_thresh" type="integer" min="1" value="1" label="Lower bound for shared well-covered bp" />
47 </when>
48 </conditional>
20 <param name="indiv_input" type="data" format="gd_indivs" label="Population Individuals" /> 49 <param name="indiv_input" type="data" format="gd_indivs" label="Population Individuals" />
21 <param name="min_coverage" type="integer" min="1" value="1" label="Minimum coverage" />
22 </inputs> 50 </inputs>
23 51
24 <outputs> 52 <outputs>
25 <data name="output" format="txt" metadata_source="input" /> 53 <data name="output" format="txt" metadata_source="input" />
26 </outputs> 54 </outputs>
27 55
56 <requirements>
57 <requirement type="package" version="0.1">gd_c_tools</requirement>
58 </requirements>
59
28 <help> 60 <help>
61 **What it does**
62
63 The user supplies the following:
64
65 1. A file in gd_genotype or gd_snp format giving the mitochondrial SNPs.
66 2. An optional gd_genotype file gives the sequence coverage for each individual at each mitochondrial position.
67 3. A set of individuals specified with the "Specify individuals" tool.
68 4. The minimum depth of sequence coverage. Positions where an individual has less coverage are ignored.
69 5. The number of adequately covered positions that must be shared by two individuals before their diversity is included in the reported average.
70
71 For each pair of individual (with adequate shared coverage), the program divides the number of nucleotide difference between the individuals in those intervals by the intervals' total length. Those ratios are averaged over the relevant pairs of individuals.
29 </help> 72 </help>
30 </tool> 73 </tool>