-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0869b3a
Showing
208 changed files
with
64,062 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
<!DOCTYPE html> | ||
<html class="writer-html5" lang="en" > | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>gnomad_qc.analyses.resources — gnomad_qc master documentation</title> | ||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> | ||
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> | ||
<link rel="stylesheet" href="../../../_static/theme_overrides.css" type="text/css" /> | ||
<!--[if lt IE 9]> | ||
<script src="../../../_static/js/html5shiv.min.js"></script> | ||
<![endif]--> | ||
|
||
<script src="../../../_static/jquery.js"></script> | ||
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script> | ||
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script> | ||
<script src="../../../_static/doctools.js"></script> | ||
<script src="../../../_static/sphinx_highlight.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/mermaid.min.js"></script> | ||
<script>mermaid.initialize({startOnLoad:true});</script> | ||
<script src="../../../_static/js/theme.js"></script> | ||
<link rel="index" title="Index" href="../../../genindex.html" /> | ||
<link rel="search" title="Search" href="../../../search.html" /> | ||
</head> | ||
|
||
<body class="wy-body-for-nav"> | ||
<div class="wy-grid-for-nav"> | ||
<nav data-toggle="wy-nav-shift" class="wy-nav-side"> | ||
<div class="wy-side-scroll"> | ||
<div class="wy-side-nav-search" > | ||
|
||
|
||
|
||
<a href="../../../index.html" class="icon icon-home"> | ||
gnomad_qc | ||
</a> | ||
<div role="search"> | ||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get"> | ||
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" /> | ||
<input type="hidden" name="check_keywords" value="yes" /> | ||
<input type="hidden" name="area" value="default" /> | ||
</form> | ||
</div> | ||
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../api_reference/index.html">API Reference</a></li> | ||
<li class="toctree-l1"><a class="reference external" href="https://github.com/broadinstitute/gnomad_qc/tags">Change Log</a></li> | ||
</ul> | ||
|
||
</div> | ||
</div> | ||
</nav> | ||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > | ||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> | ||
<a href="../../../index.html">gnomad_qc</a> | ||
</nav> | ||
|
||
<div class="wy-nav-content"> | ||
<div class="rst-content"> | ||
<div role="navigation" aria-label="Page navigation"> | ||
<ul class="wy-breadcrumbs"> | ||
<li><a href="../../../index.html" class="icon icon-home" aria-label="Home"></a></li> | ||
<li class="breadcrumb-item"><a href="../../index.html">Module code</a></li> | ||
<li class="breadcrumb-item active">gnomad_qc.analyses.resources</li> | ||
<li class="wy-breadcrumbs-aside"> | ||
</li> | ||
</ul> | ||
<hr/> | ||
</div> | ||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> | ||
<div itemprop="articleBody"> | ||
|
||
<h1>Source code for gnomad_qc.analyses.resources</h1><div class="highlight"><pre> | ||
<span></span><span class="sd">"""Script containing gnomAD analysis resources."""</span> | ||
|
||
<span class="kn">import</span> <span class="nn">logging</span> | ||
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Optional</span> | ||
|
||
<span class="kn">from</span> <span class="nn">gnomad.resources.resource_utils</span> <span class="kn">import</span> <span class="n">TableResource</span> | ||
|
||
<span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s2">"analysis_resources"</span><span class="p">)</span> | ||
<span class="n">logger</span><span class="o">.</span><span class="n">setLevel</span><span class="p">(</span><span class="n">logging</span><span class="o">.</span><span class="n">INFO</span><span class="p">)</span> | ||
|
||
|
||
<span class="k">def</span> <span class="nf">_analysis_root</span><span class="p">(</span> | ||
<span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> | ||
<span class="n">version</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> | ||
<span class="n">test</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> | ||
<span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> | ||
<span class="w"> </span><span class="sd">"""</span> | ||
<span class="sd"> Get root path to the analysis resources.</span> | ||
|
||
<span class="sd"> :param name: Name of the analysis.</span> | ||
<span class="sd"> :param version: Version of the analysis path to return. Default is None, which</span> | ||
<span class="sd"> returns no additional directory nesting.</span> | ||
<span class="sd"> :param test: Whether to use a tmp path for analysis of the test dataset instead of</span> | ||
<span class="sd"> the full dataset.</span> | ||
<span class="sd"> :return: Root path of analysis resources.</span> | ||
<span class="sd"> """</span> | ||
<span class="n">version</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"/</span><span class="si">{</span><span class="n">version</span><span class="si">}</span><span class="s2">"</span> <span class="k">if</span> <span class="n">version</span> <span class="k">else</span> <span class="s2">""</span> | ||
<span class="k">return</span> <span class="p">(</span> | ||
<span class="sa">f</span><span class="s2">"gs://gnomad-tmp/gnomad_</span><span class="si">{</span><span class="n">name</span><span class="si">}</span><span class="s2">_testing</span><span class="si">{</span><span class="n">version</span><span class="si">}</span><span class="s2">"</span> | ||
<span class="k">if</span> <span class="n">test</span> | ||
<span class="k">else</span> <span class="sa">f</span><span class="s2">"gs://gnomad/analyses/</span><span class="si">{</span><span class="n">name</span><span class="si">}{</span><span class="n">version</span><span class="si">}</span><span class="s2">"</span> | ||
<span class="p">)</span> | ||
|
||
|
||
<div class="viewcode-block" id="get_pext"><a class="viewcode-back" href="../../../api_reference/analyses/resources.html#gnomad_qc.analyses.resources.get_pext">[docs]</a><span class="k">def</span> <span class="nf">get_pext</span><span class="p">(</span> | ||
<span class="n">name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"base_level"</span><span class="p">,</span> | ||
<span class="n">gtex_version</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"v10"</span><span class="p">,</span> | ||
<span class="n">test</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> | ||
<span class="p">)</span> <span class="o">-></span> <span class="n">TableResource</span><span class="p">:</span> | ||
<span class="w"> </span><span class="sd">"""</span> | ||
<span class="sd"> Get pext annotation file.</span> | ||
|
||
<span class="sd"> :param name: Name of the pext annotation file. Default is "base_level".</span> | ||
<span class="sd"> Must be one of ["annotation_level", "base_level", "exomes", "genomes",</span> | ||
<span class="sd"> "browser"].</span> | ||
<span class="sd"> :param gtex_version: GTEx version. Default is "v10".</span> | ||
<span class="sd"> :param test: Whether to use a tmp path for analysis of the test dataset instead of</span> | ||
<span class="sd"> the full dataset. Default is False.</span> | ||
<span class="sd"> :return: Pext annotation file.</span> | ||
<span class="sd"> """</span> | ||
<span class="n">version</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"gtex_</span><span class="si">{</span><span class="n">gtex_version</span><span class="si">}</span><span class="s2">"</span> | ||
<span class="k">return</span> <span class="n">TableResource</span><span class="p">(</span> | ||
<span class="n">path</span><span class="o">=</span><span class="p">(</span> | ||
<span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">_analysis_root</span><span class="p">(</span><span class="s1">'pext'</span><span class="p">,</span><span class="w"> </span><span class="n">version</span><span class="o">=</span><span class="n">version</span><span class="p">,</span><span class="w"> </span><span class="n">test</span><span class="o">=</span><span class="n">test</span><span class="p">)</span><span class="si">}</span><span class="s2">/gnomad.pext.</span><span class="si">{</span><span class="n">version</span><span class="si">}</span><span class="s2">.</span><span class="si">{</span><span class="n">name</span><span class="si">}</span><span class="s2">.ht"</span> | ||
<span class="p">)</span> | ||
<span class="p">)</span></div> | ||
</pre></div> | ||
|
||
</div> | ||
</div> | ||
<footer> | ||
|
||
<hr/> | ||
|
||
<div role="contentinfo"> | ||
<p></p> | ||
</div> | ||
|
||
|
||
|
||
</footer> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
<script> | ||
jQuery(function () { | ||
SphinxRtdTheme.Navigation.enable(true); | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.