Debian Codegraph @

doc/artificialFastqGenerator/ArtificialFastqGenerationUtils.html

raw
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!-- NewPage -->
3 <html lang="en">
4 <head>
5 <!-- Generated by javadoc (version 1.7.0_51) on Wed Oct 01 16:41:56 BST 2014 -->
6 <title>ArtificialFastqGenerationUtils</title>
7 <meta name="date" content="2014-10-01">
8 <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
9 </head>
10 <body>
11 <script type="text/javascript"><!--
12 if (location.href.indexOf('is-external=true') == -1) {
13 parent.document.title="ArtificialFastqGenerationUtils";
14 }
15 //-->
16 </script>
17 <noscript>
18 <div>JavaScript is disabled on your browser.</div>
19 </noscript>
20 <!-- ========= START OF TOP NAVBAR ======= -->
21 <div class="topNav"><a name="navbar_top">
22 <!-- -->
23 </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
24 <!-- -->
25 </a>
26 <ul class="navList" title="Navigation">
27 <li><a href="../artificialFastqGenerator/package-summary.html">Package</a></li>
28 <li class="navBarCell1Rev">Class</li>
29 <li><a href="class-use/ArtificialFastqGenerationUtils.html">Use</a></li>
30 <li><a href="package-tree.html">Tree</a></li>
31 <li><a href="../deprecated-list.html">Deprecated</a></li>
32 <li><a href="../index-files/index-1.html">Index</a></li>
33 <li><a href="../help-doc.html">Help</a></li>
34 </ul>
35 </div>
36 <div class="subNav">
37 <ul class="navList">
38 <li><a href="../artificialFastqGenerator/AbstractRead.html" title="class in artificialFastqGenerator"><span class="strong">Prev Class</span></a></li>
39 <li><a href="../artificialFastqGenerator/ArtificialFastqGenerator.html" title="class in artificialFastqGenerator"><span class="strong">Next Class</span></a></li>
40 </ul>
41 <ul class="navList">
42 <li><a href="../index.html?artificialFastqGenerator/ArtificialFastqGenerationUtils.html" target="_top">Frames</a></li>
43 <li><a href="ArtificialFastqGenerationUtils.html" target="_top">No Frames</a></li>
44 </ul>
45 <ul class="navList" id="allclasses_navbar_top">
46 <li><a href="../allclasses-noframe.html">All Classes</a></li>
47 </ul>
48 <div>
49 <script type="text/javascript"><!--
50 allClassesLink = document.getElementById("allclasses_navbar_top");
51 if(window==top) {
52 allClassesLink.style.display = "block";
53 }
54 else {
55 allClassesLink.style.display = "none";
56 }
57 //-->
58 </script>
59 </div>
60 <div>
61 <ul class="subNavList">
62 <li>Summary:&nbsp;</li>
63 <li>Nested&nbsp;|&nbsp;</li>
64 <li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
65 <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
66 <li><a href="#method_summary">Method</a></li>
67 </ul>
68 <ul class="subNavList">
69 <li>Detail:&nbsp;</li>
70 <li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
71 <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
72 <li><a href="#method_detail">Method</a></li>
73 </ul>
74 </div>
75 <a name="skip-navbar_top">
76 <!-- -->
77 </a></div>
78 <!-- ========= END OF TOP NAVBAR ========= -->
79 <!-- ======== START OF CLASS DATA ======== -->
80 <div class="header">
81 <div class="subTitle">artificialFastqGenerator</div>
82 <h2 title="Class ArtificialFastqGenerationUtils" class="title">Class ArtificialFastqGenerationUtils</h2>
83 </div>
84 <div class="contentContainer">
85 <ul class="inheritance">
86 <li>java.lang.Object</li>
87 <li>
88 <ul class="inheritance">
89 <li>artificialFastqGenerator.ArtificialFastqGenerationUtils</li>
90 </ul>
91 </li>
92 </ul>
93 <div class="description">
94 <ul class="blockList">
95 <li class="blockList">
96 <hr>
97 <br>
98 <pre>public class <span class="strong">ArtificialFastqGenerationUtils</span>
99 extends java.lang.Object</pre>
100 <div class="block">ArtificialFastqGenerationUtils consists exclusively of static utility methods that are used in
101 artificial fastq generation.
102
103 Copyright (C) 2012 The Institute of Cancer Research (ICR).
104
105 This file is part of ArtificialFastqGenerator v1.0.0.
106
107 ArtificialFastqGenerator is free software: you can redistribute it and/or
108 modify it under the terms of the GNU General Public License as published by
109 the Free Software Foundation, either version 3 of the License, or (at your
110 option) any later version.
111
112 This program is distributed in the hope that it will be useful but WITHOUT
113 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
114 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
115 more details.
116
117 You should have received a copy of the GNU Public License along with this
118 program. If not, see <http://www.gnu.org/licenses/>
119
120 Authour's contact email: [email protected]</div>
121 </li>
122 </ul>
123 </div>
124 <div class="summary">
125 <ul class="blockList">
126 <li class="blockList">
127 <!-- =========== FIELD SUMMARY =========== -->
128 <ul class="blockList">
129 <li class="blockList"><a name="field_summary">
130 <!-- -->
131 </a>
132 <h3>Field Summary</h3>
133 <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
134 <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
135 <tr>
136 <th class="colFirst" scope="col">Modifier and Type</th>
137 <th class="colLast" scope="col">Field and Description</th>
138 </tr>
139 <tr class="altColor">
140 <td class="colFirst"><code>static java.util.Random</code></td>
141 <td class="colLast"><code><strong><a href="../artificialFastqGenerator/ArtificialFastqGenerationUtils.html#randNumGenerator">randNumGenerator</a></strong></code>&nbsp;</td>
142 </tr>
143 </table>
144 </li>
145 </ul>
146 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
147 <ul class="blockList">
148 <li class="blockList"><a name="constructor_summary">
149 <!-- -->
150 </a>
151 <h3>Constructor Summary</h3>
152 <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
153 <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
154 <tr>
155 <th class="colOne" scope="col">Constructor and Description</th>
156 </tr>
157 <tr class="altColor">
158 <td class="colOne"><code><strong><a href="../artificialFastqGenerator/ArtificialFastqGenerationUtils.html#ArtificialFastqGenerationUtils()">ArtificialFastqGenerationUtils</a></strong>()</code>&nbsp;</td>
159 </tr>
160 </table>
161 </li>
162 </ul>
163 <!-- ========== METHOD SUMMARY =========== -->
164 <ul class="blockList">
165 <li class="blockList"><a name="method_summary">
166 <!-- -->
167 </a>
168 <h3>Method Summary</h3>
169 <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
170 <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
171 <tr>
172 <th class="colFirst" scope="col">Modifier and Type</th>
173 <th class="colLast" scope="col">Method and Description</th>
174 </tr>
175 <tr class="altColor">
176 <td class="colFirst"><code>static int</code></td>
177 <td class="colLast"><code><strong><a href="../artificialFastqGenerator/ArtificialFastqGenerationUtils.html#calculateTargetCoverageFromGCcontent(double)">calculateTargetCoverageFromGCcontent</a></strong>(double&nbsp;GCcontent)</code>
178 <div class="block"><strong>Deprecated.</strong>&nbsp;</div>
179 </td>
180 </tr>
181 <tr class="rowColor">
182 <td class="colFirst"><code>static double</code></td>
183 <td class="colLast"><code><strong><a href="../artificialFastqGenerator/ArtificialFastqGenerationUtils.html#generateRandomDoubleBetween0And1()">generateRandomDoubleBetween0And1</a></strong>()</code>
184 <div class="block">Generates a random double between 0 and 1.</div>
185 </td>
186 </tr>
187 <tr class="altColor">
188 <td class="colFirst"><code>static char[]</code></td>
189 <td class="colLast"><code><strong><a href="../artificialFastqGenerator/ArtificialFastqGenerationUtils.html#getAlternateGenotypes(char)">getAlternateGenotypes</a></strong>(char&nbsp;genotype)</code>
190 <div class="block">Return a char array containing the alternate genotypes.</div>
191 </td>
192 </tr>
193 <tr class="rowColor">
194 <td class="colFirst"><code>static int</code></td>
195 <td class="colLast"><code><strong><a href="../artificialFastqGenerator/ArtificialFastqGenerationUtils.html#getRandomIntWithinRange(int, double, int, int)">getRandomIntWithinRange</a></strong>(int&nbsp;mean,
196 double&nbsp;standardDeviation,
197 int&nbsp;minimum,
198 int&nbsp;maximum)</code>
199 <div class="block">Generates a pseudo-random number from a normal distribution, but with a minimum and maximum value.</div>
200 </td>
201 </tr>
202 <tr class="altColor">
203 <td class="colFirst"><code>static java.lang.String</code></td>
204 <td class="colLast"><code><strong><a href="../artificialFastqGenerator/ArtificialFastqGenerationUtils.html#getStackTraceString(java.lang.Exception)">getStackTraceString</a></strong>(java.lang.Exception&nbsp;e)</code>
205 <div class="block">Generate a stack trace string for an exception object.</div>
206 </td>
207 </tr>
208 <tr class="rowColor">
209 <td class="colFirst"><code>static int</code></td>
210 <td class="colLast"><code><strong><a href="../artificialFastqGenerator/ArtificialFastqGenerationUtils.html#getTargetCoverageViaGaussFuncOfGCcont(double, double, double, double, double)">getTargetCoverageViaGaussFuncOfGCcont</a></strong>(double&nbsp;GCcontent,
211 double&nbsp;coverageMeanPeak,
212 double&nbsp;coverageMeanPeakGCcontent,
213 double&nbsp;coverageMeanGCcontentSpread,
214 double&nbsp;coverageSDdividedByMean)</code>
215 <div class="block">This method calculates a region's target coverage from its GC content.</div>
216 </td>
217 </tr>
218 <tr class="altColor">
219 <td class="colFirst"><code>static boolean</code></td>
220 <td class="colLast"><code><strong><a href="../artificialFastqGenerator/ArtificialFastqGenerationUtils.html#isACGT(char)">isACGT</a></strong>(char&nbsp;genotype)</code>
221 <div class="block">Check if a genotype (represented as a char) is A/C/G/T.</div>
222 </td>
223 </tr>
224 <tr class="rowColor">
225 <td class="colFirst"><code>static boolean</code></td>
226 <td class="colLast"><code><strong><a href="../artificialFastqGenerator/ArtificialFastqGenerationUtils.html#isGC(char)">isGC</a></strong>(char&nbsp;genotype)</code>
227 <div class="block">Check if a genotype (represented as a char) is G/C.</div>
228 </td>
229 </tr>
230 <tr class="altColor">
231 <td class="colFirst"><code>static &lt;T extends <a href="../artificialFastqGenerator/AbstractRead.html" title="class in artificialFastqGenerator">AbstractRead</a>&gt;&nbsp;<br>void</code></td>
232 <td class="colLast"><code><strong><a href="../artificialFastqGenerator/ArtificialFastqGenerationUtils.html#setRedundantReadToNull(T)">setRedundantReadToNull</a></strong>(T&nbsp;redundantRead)</code>
233 <div class="block">Set the sequence field of Read and BabyRead objects to null and then also set the object to null.</div>
234 </td>
235 </tr>
236 </table>
237 <ul class="blockList">
238 <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
239 <!-- -->
240 </a>
241 <h3>Methods inherited from class&nbsp;java.lang.Object</h3>
242 <code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
243 </ul>
244 </li>
245 </ul>
246 </li>
247 </ul>
248 </div>
249 <div class="details">
250 <ul class="blockList">
251 <li class="blockList">
252 <!-- ============ FIELD DETAIL =========== -->
253 <ul class="blockList">
254 <li class="blockList"><a name="field_detail">
255 <!-- -->
256 </a>
257 <h3>Field Detail</h3>
258 <a name="randNumGenerator">
259 <!-- -->
260 </a>
261 <ul class="blockListLast">
262 <li class="blockList">
263 <h4>randNumGenerator</h4>
264 <pre>public static&nbsp;java.util.Random randNumGenerator</pre>
265 </li>
266 </ul>
267 </li>
268 </ul>
269 <!-- ========= CONSTRUCTOR DETAIL ======== -->
270 <ul class="blockList">
271 <li class="blockList"><a name="constructor_detail">
272 <!-- -->
273 </a>
274 <h3>Constructor Detail</h3>
275 <a name="ArtificialFastqGenerationUtils()">
276 <!-- -->
277 </a>
278 <ul class="blockListLast">
279 <li class="blockList">
280 <h4>ArtificialFastqGenerationUtils</h4>
281 <pre>public&nbsp;ArtificialFastqGenerationUtils()</pre>
282 </li>
283 </ul>
284 </li>
285 </ul>
286 <!-- ============ METHOD DETAIL ========== -->
287 <ul class="blockList">
288 <li class="blockList"><a name="method_detail">
289 <!-- -->
290 </a>
291 <h3>Method Detail</h3>
292 <a name="isACGT(char)">
293 <!-- -->
294 </a>
295 <ul class="blockList">
296 <li class="blockList">
297 <h4>isACGT</h4>
298 <pre>public static&nbsp;boolean&nbsp;isACGT(char&nbsp;genotype)</pre>
299 <div class="block">Check if a genotype (represented as a char) is A/C/G/T.</div>
300 <dl><dt><span class="strong">Parameters:</span></dt><dd><code>genotype</code> - - the genotype whose type we are checking.</dd>
301 <dt><span class="strong">Returns:</span></dt><dd>isACGT - true if the genotype is A/C/G/T, else false.</dd></dl>
302 </li>
303 </ul>
304 <a name="isGC(char)">
305 <!-- -->
306 </a>
307 <ul class="blockList">
308 <li class="blockList">
309 <h4>isGC</h4>
310 <pre>public static&nbsp;boolean&nbsp;isGC(char&nbsp;genotype)</pre>
311 <div class="block">Check if a genotype (represented as a char) is G/C.</div>
312 <dl><dt><span class="strong">Parameters:</span></dt><dd><code>genotype</code> - - the genotype whose type we are checking.</dd>
313 <dt><span class="strong">Returns:</span></dt><dd>isGC - true if the genotype is G/C, else false.</dd></dl>
314 </li>
315 </ul>
316 <a name="getAlternateGenotypes(char)">
317 <!-- -->
318 </a>
319 <ul class="blockList">
320 <li class="blockList">
321 <h4>getAlternateGenotypes</h4>
322 <pre>public static&nbsp;char[]&nbsp;getAlternateGenotypes(char&nbsp;genotype)</pre>
323 <div class="block">Return a char array containing the alternate genotypes.</div>
324 <dl><dt><span class="strong">Parameters:</span></dt><dd><code>genotype</code> - - genotype for which we want the alternatives.</dd>
325 <dt><span class="strong">Returns:</span></dt><dd>alternateGenotypes - the alternative genotypes.</dd></dl>
326 </li>
327 </ul>
328 <a name="getRandomIntWithinRange(int, double, int, int)">
329 <!-- -->
330 </a>
331 <ul class="blockList">
332 <li class="blockList">
333 <h4>getRandomIntWithinRange</h4>
334 <pre>public static&nbsp;int&nbsp;getRandomIntWithinRange(int&nbsp;mean,
335 double&nbsp;standardDeviation,
336 int&nbsp;minimum,
337 int&nbsp;maximum)</pre>
338 <div class="block">Generates a pseudo-random number from a normal distribution, but with a minimum and maximum value.</div>
339 <dl><dt><span class="strong">Parameters:</span></dt><dd><code>mean</code> - - the population mean.</dd><dd><code>standardDeviation</code> - - the population standard deviation.</dd><dd><code>minimum</code> - - the minimum possible value.</dd><dd><code>maximum</code> - - the maximum possible value.</dd>
340 <dt><span class="strong">Returns:</span></dt><dd>randomIntWithinRange - the integer from the bounded normal distribution.</dd></dl>
341 </li>
342 </ul>
343 <a name="getTargetCoverageViaGaussFuncOfGCcont(double, double, double, double, double)">
344 <!-- -->
345 </a>
346 <ul class="blockList">
347 <li class="blockList">
348 <h4>getTargetCoverageViaGaussFuncOfGCcont</h4>
349 <pre>public static&nbsp;int&nbsp;getTargetCoverageViaGaussFuncOfGCcont(double&nbsp;GCcontent,
350 double&nbsp;coverageMeanPeak,
351 double&nbsp;coverageMeanPeakGCcontent,
352 double&nbsp;coverageMeanGCcontentSpread,
353 double&nbsp;coverageSDdividedByMean)</pre>
354 <div class="block">This method calculates a region's target coverage from its GC content. It uses a normal distribution to model target
355 coverage levels for a given GC content. Hence it first calculates the mean and standard deviation of this
356 distribution, and then samples from it. It calculates the mean via a Gaussian function f(x) = ae^-((x-b)^2/2c^2) where
357 a is the height of the curve's peak (coverage mean peak), b is the position of the centre of the peak (coverage mean
358 peak GC content), and c controls the width of the bell (coverage mean GC content spread). It calculates the standard
359 deviation as a multiple of the mean.</div>
360 <dl><dt><span class="strong">Parameters:</span></dt><dd><code>GCcontent</code> - </dd><dd><code>coverageMeanPeak</code> - </dd><dd><code>coverageMeanPeakGCcontent</code> - </dd><dd><code>coverageMeanGCcontentSpread</code> - </dd><dd><code>coverageSDdividedByMean</code> - </dd>
361 <dt><span class="strong">Returns:</span></dt><dd>targetCoverage</dd></dl>
362 </li>
363 </ul>
364 <a name="generateRandomDoubleBetween0And1()">
365 <!-- -->
366 </a>
367 <ul class="blockList">
368 <li class="blockList">
369 <h4>generateRandomDoubleBetween0And1</h4>
370 <pre>public static&nbsp;double&nbsp;generateRandomDoubleBetween0And1()</pre>
371 <div class="block">Generates a random double between 0 and 1.</div>
372 <dl><dt><span class="strong">Returns:</span></dt><dd>randomNumberBtwn0And1 - a pseudo-random double between 0 and 1.</dd></dl>
373 </li>
374 </ul>
375 <a name="getStackTraceString(java.lang.Exception)">
376 <!-- -->
377 </a>
378 <ul class="blockList">
379 <li class="blockList">
380 <h4>getStackTraceString</h4>
381 <pre>public static&nbsp;java.lang.String&nbsp;getStackTraceString(java.lang.Exception&nbsp;e)</pre>
382 <div class="block">Generate a stack trace string for an exception object.</div>
383 <dl><dt><span class="strong">Parameters:</span></dt><dd><code>e</code> - - the exception object.</dd>
384 <dt><span class="strong">Returns:</span></dt><dd>stackTraceString - the stack trace string for e.</dd></dl>
385 </li>
386 </ul>
387 <a name="setRedundantReadToNull(artificialFastqGenerator.AbstractRead)">
388 <!-- -->
389 </a><a name="setRedundantReadToNull(T)">
390 <!-- -->
391 </a>
392 <ul class="blockList">
393 <li class="blockList">
394 <h4>setRedundantReadToNull</h4>
395 <pre>public static&nbsp;&lt;T extends <a href="../artificialFastqGenerator/AbstractRead.html" title="class in artificialFastqGenerator">AbstractRead</a>&gt;&nbsp;void&nbsp;setRedundantReadToNull(T&nbsp;redundantRead)</pre>
396 <div class="block">Set the sequence field of Read and BabyRead objects to null and then also set the object to null. This is for helping
397 Java to garbage collect redundant Read and BabyRead objects.</div>
398 <dl><dt><span class="strong">Parameters:</span></dt><dd><code>redundantRead</code> - </dd></dl>
399 </li>
400 </ul>
401 <a name="calculateTargetCoverageFromGCcontent(double)">
402 <!-- -->
403 </a>
404 <ul class="blockListLast">
405 <li class="blockList">
406 <h4>calculateTargetCoverageFromGCcontent</h4>
407 <pre>@Deprecated
408 public static&nbsp;int&nbsp;calculateTargetCoverageFromGCcontent(double&nbsp;GCcontent)</pre>
409 <div class="block"><span class="strong">Deprecated.</span>&nbsp;</div>
410 </li>
411 </ul>
412 </li>
413 </ul>
414 </li>
415 </ul>
416 </div>
417 </div>
418 <!-- ========= END OF CLASS DATA ========= -->
419 <!-- ======= START OF BOTTOM NAVBAR ====== -->
420 <div class="bottomNav"><a name="navbar_bottom">
421 <!-- -->
422 </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
423 <!-- -->
424 </a>
425 <ul class="navList" title="Navigation">
426 <li><a href="../artificialFastqGenerator/package-summary.html">Package</a></li>
427 <li class="navBarCell1Rev">Class</li>
428 <li><a href="class-use/ArtificialFastqGenerationUtils.html">Use</a></li>
429 <li><a href="package-tree.html">Tree</a></li>
430 <li><a href="../deprecated-list.html">Deprecated</a></li>
431 <li><a href="../index-files/index-1.html">Index</a></li>
432 <li><a href="../help-doc.html">Help</a></li>
433 </ul>
434 </div>
435 <div class="subNav">
436 <ul class="navList">
437 <li><a href="../artificialFastqGenerator/AbstractRead.html" title="class in artificialFastqGenerator"><span class="strong">Prev Class</span></a></li>
438 <li><a href="../artificialFastqGenerator/ArtificialFastqGenerator.html" title="class in artificialFastqGenerator"><span class="strong">Next Class</span></a></li>
439 </ul>
440 <ul class="navList">
441 <li><a href="../index.html?artificialFastqGenerator/ArtificialFastqGenerationUtils.html" target="_top">Frames</a></li>
442 <li><a href="ArtificialFastqGenerationUtils.html" target="_top">No Frames</a></li>
443 </ul>
444 <ul class="navList" id="allclasses_navbar_bottom">
445 <li><a href="../allclasses-noframe.html">All Classes</a></li>
446 </ul>
447 <div>
448 <script type="text/javascript"><!--
449 allClassesLink = document.getElementById("allclasses_navbar_bottom");
450 if(window==top) {
451 allClassesLink.style.display = "block";
452 }
453 else {
454 allClassesLink.style.display = "none";
455 }
456 //-->
457 </script>
458 </div>
459 <div>
460 <ul class="subNavList">
461 <li>Summary:&nbsp;</li>
462 <li>Nested&nbsp;|&nbsp;</li>
463 <li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
464 <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
465 <li><a href="#method_summary">Method</a></li>
466 </ul>
467 <ul class="subNavList">
468 <li>Detail:&nbsp;</li>
469 <li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
470 <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
471 <li><a href="#method_detail">Method</a></li>
472 </ul>
473 </div>
474 <a name="skip-navbar_bottom">
475 <!-- -->
476 </a></div>
477 <!-- ======== END OF BOTTOM NAVBAR ======= -->
478 </body>
479 </html>