Mercurial > repos > malex > bayesase
comparison NBmodel_stan2_galaxy.xml @ 0:e979cb57a5d5 draft default tip
"planemo upload for repository https://github.com/McIntyre-Lab/BayesASE/tree/main/galaxy commit 9b70598ef46a73632d9e0fa0c6ce6776fb5e9d6a"
author | malex |
---|---|
date | Thu, 14 Jan 2021 21:51:36 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e979cb57a5d5 |
---|---|
1 <tool id="NBmodel_stan2_galaxy" name="Run the Bayesian model" version="21.1.13"> | |
2 <description>nbmodel_stan2_flex_prior.R</description> | |
3 <macros> | |
4 <import>macros.xml</import> | |
5 </macros> | |
6 <expand macro="requirements" /> | |
7 <stdio> | |
8 <exit_code range="1:" level="fatal" /> | |
9 <regex match="recommend" | |
10 source="stderr" | |
11 level="warning" | |
12 description="recomendation message was written in stderr" /> | |
13 <regex match="Loading library" | |
14 source="stderr" | |
15 level="log" /> | |
16 <regex match="Execution halted" | |
17 source="both" | |
18 level="fatal" | |
19 description="Execution halted." /> | |
20 <regex match="error" | |
21 source="both" | |
22 level="fatal" | |
23 description="An undefined error occured, please check your intput carefully and contact your administrator." /> | |
24 </stdio> | |
25 <command><![CDATA[ | |
26 nbmodel_stan2.py | |
27 --design=$design | |
28 --infile=$infile | |
29 --outfile=$output | |
30 --cond=$cond | |
31 --iterations=$iterations | |
32 --warmup=$warmup | |
33 | |
34 ]]></command> | |
35 <inputs> | |
36 <param name="design" type="data" format="tabular,tsv" label="Design File" help="Select your Comparate Design File."/> | |
37 <param name="infile" type="data" format="tabular,tsv" label="Input File" help="Select the dataset with the merged comparates and new headers."/> | |
38 <param name="cond" type="text" label="conditions" value="2" help="Enter the number of conditions your're comparing (e.g. M v F would be 2)"/> | |
39 <param name="iterations" type="text" label="iterations" value="100000" help="Enter the number of iterations [default = 100000]"/> | |
40 <param name="warmup" type="text" label="warmup" value="10000" help="Enter the warmup number [default = 10000]"/> | |
41 </inputs> | |
42 <outputs> | |
43 <data name="output" format="tsv" label="${tool.name} on ${on_string}: Bayesian Model Output" /> | |
44 </outputs> | |
45 <tests> | |
46 <test> | |
47 <param name="design" ftype="data" value="bayesian_input/comparate_design_file.tsv"/> | |
48 <param name="infile" ftype="data" value="bayesian_input/bayesian_input_W55_M_V.tabular"/> | |
49 <param name="cond" ftype="text" value="2" /> | |
50 <param name="iterations" ftype="text" value="100000" /> | |
51 <param name="warmup" ftype="text" value="10000" /> | |
52 <output name="output" file="bayesian_output_W55_M_V.tabular" /> | |
53 </test> | |
54 </tests> | |
55 <help><![CDATA[ | |
56 | |
57 **Tool Description** | |
58 | |
59 The Run the Bayesian model tool sets the parameters for the NBModel, generalizes the input and output name requirements and initiates the STAN implementation of the NBModel. | |
60 The statistical model is packaged in the script environmentalmodel2.stan (supported on the STAN platform) and wrapped in the R script (nbmodel_stan2_flex_prior.R). | |
61 Th original R script has hardcoded the names of the conditions used in the original implementation. | |
62 | |
63 The model is used to test three hypotheses of interest: | |
64 for i = 1,2 and k = 1,2,…,Ki. | |
65 Allelic balance in Comparate 1 (e.g., Male) or, equivalently, H01: α1 = 1. | |
66 Allelic balance in Comparate 2 (e.g., Female), H02: α2 = 1. | |
67 The level of AI is not different between comparates. | |
68 | |
69 If either H01 or H02 are rejected, (at a threshold of posterior p-value 0.05) “AI_{cn }_decision” , where n refers to the comparate number, is set to 1. | |
70 If either of these cannot be rejected, these column values remain 0. | |
71 | |
72 Testing the third null hypothesis tests determines if the true proportion of reads coming from G1 is the same within Comparate 1 as it is within Comparate 2 (Novelo et. al 2018). | |
73 This is a separate process that effectively tests if α1 = α2. If H03 is rejected, the Bayesian model output columns “AI_diffinc2andc1” =1. | |
74 All model output is compiled into one wide format TSV file per Bayesian input file. | |
75 | |
76 | |
77 **Inputs** | |
78 | |
79 | |
80 **Comparate Design File [REQUIRED]** | |
81 | |
82 **NOTE**:The Comparate Design File is created and supplied by the user. It explicitly lists the comparates that the user wants to compare. | |
83 | |
84 The Comparate Design File must contain the following columns, in order:: | |
85 | |
86 (1) Comparate_1: comparate 1 identifier (ex. W55_M) | |
87 (2) Comparate_2: comparate 2 identifier (ex. W55_V) | |
88 (3) CompID: An unique identifier that specifies the condition (ex. W55_M_V) | |
89 | |
90 Example Comparate Design File: | |
91 | |
92 +---------------+---------------+----------+ | |
93 | Comparate_1 | Comparate_2 | compID | | |
94 +---------------+---------------+----------+ | |
95 | R105_F | R105_M | R105_F_M | | |
96 +---------------+---------------+----------+ | |
97 | |
98 | |
99 **Dataset or Collection of Datasets containing Comparates for comparisons[REQUIRED]** | |
100 | |
101 These files can be generated by the "Merge Comparate Datasets and Generate Headers tool. | |
102 | |
103 Example Input File | |
104 | |
105 +-------------+-----------------+-------------------+--------------------+-----------------+-------------+------------------+-------------------+--------------------+------------------+-------------------------+---------------------+------------------+-------------------+--------------------+-------------------+--------------------------+------------------+--------------------+-------------------+--------------------+------------------+--------------+------------------+------------------+--------------------+-------------------+-------------------+------------------+-----------------+----------------------+---------------------+-------------------+-------------------------+-------------------+ | |
106 | Feature_ID | prior_c1_both | prior_c1_g1 | prior_c1_g2 | c1_flag_analyze | c1_num_reps | c1_g1_total_rep1 | c1_g2_total_rep1 | c1_both_total_rep1 | c1_flag_apn_rep1 | c1_APN_total_reads_rep1 | c1_APN_both_rep1 | c1_g1_total_rep2 | c1_g2_total_rep2 | c1_both_total_rep2 | c1_flag_apn_rep2 | c1_APN_total_reads_rep2 | c1_APN_both_rep2 |prior_c2_both | prior_c2_g1 | prior_c2_g2 | c2_flag_analyze | c2_num_reps | c2_g1_total_rep1 | c2_g2_total_rep1 | c2_both_total_rep1 | c2_flag_apn_rep1 | c2_flag_apn_rep1 | c2_APN_both_rep1 | c2_g1_total_rep2| c2_g2_total_rep2 | c2_both_total_rep2 | c2_flag_apn_rep2 | c2_APN_total_reads_rep2 | c2_APN_both_rep2 | | |
107 +-------------+-----------------+-------------------+--------------------+-----------------+-------------+------------------+-------------------+--------------------+------------------+-------------------------+---------------------+------------------+-------------------+--------------------+-------------------+--------------------------+------------------+--------------------+-------------------+--------------------+------------------+--------------+------------------+------------------+--------------------+-------------------+-------------------+------------------+-----------------+----------------------+---------------------+-------------------+-------------------------+-------------------+ | |
108 |l(1)G1096 |0.799907266902715| 0.118361153262519 | 0.0817315798347665 | 1 | 2 | 295 | 234 | 2197 | 1 | 12.7234208727912 | 10.2551010446158 | 1885 | 1165 | 12201 | 1 | 71.2019427901982 | 56.9617787757493 | 0.802196053469128 | 0.114417568427753 | 0.0833863781031191 | 1 | 2 | 691 | 519 | 5020 | 1 | 29.0734648052328 | 23.4243873865079 | 1075 | 812 | 7481 | 1 | 43.7266913990042 | 34.9168212437762 | | |
109 +-------------+-----------------+-------------------+--------------------+-----------------+-------------+------------------+-------------------+--------------------+------------------+-------------------------+---------------------+------------------+-------------------+--------------------+-------------------+--------------------------+------------------+--------------------+-------------------+--------------------+------------------+--------------+------------------+------------------+--------------------+-------------------+-------------------+------------------+-----------------+----------------------+---------------------+-------------------+-------------------------+-------------------+ | |
110 | CG10932 |0.853881278538813| 0.0597412480974125| 0.0863774733637747 | 1 | 2 | 13 | 39 | 308 | 1 | 5.06815839835124 | 4.33534520830266 | 100 | 134 | 1394 | 1 | 22.9213896658325 | 19.6266745178861 | 0.866028708133971 | 0.0344497607655502| 0.0995215311004785 | 1 | 2 | 29 | 62 | 674 | 1 | 10.3878993081113 | 9.10716914470779 | 38 | 125 | 920 | 1 | 15.2470189901369 | 12.9534815250994 | | |
111 +-------------+-----------------+-------------------+--------------------+-----------------+-------------+------------------+-------------------+--------------------+------------------+-------------------------+---------------------+------------------+-------------------+--------------------+-------------------+--------------------------+------------------+--------------------+-------------------+--------------------+------------------+--------------+------------------+------------------+--------------------+-------------------+-------------------+------------------+-----------------+----------------------+---------------------+-------------------+-------------------------+-------------------+ | |
112 | CG8920 |0.808955223880597| 0.123383084577114 | 0.0676616915422886 | 1 | 2 | 93 | 20 | 500 | 1 | 39.4720538720539 | 32.1912457912458 | 347 | 257 | 2633 | 1 | 208.422222222222 | 169.53063973064 | 0.821591948764867 | 0.108417200365965 | 0.0699908508691674 | 1 | 2 | 163 | 122 | 1112 | 1 | 89.9299663299663 | 71.5858585858586 | 237 | 134 | 1881 | 1 | 144.974410774411 | 121.086195286195 | | |
113 +-------------+-----------------+-------------------+--------------------+-----------------+-------------+------------------+-------------------+--------------------+------------------+-------------------------+---------------------+------------------+-------------------+--------------------+-------------------+--------------------------+------------------+--------------------+-------------------+--------------------+------------------+--------------+------------------+------------------+--------------------+-------------------+-------------------+------------------+-----------------+----------------------+---------------------+-------------------+-------------------------+-------------------+ | |
114 | |
115 ------------------------------------------------------------------------------------------------------ | |
116 | |
117 **Output** | |
118 | |
119 | |
120 The tool generates a single TSV for every comparison (row) in the Comparate Design File: | |
121 | |
122 | |
123 Example Bayesian Output file: | |
124 | |
125 +-------------+------------+----------------+-----------------+------------------+------------------+----------------------+------------------+-----------------+-------------------+----------------------+--------------------+---------------------+------------------+----------------------------------+--------------------+-----------------+---------------+--------------+---------------------+--------------------+--------------------+---------------+--------------+----------------+---------------------+---------------------+----------------+-----------------+--------------+ | |
126 | comparison |FEATURE_ID | W55_M_num_reps | W55_V_num_reps | counts_W55_M_g1 | counts_W55_M_g2 | counts_W55_M_both | counts_W55_V_g1 | counts_W55_V_g2 | counts_W55_V_both | prior_W55_M_g1 |prior_W55_M_g2 |prior_W55_V_g1 | prior_W55_V_g2 | H3_independence_Bayesian_pvalue |g1_W55_M_sampleprop | g1_W55_M_theta |g1_W55_M_q025 |g1_W55_M_q975 | g1_W55_M_Bayes_pval |g1_W55_M_AI_decision|g1_W55_V_sampleprop |g1_W55_V_theta |g1_W55_V_q025 | g1_W55_V_q975 | g1_W55_V_Bayes_pval |g1_W55_V_AI_decision |alpha1_postmean | alpha2_postmean | flaganalyze | | |
127 +=============+============+================+=================+==================+==================+======================+==================+=================+===================+======================+====================+=====================+==================+==================================+====================+=================+===============+==============+=====================+====================+====================+===============+==============+================+=====================+=====================+================+=================+==============+ | |
128 | W55_M_V | l(1)G0196 | 3 | 3 | 362 | 520 | 3990 | 413 | 605 | 4475 | 0.0743021346469622 |0.106732348111658 |0.0751866011287093 |0.110140178408884 |0.866 |0.4104 |0.4948 |0.3778 |0.612 |0.9284 | 0 | 0.4057 |0.5082 | 0.3912 | 0.6231 | 0.8839 | 0 | 1.0182 | 0.9905 | 1 | | |
129 +-------------+------------+----------------+-----------------+------------------+------------------+----------------------+------------------+-----------------+-------------------+----------------------+--------------------+---------------------+------------------+----------------------------------+--------------------+-----------------+---------------+--------------+---------------------+--------------------+--------------------+---------------+--------------+----------------+---------------------+---------------------+----------------+-----------------+--------------+ | |
130 | W55_M_V | CG10932 | 3 | 3 | 45 | 79 | 661 | 91 | 101 | 723 | 0.0573248407643312 |0.100636942675159 |0.0994535519125683 |0.110382513661202 |00.5916 |0.3629 |0.5006 |0.3518 |0.6487 |0.993 | 0 |0.474 |0.4446 | 0.3019 | 0.5949 | 0.4525 |0 | 1.0108 | 1.1341 | 1 | | |
131 +-------------+------------+----------------+-----------------+------------------+------------------+----------------------+------------------+-----------------+-------------------+----------------------+--------------------+---------------------+------------------+----------------------------------+--------------------+-----------------+---------------+--------------+---------------------+--------------------+--------------------+---------------+--------------+----------------+---------------------+---------------------+----------------+-----------------+--------------+ | |
132 | W55_M_V | CG8920 | 3 | 3 | 49 | 18 | 336 | 41 | 25 | 337 | 0.121588089330025 |0.0446650124069479 |0.101736972704715 |0.0620347394540943|0.8316 |0.7313 |0.5274 |0.3786 |0.6721 |0.7099 | 0 |0.6212 |0.5057 | 0.3621 | 0.6482 | 0.9345 |0 | 0.9566 | 0.9996 | 1 | | |
133 +-------------+------------+----------------+-----------------+------------------+------------------+----------------------+------------------+-----------------+-------------------+----------------------+--------------------+---------------------+------------------+----------------------------------+--------------------+-----------------+---------------+--------------+---------------------+--------------------+--------------------+---------------+--------------+----------------+---------------------+---------------------+----------------+-----------------+--------------+ | |
134 | W55_M_V | Mapmodulin | 3 | 3 | 23 | 136 | 1553 | 15 | 188 | 1912 | 0.0134345794392523 |0.0794392523364486 |0.00709219858156028 |0.0888888888888889|0.8649 |0.1447 |0.4709 |0.3396 |0.6084 |0.6644 |0 |0.0739 |0.4552 |0.3175 | 0.602 | 0.5348 |0 | 1.0717 | 1.1083 | 1 | | |
135 +-------------+------------+----------------+-----------------+------------------+------------------+----------------------+------------------+-----------------+-------------------+----------------------+--------------------+---------------------+------------------+----------------------------------+--------------------+-----------------+---------------+--------------+---------------------+--------------------+--------------------+---------------+--------------+----------------+---------------------+---------------------+----------------+-----------------+--------------+ | |
136 | |
137 | |
138 Headers: | |
139 | |
140 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
141 | Name | Description | | |
142 +=====================================+==================================================================================================+ | |
143 | Comparison | • comparison being tested | | |
144 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
145 | FEATURE_ID | • Unique genic feature ID | | |
146 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
147 | c1_num_reps | • Number of replicates for comparate_1 | | |
148 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
149 | c2_num_reps | • Number of replicates for comparate 2 | | |
150 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
151 |counts_{comparate}_{g1/g2} | • Number of reads that aligned preferentially to G1 (or G2) for indicated comparate | | |
152 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
153 |counts_{comparate}_both | • Number of reads that aligned equally well to both updated genomes for indicated comparate | | |
154 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
155 | prior_{comparate}_{g1/g2} | • The prior probability that a given read will map to G1 (or G2) for {comparate} | | |
156 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
157 |H3_independence_Bayesian_evidence | • Bayesian evidence for testing the null that the alleles are independent variables. | | |
158 | | Minimum value of ev such that the 1−ev central credible interval for α1−α2. | | |
159 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
160 |{comparate}_sampleprop | • The sample proportion of reads among the reads mapped to G1 or G2 (but not both) that have | | |
161 | | mapped preferentially to G1 within {comparate}. | | |
162 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
163 |{comparate}_theta | • The point estimate of the proportion generated by G1 after adjusting for systematic bias in | | |
164 | | {comparate}. This proportion different from 1/2 implies AI in the comparate. Since | | |
165 | | {comparate}_theta is an estimate of θn1, credible intervals for θn1 are used to flag the | | |
166 | | comparate as in AI or not. | | |
167 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
168 |{comparate}_q025 | • Lower bound for the 95% central credible interval, or equivalently, the 2.5% quantile of the | | |
169 | | posterior distribution of θ1 | | |
170 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
171 |{comparate}_q975 | • Upper bound for the 95% central credible interval, or equivalently, the 97.5% quantile of | | |
172 | | the posterior distribution of θ(n1) | | |
173 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
174 |{comparate}_Bayes_evidence | • The Bayesian evidence. Smaller values can lead to rejection of the null. "ev" is the smallest | | |
175 | | value such that the 1−ev central credible interval for θ(n1) does not contain the value | | |
176 | | θ(n1) = 1/2, that implies allelic balance in comparate n. | | |
177 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
178 |{comparate}_AI_decision | • A 0/1 flag where a "1" indicates that the Bayesian evidence was less than 0.05 | | |
179 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
180 |alpha_postmean | • Alpha value for comparate 1, θ(1,1)!=0.5. Indicator of allelic imbalance. | | |
181 | | α1 = sqrt ((1/ Θi) – 1) | | |
182 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
183 |alpha2_postmean | • Alpha value for comparate θ(1,2) != 0.5 indicator of allelic imbalance. | | |
184 | | α2 = sqrt ((1/ Θi) – 1) | | |
185 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
186 |flagAnalyze | • 0/1 flag where a "1" indicates that the {comparate}_flag_analyze variables going into the | | |
187 | | model were BOTH equal to 1. | | |
188 +-------------------------------------+--------------------------------------------------------------------------------------------------+ | |
189 ]]></help> | |
190 <citations> | |
191 <citation type="bibtex">@ARTICLE{Miller20BASE, | |
192 author = {Brecca Miller, Alison M. Morse, Elyse Borgert, Zihao Liu, Kelsey Sinclair, Gavin Gamble, Fei Zou, Jeremy Newman, Luis Leon Novello, Fabio Marroni, Lauren M. McIntyre}, | |
193 title = {Testcrosses are an efficient strategy for identifying cis regulatory variation: Bayesian analysis of allele imbalance among conditions (BASE)}, | |
194 journal = {????}, | |
195 year = {submitted for publication} | |
196 }</citation> | |
197 </citations> | |
198 </tool> |