Commit 92a461de authored by hjulienne's avatar hjulienne
Browse files

add filter imputation quality

parent 8f85b369
Pipeline #19045 passed with stages
in 57 seconds
# Sphinx build info version 1 # Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 7890896c7cf0d3614ade393a5c103246 config: f0cd103aab646a141229409df671f02e
tags: 645f666f9bcd5a90fca523b33c5a78b7 tags: 645f666f9bcd5a90fca523b33c5a78b7
...@@ -17,32 +17,34 @@ ...@@ -17,32 +17,34 @@
<script type="text/javascript" src="../_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/language_data.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="../genindex.html" /> <link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" /> <link rel="search" title="Search" href="../search.html" />
<script src="../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side"> <nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll"> <div class="wy-side-scroll">
<div class="wy-side-nav-search"> <div class="wy-side-nav-search" >
...@@ -154,9 +156,7 @@ ...@@ -154,9 +156,7 @@
<li class="toctree-l2"><a class="reference internal" href="jass_preprocessing.html#module-jass_preprocessing.map_gwas">jass_preprocessing.map_gwas module</a></li> <li class="toctree-l2"><a class="reference internal" href="jass_preprocessing.html#module-jass_preprocessing.map_gwas">jass_preprocessing.map_gwas module</a></li>
<li class="toctree-l2"><a class="reference internal" href="jass_preprocessing.html#module-jass_preprocessing.map_reference">jass_preprocessing.map_reference module</a></li> <li class="toctree-l2"><a class="reference internal" href="jass_preprocessing.html#module-jass_preprocessing.map_reference">jass_preprocessing.map_reference module</a></li>
<li class="toctree-l2"><a class="reference internal" href="jass_preprocessing.html#module-jass_preprocessing.save_output">jass_preprocessing.save_output module</a></li> <li class="toctree-l2"><a class="reference internal" href="jass_preprocessing.html#module-jass_preprocessing.save_output">jass_preprocessing.save_output module</a></li>
<li class="toctree-l2"><a class="reference internal" href="jass_preprocessing.html#module-jass_preprocessing">Module contents</a><ul class="simple"> <li class="toctree-l2"><a class="reference internal" href="jass_preprocessing.html#module-jass_preprocessing">Module contents</a></li>
</ul>
</li>
</ul> </ul>
</li> </li>
</ul> </ul>
...@@ -191,25 +191,16 @@ ...@@ -191,25 +191,16 @@
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.Navigation.enable(true); SphinxRtdTheme.Navigation.enable(true);
}); });
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -17,32 +17,34 @@ ...@@ -17,32 +17,34 @@
<script type="text/javascript" src="../_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/language_data.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="../genindex.html" /> <link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" /> <link rel="search" title="Search" href="../search.html" />
<script src="../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side"> <nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll"> <div class="wy-side-scroll">
<div class="wy-side-nav-search"> <div class="wy-side-nav-search" >
...@@ -171,25 +173,16 @@ ...@@ -171,25 +173,16 @@
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.Navigation.enable(true); SphinxRtdTheme.Navigation.enable(true);
}); });
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -17,32 +17,34 @@ ...@@ -17,32 +17,34 @@
<script type="text/javascript" src="../../_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<script type="text/javascript" src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="../../genindex.html" /> <link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side"> <nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll"> <div class="wy-side-scroll">
<div class="wy-side-nav-search"> <div class="wy-side-nav-search" >
...@@ -147,7 +149,7 @@ ...@@ -147,7 +149,7 @@
<span class="kn">import</span> <span class="nn">seaborn</span> <span class="k">as</span> <span class="nn">sns</span> <span class="kn">import</span> <span class="nn">seaborn</span> <span class="k">as</span> <span class="nn">sns</span>
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span> <span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
<span class="n">perSS</span> <span class="o">=</span> <span class="mf">0.7</span>
<div class="viewcode-block" id="compute_z_score"><a class="viewcode-back" href="../../_autosummary/jass_preprocessing.html#jass_preprocessing.compute_score.compute_z_score">[docs]</a><span class="k">def</span> <span class="nf">compute_z_score</span><span class="p">(</span><span class="n">mgwas</span><span class="p">):</span> <div class="viewcode-block" id="compute_z_score"><a class="viewcode-back" href="../../_autosummary/jass_preprocessing.html#jass_preprocessing.compute_score.compute_z_score">[docs]</a><span class="k">def</span> <span class="nf">compute_z_score</span><span class="p">(</span><span class="n">mgwas</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span> <span class="sd">&quot;&quot;&quot;</span>
...@@ -168,7 +170,7 @@ ...@@ -168,7 +170,7 @@
<span class="k">return</span> <span class="n">mgwas</span></div> <span class="k">return</span> <span class="n">mgwas</span></div>
<div class="viewcode-block" id="compute_sample_size"><a class="viewcode-back" href="../../_autosummary/jass_preprocessing.html#jass_preprocessing.compute_score.compute_sample_size">[docs]</a><span class="k">def</span> <span class="nf">compute_sample_size</span><span class="p">(</span><span class="n">mgwas</span><span class="p">,</span> <span class="n">diagnostic_folder</span><span class="p">,</span> <span class="n">trait</span><span class="p">):</span> <div class="viewcode-block" id="compute_sample_size"><a class="viewcode-back" href="../../_autosummary/jass_preprocessing.html#jass_preprocessing.compute_score.compute_sample_size">[docs]</a><span class="k">def</span> <span class="nf">compute_sample_size</span><span class="p">(</span><span class="n">mgwas</span><span class="p">,</span> <span class="n">diagnostic_folder</span><span class="p">,</span> <span class="n">trait</span><span class="p">,</span> <span class="n">perSS</span> <span class="o">=</span> <span class="mf">0.7</span><span class="p">):</span>
<span class="k">if</span> <span class="s1">&#39;n&#39;</span> <span class="ow">in</span> <span class="n">mgwas</span><span class="o">.</span><span class="n">columns</span><span class="p">:</span> <span class="k">if</span> <span class="s1">&#39;n&#39;</span> <span class="ow">in</span> <span class="n">mgwas</span><span class="o">.</span><span class="n">columns</span><span class="p">:</span>
<span class="n">myN</span> <span class="o">=</span> <span class="n">mgwas</span><span class="o">.</span><span class="n">n</span> <span class="n">myN</span> <span class="o">=</span> <span class="n">mgwas</span><span class="o">.</span><span class="n">n</span>
...@@ -192,7 +194,7 @@ ...@@ -192,7 +194,7 @@
<span class="n">warnings</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s2">&quot;Some snp had an infinite sample size&quot;</span><span class="p">)</span> <span class="n">warnings</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s2">&quot;Some snp had an infinite sample size&quot;</span><span class="p">)</span>
<span class="n">myW_thres</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">percentile</span><span class="p">(</span><span class="n">myN</span><span class="o">.</span><span class="n">dropna</span><span class="p">(),</span> <span class="mi">90</span><span class="p">)</span> <span class="n">myW_thres</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">percentile</span><span class="p">(</span><span class="n">myN</span><span class="o">.</span><span class="n">dropna</span><span class="p">(),</span> <span class="mi">90</span><span class="p">)</span>
<span class="n">ss_thres</span> <span class="o">=</span> <span class="n">perSS</span> <span class="o">*</span> <span class="n">myW_thres</span> <span class="n">ss_thres</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">perSS</span><span class="p">)</span> <span class="o">*</span> <span class="n">myW_thres</span>
<span class="n">mgwas</span><span class="p">[</span><span class="s2">&quot;computed_N&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">myN</span> <span class="n">mgwas</span><span class="p">[</span><span class="s2">&quot;computed_N&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">myN</span>
<span class="n">plt</span><span class="o">.</span><span class="n">clf</span><span class="p">()</span> <span class="n">plt</span><span class="o">.</span><span class="n">clf</span><span class="p">()</span>
<span class="n">p1</span> <span class="o">=</span> <span class="n">sns</span><span class="o">.</span><span class="n">distplot</span><span class="p">(</span><span class="n">mgwas</span><span class="o">.</span><span class="n">computed_N</span><span class="p">[</span><span class="o">~</span><span class="n">mgwas</span><span class="o">.</span><span class="n">computed_N</span><span class="o">.</span><span class="n">isna</span><span class="p">()])</span> <span class="n">p1</span> <span class="o">=</span> <span class="n">sns</span><span class="o">.</span><span class="n">distplot</span><span class="p">(</span><span class="n">mgwas</span><span class="o">.</span><span class="n">computed_N</span><span class="p">[</span><span class="o">~</span><span class="n">mgwas</span><span class="o">.</span><span class="n">computed_N</span><span class="o">.</span><span class="n">isna</span><span class="p">()])</span>
...@@ -235,25 +237,16 @@ ...@@ -235,25 +237,16 @@
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.Navigation.enable(true); SphinxRtdTheme.Navigation.enable(true);
}); });
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -17,32 +17,34 @@ ...@@ -17,32 +17,34 @@
<script type="text/javascript" src="../../_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<script type="text/javascript" src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="../../genindex.html" /> <link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side"> <nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll"> <div class="wy-side-scroll">
<div class="wy-side-nav-search"> <div class="wy-side-nav-search" >
...@@ -183,25 +185,16 @@ ...@@ -183,25 +185,16 @@
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function () { jQuery(function () {
SphinxRtdTheme.Navigation.enable(true); SphinxRtdTheme.Navigation.enable(true);
}); });
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -17,32 +17,34 @@ ...@@ -17,32 +17,34 @@
<script type="text/javascript" src="../../_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<script type="text/javascript" src="../../_static/language_data.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="../../genindex.html" /> <link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" /> <link rel="search" title="Search" href="../../search.html" />
<script src="../../_static/js/modernizr.min.js"></script>
</head> </head>
<body class="wy-body-for-nav"> <body class="wy-body-for-nav">
<div class="wy-grid-for-nav"> <div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side"> <nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll"> <div class="wy-side-scroll">
<div class="wy-side-nav-search"> <div class="wy-side-nav-search" >
...@@ -151,6 +153,9 @@ ...@@ -151,6 +153,9 @@
<span class="kn">import</span> <span class="nn">sys</span> <span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span> <span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> <span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">gzip</span>
<span class="kn">import</span> <span class="nn">re</span>
<div class="viewcode-block" id="walkfs"><a class="viewcode-back" href="../../_autosummary/jass_preprocessing.html#jass_preprocessing.map_gwas.walkfs">[docs]</a><span class="k">def</span> <span class="nf">walkfs</span><span class="p">(</span><span class="n">startdir</span><span class="p">,</span> <span class="n">findfile</span><span class="p">):</span> <div class="viewcode-block" id="walkfs"><a class="viewcode-back" href="../../_autosummary/jass_preprocessing.html#jass_preprocessing.map_gwas.walkfs">[docs]</a><span class="k">def</span> <span class="nf">walkfs</span><span class="p">(</span><span class="n">startdir</span><span class="p">,</span> <span class="n">findfile</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span> <span class="sd">&quot;&quot;&quot;</span>
...@@ -214,46 +219,48 @@ ...@@ -214,46 +219,48 @@
<span class="k">return</span> <span class="n">df</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">def_missing</span><span class="p">,</span> <span class="n">nan_vec</span><span class="p">)</span></div> <span class="k">return</span> <span class="n">df</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">def_missing</span><span class="p">,</span> <span class="n">nan_vec</span><span class="p">)</span></div>
<div class="viewcode-block" id="map_columns_position"><a class="viewcode-back" href="../../_autosummary/jass_preprocessing.html#jass_preprocessing.map_gwas.map_columns_position">[docs]</a><span class="k">def</span> <span class="nf">map_columns_position</span><span class="p">(</span><span class="n">gwas_internal_link</span><span class="p">,</span> <span class="n">GWAS_labels</span><span class="p">):</span> <div class="viewcode-block" id="map_columns_position"><a class="viewcode-back" href="../../_autosummary/jass_preprocessing.html#jass_preprocessing.map_gwas.map_columns_position">[docs]</a><span class="k">def</span> <span class="nf">map_columns_position</span><span class="p">(</span><span class="n">gwas_internal_link</span><span class="p">,</span> <span class="n">column_dict</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span> <span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Find column position for each specific Gwas</span> <span class="sd"> Find column position for each specific Gwas</span>
<span class="sd"> Args:</span> <span class="sd"> Args:</span>
<span class="sd"> gwas_internal_link (str): filename of the GWAS data (with path)</span> <span class="sd"> gwas_internal_link (str): filename of the GWAS data (with path)</span>
<span class="sd"> GWAS_labels (str): filename of the csv information file</span> <span class="sd"> GWAS_labels (pd.DataFrame): corresponding row of the information file</span>
<span class="sd"> Return:</span> <span class="sd"> Return:</span>
<span class="sd"> pandas Series with column position and column names as index</span> <span class="sd"> pandas Series with column position and column names as index</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>