<pclass="definition">Definition at line <aclass="el"href="map_8h_source.html#l00062">62</a> of file <aclass="el"href="map_8h_source.html">map.h</a>.</p>
</div><hr/>The documentation for this struct was generated from the following file:<ul>
<pclass="definition">Definition at line <aclass="el"href="parameters_8h_source.html#l00035">35</a> of file <aclass="el"href="parameters_8h_source.html">parameters.h</a>.</p>
</div><hr/>The documentation for this struct was generated from the following file:<ul>
<pclass="definition">Definition at line <aclass="el"href="signif_8h_source.html#l00043">43</a> of file <aclass="el"href="signif_8h_source.html">signif.h</a>.</p>
</div><hr/>The documentation for this struct was generated from the following file:<ul>
<ahref="subset_8cpp.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">/*</span></div><divclass="line"><aname="l00002"></a><spanclass="lineno"> 2</span> <spanclass="comment">* Copyright (C) 2020 Romain Feron</span></div><divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="comment">* This file is part of RADSex.</span></div><divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment"></span></div><divclass="line"><aname="l00005"></a><spanclass="lineno"> 5</span> <spanclass="comment">* RADSex is free software: you can redistribute it and/or modify</span></div><divclass="line"><aname="l00006"></a><spanclass="lineno"> 6</span> <spanclass="comment">* it under the terms of the GNU General Public License as published by</span></div><divclass="line"><aname="l00007"></a><spanclass="lineno"> 7</span> <spanclass="comment">* the Free Software Foundation, either version 3 of the License, or</span></div><divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <spanclass="comment">* (at your option) any later version.</span></div><divclass="line"><aname="l00009"></a><spanclass="lineno"> 9</span> <spanclass="comment"></span></div><divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="comment">* RADSex is distributed in the hope that it will be useful,</span></div><divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <spanclass="comment">* but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><divclass="line"><aname="l00012"></a><spanclass="lineno"> 12</span> <spanclass="comment">* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div><divclass="line"><aname="l00013"></a><spanclass="lineno"> 13</span> <spanclass="comment">* GNU General Public License for more details.</span></div><divclass="line"><aname="l00014"></a><spanclass="lineno"> 14</span> <spanclass="comment"></span></div><divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> <spanclass="comment">* You should have received a copy of the GNU General Public License</span></div><divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> <spanclass="comment">* along with RADSex. If not, see <https://www.gnu.org/licenses/>.</span></div><divclass="line"><aname="l00017"></a><spanclass="lineno"> 17</span> <spanclass="comment">*/</span></div><divclass="line"><aname="l00018"></a><spanclass="lineno"> 18</span> </div><divclass="line"><aname="l00024"></a><spanclass="lineno"> 24</span> <spanclass="preprocessor">#include "<aclass="code"href="subset_8h.html">subset.h</a>"</span></div><divclass="line"><aname="l00025"></a><spanclass="lineno"> 25</span> </div><divclass="line"><aname="l00026"></a><spanclass="lineno"> 26</span> </div><divclass="line"><aname="l00027"></a><spanclass="lineno"><aclass="line"href="classSubset.html#a935a07811cb720682e7b9a6435dd744e"> 27</a></span> <spanclass="keywordtype">void</span><aclass="code"href="classSubset.html#a935a07811cb720682e7b9a6435dd744e">Subset::extra_setup</a>() {</div><divclass="line"><aname="l00028"></a><spanclass="lineno"> 28</span> </div><divclass="line"><aname="l00029"></a><spanclass="lineno"> 29</span>  this-><aclass="code"href="classSubset.html#a58e930ceeaba63f8ab8bdf870aa3e6cf">output_file</a> = <aclass="code"href="utils_8h.html#ab33b713fe0754a5f7729a22cedc0fa9b">open_output</a>(<aclass="code"href="classAnalysis.html#a8abd4de209925cb46571d4db97977d32">parameters</a>.<aclass="code"href="structParameters.html#a9cb286258590de65042051e194654fdc">output_file_path</a>);</div><divclass="line"><aname="l00030"></a><spanclass="lineno"> 30</span> <spanclass="keywordflow">if</span> (not <aclass="code"href="classAnalysis.html#a8abd4de209925cb46571d4db97977d32">parameters</a>.<aclass="code"href="structParameters.html#a5da0bb1f08576f6646881a1e4f8b7c25">output_fasta</a>) this-><aclass="code"href="classSubset.html#a58e930ceeaba63f8ab8bdf870aa3e6cf">output_file</a><<<aclass="code"href="utils_8h.html#ac5169aeb75bd397c83c20b965cfdbfc6">print_list</a>(this-><aclass="code"href="classAnalysis.html#a3b9bc8b0dcc0ecea11d3a12969397ba7">markers_table</a>.<aclass="code"href="classMarkersTable.html#a355de34437483f69d063ebae100a8089">header</a>.<aclass="code"href="classHeader.html#a3e5bb0f13d849e5635a0731f13ae58fd">header</a>, <spanclass="stringliteral">"\t"</span>) <<<spanclass="stringliteral">"\n"</span>;</div><divclass="line"><aname="l00031"></a><spanclass="lineno"> 31</span> </div><divclass="line"><aname="l00032"></a><spanclass="lineno"> 32</span> }</div><divclass="line"><aname="l00033"></a><spanclass="lineno"> 33</span> </div><divclass="line"><aname="l00034"></a><spanclass="lineno"> 34</span> </div><divclass="line"><aname="l00035"></a><spanclass="lineno"> 35</span> </div><divclass="line"><aname="l00036"></a><spanclass="lineno"> 36</span> </div><divclass="line"><aname="l00037"></a><spanclass="lineno"> 37</span> </div><divclass="line"><aname="l00038"></a><spanclass="lineno"><aclass="line"href="classSubset.html#a546e6785585f2c3b25f8f1d53ac80cdf"> 38</a></span> <spanclass="keywordtype">void</span><aclass="code"href="classSubset.html#a546e6785585f2c3b25f8f1d53ac80cdf">Subset::process_marker</a>(<aclass="code"href="classMarker.html">Marker</a>& marker) {</div><divclass="line"><aname="l00039"></a><spanclass="lineno"> 39</span> </div><divclass="line"><aname="l00040"></a><spanclass="lineno"> 40</span> <spanclass="keywordflow">if</span> (marker.<aclass="code"href="classMarker.html#a6c79b442c33bf8de73d2f2c081347e2a">group_counts</a>[<aclass="code"href="classAnalysis.html#a8abd4de209925cb46571d4db97977d32">parameters</a>.<aclass="code"href="structParameters.html#a3ce2dc3d06c4b8f4398fb119931ce88a">group1</a>] >= this->parameters.subset_min_group1 and marker.<aclass="code"href="classMarker.html#a6c79b442c33bf8de73d2f2c081347e2a">group_counts</a>[<aclass="code"href="classAnalysis.html#a8abd4de209925cb46571d4db97977d32">parameters</a>.<aclass="code"href="structParameters.html#a3ce2dc3d06c4b8f4398fb119931ce88a">group1</a>] <= this->parameters.subset_max_group1 and</div><divclass="line"><aname="l00041"></a><spanclass="lineno"> 41</span>  marker.<aclass="code"href="classMarker.html#a6c79b442c33bf8de73d2f2c081347e2a">group_counts</a>[<aclass="code"href="classAnalysis.html#a8abd4de209925cb46571d4db97977d32">parameters</a>.<aclass="code"href="structParameters.html#aebb77195a9b4edb3f37df32bec3d9eba">group2</a>] >= this->parameters.subset_min_group2 and marker.<aclass="code"href="classMarker.html#a6c79b442c33bf8de73d2f2c081347e2a">group_counts</a>[<aclass="code"href="classAnalysis.html#a8abd4de209925cb46571d4db97977d32">parameters</a>.<aclass="code"href="structParameters.html#aebb77195a9b4edb3f37df32bec3d9eba">group2</a>] <= this->parameters.subset_max_group2 and</div><divclass="line"><aname="l00042"></a><spanclass="lineno"> 42</span>  marker.<aclass="code"href="classMarker.html#a3dbbb17e3bd5a194b879d983714b04b2">n_individuals</a>>= this->parameters.subset_min_individuals and marker.<aclass="code"href="classMarker.html#a3dbbb17e3bd5a194b879d983714b04b2">n_individuals</a><= this->parameters.subset_max_individuals) {</div><divclass="line"><aname="l00043"></a><spanclass="lineno"> 43</span> </div><divclass="line"><aname="l00044"></a><spanclass="lineno"> 44</span>  marker.<aclass="code"href="classMarker.html#ae4685d12aeaed673dc151a561af85db6">p</a> = <aclass="code"href="stats_8cpp.html#a748519ef79463c2bc861ef5f2f950cd0">get_p_association</a>(marker.<aclass="code"href="classMarker.html#a6c79b442c33bf8de73d2f2c081347e2a">group_counts</a>[<aclass="code"href="classAnalysis.html#a8abd4de209925cb46571d4db97977d32">parameters</a>.<aclass="code"href="structParameters.html#a3ce2dc3d06c4b8f4398fb119931ce88a">group1</a>], marker.<aclass="code"href="classMarker.html#a6c79b442c33bf8de73d2f2c081347e2a">group_counts</a>[<aclass="code"href="classAnalysis.html#a8abd4de209925cb46571d4db97977d32">parameters</a>.<aclass="code"href="structParameters.html#aebb77195a9b4edb3f37df32bec3d9eba">group2</a>], this->popmap.get_count(<aclass="code"href="classAnalysis.html#a8abd4de209925cb46571d4db97977d32">parameters</a>.<aclass="code"href="structParameters.html#a3ce2dc3d06c4b8f4398fb119931ce88a">group1</a>), this-><aclass="code"href="classAnalysis.html#a964cb61cb6b983aefe7fb2f272d1a330">popmap</a>.<aclass="code"href="classPopmap.html#a84116d0a16650cde1b7d4bca949b81c6">get_count</a>(<aclass="code"href="classAnalysis.html#a8abd4de209925cb46571d4db97977d32">parameters</a>.<aclass="code"href="structParameters.html#aebb77195a9b4edb3f37df32bec3d9eba">group2</a>));</div><divclass="line"><aname="l00045"></a><spanclass="lineno"> 45</span> </div><divclass="line"><aname="l00046"></a><spanclass="lineno"> 46</span>  this-><aclass="code"href="classAnalysis.html#a8abd4de209925cb46571d4db97977d32">parameters</a>.<aclass="code"href="structParameters.html#a5da0bb1f08576f6646881a1e4f8b7c25">output_fasta</a> ? marker.<aclass="code"href="classMarker.html#ac00868d8b7876c3bd7e71857d7823608">output_as_fasta</a>(this-><aclass="code"href="classSubset.html#a58e930ceeaba63f8ab8bdf870aa3e6cf">output_file</a>, this-><aclass="code"href="classAnalysis.html#a8abd4de209925cb46571d4db97977d32">parameters</a>.<aclass="code"href="structParameters.html#ab362fca31d273c139ca30abdf9d2966e">min_depth</a>) : marker.<aclass="code"href="classMarker.html#a7a77022130f28fcbe6243a3dcd29ecb8">output_as_table</a>(this-><aclass="code"href="classSubset.html#a58e930ceeaba63f8ab8bdf870aa3e6cf">output_file</a>);</div><divclass="line"><aname="l00047"></a><spanclass="lineno"> 47</span> </div><divclass="line"><aname="l00048"></a><spanclass="lineno"> 48</span>  }</div><divclass="line"><aname="l00049"></a><spanclass="lineno"> 49</span> </div><divclass="line"><aname="l00050"></a><spanclass="lineno"> 50</span> }</div><divclass="line"><aname="l00051"></a><spanclass="lineno"> 51</span> </div><divclass="ttc"id="classMarker_html_a7a77022130f28fcbe6243a3dcd29ecb8"><divclass="ttname"><ahref="classMarker.html#a7a77022130f28fcbe6243a3dcd29ecb8">Marker::output_as_table</a></div><divclass="ttdeci">void output_as_table(std::ofstream &output_file) const</div><divclass="ttdoc">Output a marker in table format. </div><divclass="ttdef"><b>Definition:</b><ahref="marker_8cpp_source.html#l00056">marker.cpp:56</a></div></div>
<divclass="ttc"id="structParameters_html_aebb77195a9b4edb3f37df32bec3d9eba"><divclass="ttname"><ahref="structParameters.html#aebb77195a9b4edb3f37df32bec3d9eba">Parameters::group2</a></div><divclass="ttdeci">std::string group2</div><divclass="ttdoc">Name of the secondfirst group for analysis comparing two groups. </div><divclass="ttdef"><b>Definition:</b><ahref="parameters_8h_source.html#l00050">parameters.h:50</a></div></div>
<divclass="ttc"id="classAnalysis_html_a964cb61cb6b983aefe7fb2f272d1a330"><divclass="ttname"><ahref="classAnalysis.html#a964cb61cb6b983aefe7fb2f272d1a330">Analysis::popmap</a></div><divclass="ttdeci">Popmap popmap</div><divclass="ttdoc">Popmap instance storing group for each individual. </div><divclass="ttdef"><b>Definition:</b><ahref="analysis_8h_source.html#l00059">analysis.h:59</a></div></div>
<divclass="ttc"id="classMarker_html_a3dbbb17e3bd5a194b879d983714b04b2"><divclass="ttname"><ahref="classMarker.html#a3dbbb17e3bd5a194b879d983714b04b2">Marker::n_individuals</a></div><divclass="ttdeci">uint n_individuals</div><divclass="ttdoc">Total number of individuals in which the marker is present. </div><divclass="ttdef"><b>Definition:</b><ahref="marker_8h_source.html#l00045">marker.h:45</a></div></div>
<divclass="ttc"id="classAnalysis_html_a3b9bc8b0dcc0ecea11d3a12969397ba7"><divclass="ttname"><ahref="classAnalysis.html#a3b9bc8b0dcc0ecea11d3a12969397ba7">Analysis::markers_table</a></div><divclass="ttdeci">MarkersTable markers_table</div><divclass="ttdoc">Markers table instance implementing the markers table parser and markers queue. </div><divclass="ttdef"><b>Definition:</b><ahref="analysis_8h_source.html#l00060">analysis.h:60</a></div></div>
<divclass="ttc"id="classSubset_html_a546e6785585f2c3b25f8f1d53ac80cdf"><divclass="ttname"><ahref="classSubset.html#a546e6785585f2c3b25f8f1d53ac80cdf">Subset::process_marker</a></div><divclass="ttdeci">void process_marker(Marker &marker)</div><divclass="ttdoc">Process a single marker. </div><divclass="ttdef"><b>Definition:</b><ahref="subset_8cpp_source.html#l00038">subset.cpp:38</a></div></div>
<divclass="ttc"id="classPopmap_html_a84116d0a16650cde1b7d4bca949b81c6"><divclass="ttname"><ahref="classPopmap.html#a84116d0a16650cde1b7d4bca949b81c6">Popmap::get_count</a></div><divclass="ttdeci">uint get_count(const std::string &group) const</div><divclass="ttdoc">Get individual count for a group. </div><divclass="ttdef"><b>Definition:</b><ahref="popmap_8cpp_source.html#l00117">popmap.cpp:117</a></div></div>
<divclass="ttc"id="utils_8h_html_ab33b713fe0754a5f7729a22cedc0fa9b"><divclass="ttname"><ahref="utils_8h.html#ab33b713fe0754a5f7729a22cedc0fa9b">open_output</a></div><divclass="ttdeci">std::ofstream open_output(const std::string &output_file_path)</div><divclass="ttdoc">Open an output file and check that the file is open properly. </div><divclass="ttdef"><b>Definition:</b><ahref="utils_8h_source.html#l00175">utils.h:175</a></div></div>
<divclass="ttc"id="structParameters_html_a5da0bb1f08576f6646881a1e4f8b7c25"><divclass="ttname"><ahref="structParameters.html#a5da0bb1f08576f6646881a1e4f8b7c25">Parameters::output_fasta</a></div><divclass="ttdeci">bool output_fasta</div><divclass="ttdoc">If true, markers are outputted in FASTA format. </div><divclass="ttdef"><b>Definition:</b><ahref="parameters_8h_source.html#l00046">parameters.h:46</a></div></div>
<divclass="ttc"id="classMarker_html_ac00868d8b7876c3bd7e71857d7823608"><divclass="ttname"><ahref="classMarker.html#ac00868d8b7876c3bd7e71857d7823608">Marker::output_as_fasta</a></div><divclass="ttdeci">void output_as_fasta(std::ofstream &output_file, const uint min_depth) const</div><divclass="ttdoc">Output a marker in FASTA format. </div><divclass="ttdef"><b>Definition:</b><ahref="marker_8cpp_source.html#l00068">marker.cpp:68</a></div></div>
<divclass="ttc"id="utils_8h_html_ac5169aeb75bd397c83c20b965cfdbfc6"><divclass="ttname"><ahref="utils_8h.html#ac5169aeb75bd397c83c20b965cfdbfc6">print_list</a></div><divclass="ttdeci">std::string print_list(const T &list, const std::string &sep=", ")</div><divclass="ttdoc">Print a container as a "sep"-separated string. </div><divclass="ttdef"><b>Definition:</b><ahref="utils_8h_source.html#l00281">utils.h:281</a></div></div>
<divclass="ttc"id="subset_8h_html"><divclass="ttname"><ahref="subset_8h.html">subset.h</a></div><divclass="ttdoc">Defines the Subset class implementing the "subset" analysis. </div></div>
<divclass="ttc"id="structParameters_html_a3ce2dc3d06c4b8f4398fb119931ce88a"><divclass="ttname"><ahref="structParameters.html#a3ce2dc3d06c4b8f4398fb119931ce88a">Parameters::group1</a></div><divclass="ttdeci">std::string group1</div><divclass="ttdoc">Name of the first group for analysis comparing two groups. </div><divclass="ttdef"><b>Definition:</b><ahref="parameters_8h_source.html#l00049">parameters.h:49</a></div></div>
<divclass="ttc"id="classMarker_html_a6c79b442c33bf8de73d2f2c081347e2a"><divclass="ttname"><ahref="classMarker.html#a6c79b442c33bf8de73d2f2c081347e2a">Marker::group_counts</a></div><divclass="ttdeci">std::unordered_map< std::string, uint > group_counts</div><divclass="ttdoc">Map storing group counts for the marker {group -> number of individuals in which the marker is presen...</div><divclass="ttdef"><b>Definition:</b><ahref="marker_8h_source.html#l00044">marker.h:44</a></div></div>
<divclass="ttc"id="classMarker_html_ae4685d12aeaed673dc151a561af85db6"><divclass="ttname"><ahref="classMarker.html#ae4685d12aeaed673dc151a561af85db6">Marker::p</a></div><divclass="ttdeci">float p</div><divclass="ttdoc">P-value of association with group. </div><divclass="ttdef"><b>Definition:</b><ahref="marker_8h_source.html#l00046">marker.h:46</a></div></div>
<divclass="ttc"id="structParameters_html_ab362fca31d273c139ca30abdf9d2966e"><divclass="ttname"><ahref="structParameters.html#ab362fca31d273c139ca30abdf9d2966e">Parameters::min_depth</a></div><divclass="ttdeci">uint min_depth</div><divclass="ttdoc">Minimum depth to consider a marker present in an individual. </div><divclass="ttdef"><b>Definition:</b><ahref="parameters_8h_source.html#l00054">parameters.h:54</a></div></div>
<divclass="ttc"id="stats_8cpp_html_a748519ef79463c2bc861ef5f2f950cd0"><divclass="ttname"><ahref="stats_8cpp.html#a748519ef79463c2bc861ef5f2f950cd0">get_p_association</a></div><divclass="ttdeci">double get_p_association(uint n_group1, uint n_group2, uint total_group1, uint total_group2)</div><divclass="ttdoc">Compute the p-value of association with group with a Chi-squared test. </div><divclass="ttdef"><b>Definition:</b><ahref="stats_8cpp_source.html#l00065">stats.cpp:65</a></div></div>
<divclass="ttc"id="structParameters_html_a9cb286258590de65042051e194654fdc"><divclass="ttname"><ahref="structParameters.html#a9cb286258590de65042051e194654fdc">Parameters::output_file_path</a></div><divclass="ttdeci">std::string output_file_path</div><divclass="ttdoc">Path to the output file for any analysis. </div><divclass="ttdef"><b>Definition:</b><ahref="parameters_8h_source.html#l00042">parameters.h:42</a></div></div>
<divclass="ttc"id="classHeader_html_a3e5bb0f13d849e5635a0731f13ae58fd"><divclass="ttname"><ahref="classHeader.html#a3e5bb0f13d849e5635a0731f13ae58fd">Header::header</a></div><divclass="ttdeci">std::vector< std::string > header</div><divclass="ttdoc">Vector storing all the fields in the markers table&#39;s header. </div><divclass="ttdef"><b>Definition:</b><ahref="markers__table_8h_source.html#l00049">markers_table.h:49</a></div></div>