{"body": "<h1>Source code for iCallSV.FilterDellyCalls</h1><div class=\"highlight\"><pre>\n<span></span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">FilterDellyCalls</span>\n<span class=\"sd\">~~~~~~~~~~~~~~~~</span>\n\n<span class=\"sd\">:Description: This module will filter calls made by Delly which are in a VCF format</span>\n<span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">&#39;&#39;&#39;</span>\n<span class=\"sd\">Created on Mar 17, 2015</span>\n<span class=\"sd\">Description: This module will filter calls made by Delly which are in a VCF format</span>\n<span class=\"sd\">@author: Ronak H Shah</span>\n\n<span class=\"sd\">::Inputs::</span>\n<span class=\"sd\">inputVcf: Input VCF file name with path</span>\n<span class=\"sd\">outputDir: Output directory</span>\n<span class=\"sd\">controlId: Control Sample ID (Should be part of Sample Name in VCF)</span>\n<span class=\"sd\">caseID: Case Sample ID (Should be part of Sample Name in VCF)</span>\n<span class=\"sd\">hospotFile: List of Genes that have Hotspot Structural Variants (Tab-delimited Format without header:chr    start    end    geneName).</span>\n<span class=\"sd\">blacklistFile: List of Genes that have blacklist of Structural Variants (Tab-delimited Format without header:chr    start1    chr2     start2; where chr1==chr2, end==start2).</span>\n<span class=\"sd\">caseAltFreq: Alternate Allele Frequency threshold for case</span>\n<span class=\"sd\">caseTotalCount: Total ReadCount threshold for case</span>\n<span class=\"sd\">ccontrolAltFreq: Alternate Allele Frequency threshold for control</span>\n<span class=\"sd\">peSupport: overall pair-end read support threshold for the event</span>\n<span class=\"sd\">srSupport: overall split-reads support threshold for the event</span>\n<span class=\"sd\">peSupportHotspot: overall pair-end read support threshold for the event in hot-spot region</span>\n<span class=\"sd\">srSupportHotspot: overall split-reads support threshold for the event in hot-spot region</span>\n<span class=\"sd\">peSupportCase: pair-end read support threshold for the event in the Case sample</span>\n<span class=\"sd\">srSupportCase: split-reads support threshold for the event in the Case sample</span>\n<span class=\"sd\">peSupportHotspotCase: pair-end read support threshold for the event in hot-spot region for the Case sample</span>\n<span class=\"sd\">srSupportHotspotCase: split-reads support threshold for the event in hot-spot region for the Case sample</span>\n<span class=\"sd\">peSupportControl: pair-end read support threshold for the event in the Control sample</span>\n<span class=\"sd\">srSupportControl: split-reads support threshold for the event in the Control sample</span>\n<span class=\"sd\">peSupportHotspotControl: pair-end read support threshold for the event in hot-spot region for the Control sample</span>\n<span class=\"sd\">srSupportHotspotControl: split-reads support threshold for the event in hot-spot region for the Control sample</span>\n<span class=\"sd\">svlength: length of the structural variants</span>\n<span class=\"sd\">mapq: overall mapping quality</span>\n<span class=\"sd\">mapqHotspot: mapping quality for hot-spots</span>\n\n<span class=\"sd\">::Output::</span>\n<span class=\"sd\">Filtered VCF files</span>\n<span class=\"sd\">&#39;&#39;&#39;</span>\n<span class=\"kn\">import</span> <span class=\"nn\">os</span>\n<span class=\"kn\">import</span> <span class=\"nn\">sys</span>\n<span class=\"kn\">import</span> <span class=\"nn\">vcf</span>\n<span class=\"kn\">import</span> <span class=\"nn\">re</span>\n<span class=\"kn\">import</span> <span class=\"nn\">checkparameters</span> <span class=\"k\">as</span> <span class=\"nn\">cp</span>\n<span class=\"kn\">import</span> <span class=\"nn\">checkHotSpotList</span> <span class=\"k\">as</span> <span class=\"nn\">chl</span>\n<span class=\"kn\">import</span> <span class=\"nn\">checkBlackList</span> <span class=\"k\">as</span> <span class=\"nn\">cbl</span>\n<span class=\"kn\">import</span> <span class=\"nn\">logging</span>\n<span class=\"kn\">import</span> <span class=\"nn\">coloredlogs</span>\n\n<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=\"s1\">&#39;iCallSV.FilterDellyCalls&#39;</span><span class=\"p\">)</span>\n<span class=\"n\">coloredlogs</span><span class=\"o\">.</span><span class=\"n\">install</span><span class=\"p\">(</span><span class=\"n\">level</span><span class=\"o\">=</span><span class=\"s1\">&#39;DEBUG&#39;</span><span class=\"p\">)</span>\n\n<div class=\"viewcode-block\" id=\"run\"><a class=\"viewcode-back\" href=\"../../../iCallSV/#iCallSV.FilterDellyCalls.run\">[docs]</a><span class=\"k\">def</span> <span class=\"nf\">run</span><span class=\"p\">(</span>\n        <span class=\"n\">inputVcf</span><span class=\"p\">,</span>\n        <span class=\"n\">outputDir</span><span class=\"p\">,</span>\n        <span class=\"n\">controlId</span><span class=\"p\">,</span>\n        <span class=\"n\">caseID</span><span class=\"p\">,</span>\n        <span class=\"n\">hotspotFile</span><span class=\"p\">,</span>\n        <span class=\"n\">blacklistFile</span><span class=\"p\">,</span>\n        <span class=\"n\">svlength</span><span class=\"p\">,</span>\n        <span class=\"n\">mapq</span><span class=\"p\">,</span>\n        <span class=\"n\">mapqHotspot</span><span class=\"p\">,</span>\n        <span class=\"n\">caseAltFreqHotspot</span><span class=\"p\">,</span>\n        <span class=\"n\">caseTotalCountHotspot</span><span class=\"p\">,</span>\n        <span class=\"n\">controlAltFreqHotspot</span><span class=\"p\">,</span>\n        <span class=\"n\">caseAltFreq</span><span class=\"p\">,</span>\n        <span class=\"n\">caseTotalCount</span><span class=\"p\">,</span>\n        <span class=\"n\">controlAltFreq</span><span class=\"p\">,</span>\n        <span class=\"n\">peSupport</span><span class=\"p\">,</span>\n        <span class=\"n\">srSupport</span><span class=\"p\">,</span>\n        <span class=\"n\">peSupportHotspot</span><span class=\"p\">,</span>\n        <span class=\"n\">srSupportHotspot</span><span class=\"p\">,</span>\n        <span class=\"n\">peSupportCase</span><span class=\"p\">,</span>\n        <span class=\"n\">srSupportCase</span><span class=\"p\">,</span>\n        <span class=\"n\">peSupportHotspotCase</span><span class=\"p\">,</span>\n        <span class=\"n\">srSupportHotspotCase</span><span class=\"p\">,</span>\n        <span class=\"n\">peSupportControl</span><span class=\"p\">,</span>\n        <span class=\"n\">srSupportControl</span><span class=\"p\">,</span>\n        <span class=\"n\">peSupportHotspotControl</span><span class=\"p\">,</span>\n        <span class=\"n\">srSupportHotspotControl</span><span class=\"p\">,</span>\n        <span class=\"n\">verbose</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;``main:``Filter calls made by Delly which are in a VCF format</span>\n\n\n<span class=\"sd\">    :param str inputVcf: Input VCF file name with path</span>\n<span class=\"sd\">    :param str outputDir: Output directory</span>\n<span class=\"sd\">    :param str controlId: Control Sample ID (Should be part of Sample Name in VCF)</span>\n<span class=\"sd\">    :param str caseID: Case Sample ID (Should be part of Sample Name in VCF)</span>\n<span class=\"sd\">    :param str hospotFile: List of Genes that have Hotspot Structural Variants (Tab-delimited Format without header:chr    start    end    geneName).</span>\n<span class=\"sd\">    :param str blacklistFile: List of Genes that have blacklist of Structural Variants (Tab-delimited Format without header:chr    start1    chr2     start2; where chr1==chr2, end==start2).</span>\n<span class=\"sd\">    :param float caseAltFreq: Alternate Allele Frequency threshold for case</span>\n<span class=\"sd\">    :param int caseTotalCount: Total ReadCount threshold for case</span>\n<span class=\"sd\">    :param flaot ccontrolAltFreq: Alternate Allele Frequency threshold for control</span>\n<span class=\"sd\">    :param int peSupport: overall pair-end read support threshold for the event</span>\n<span class=\"sd\">    :param int srSupport: overall split-reads support threshold for the event</span>\n<span class=\"sd\">    :param int peSupportHotspot: overall pair-end read support threshold for the event in hot-spot region</span>\n<span class=\"sd\">    :param int srSupportHotspot: overall split-reads support threshold for the event in hot-spot region</span>\n<span class=\"sd\">    :param int peSupportCase: pair-end read support threshold for the event in the Case sample</span>\n<span class=\"sd\">    :param int srSupportCase: split-reads support threshold for the event in the Case sample</span>\n<span class=\"sd\">    :param int peSupportHotspotCase: pair-end read support threshold for the event in hot-spot region for the Case sample</span>\n<span class=\"sd\">    :param int srSupportHotspotCase: split-reads support threshold for the event in hot-spot region for the Case sample</span>\n<span class=\"sd\">    :param int peSupportControl: pair-end read support threshold for the event in the Control sample</span>\n<span class=\"sd\">    :param int srSupportControl: split-reads support threshold for the event in the Control sample</span>\n<span class=\"sd\">    :param int peSupportHotspotControl: pair-end read support threshold for the event in hot-spot region for the Control sample</span>\n<span class=\"sd\">    :param int srSupportHotspotControl: split-reads support threshold for the event in hot-spot region for the Control sample</span>\n<span class=\"sd\">    :param int svlength: length of the structural variants</span>\n<span class=\"sd\">    :param int mapq: overall mapping quality</span>\n<span class=\"sd\">    :param int mapqHotspot: mapping quality for hot-spots</span>\n<span class=\"sd\">    :return: A str name of filtered vcf file</span>\n<span class=\"sd\">    :rtype: str</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">verbose</span><span class=\"p\">):</span>\n        <span class=\"n\">logger</span><span class=\"o\">.</span><span class=\"n\">info</span><span class=\"p\">(</span><span class=\"s2\">&quot;FilterDellyCalls: We will now check all the input parameters&quot;</span><span class=\"p\">)</span>\n    <span class=\"c1\"># Check input parameters</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkDir</span><span class=\"p\">(</span><span class=\"n\">outputDir</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkFile</span><span class=\"p\">(</span><span class=\"n\">hotspotFile</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkFile</span><span class=\"p\">(</span><span class=\"n\">blacklistFile</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkEmpty</span><span class=\"p\">(</span><span class=\"n\">controlId</span><span class=\"p\">,</span> <span class=\"s2\">&quot;Control Bam ID&quot;</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkEmpty</span><span class=\"p\">(</span><span class=\"n\">caseID</span><span class=\"p\">,</span> <span class=\"s2\">&quot;Case Bam ID&quot;</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkInt</span><span class=\"p\">(</span><span class=\"n\">svlength</span><span class=\"p\">,</span> <span class=\"s2\">&quot;Length of Structural Variant Threshold&quot;</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkInt</span><span class=\"p\">(</span><span class=\"n\">mapq</span><span class=\"p\">,</span> <span class=\"s2\">&quot;Mapping quality of Reads threshold&quot;</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkInt</span><span class=\"p\">(</span><span class=\"n\">mapqHotspot</span><span class=\"p\">,</span> <span class=\"s2\">&quot;Mapping quality of Reads threshold for hotspot events &quot;</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkInt</span><span class=\"p\">(</span><span class=\"n\">peSupport</span><span class=\"p\">,</span> <span class=\"s2\">&quot;overall pair-end read support threshold for the event&quot;</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkInt</span><span class=\"p\">(</span><span class=\"n\">srSupport</span><span class=\"p\">,</span> <span class=\"s2\">&quot;overall split-reads support threshold for the event&quot;</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkInt</span><span class=\"p\">(</span>\n        <span class=\"n\">peSupportHotspot</span><span class=\"p\">,</span>\n        <span class=\"s2\">&quot;overall pair-end read support threshold for the event in hot-spot region&quot;</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkInt</span><span class=\"p\">(</span>\n        <span class=\"n\">srSupportHotspot</span><span class=\"p\">,</span>\n        <span class=\"s2\">&quot;overall split-reads support threshold for the event in hot-spot region&quot;</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkInt</span><span class=\"p\">(</span>\n        <span class=\"n\">peSupportCase</span><span class=\"p\">,</span>\n        <span class=\"s2\">&quot;overall pair-end read support threshold for the event for the Case sample&quot;</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkInt</span><span class=\"p\">(</span>\n        <span class=\"n\">srSupportCase</span><span class=\"p\">,</span>\n        <span class=\"s2\">&quot;overall split-reads support threshold for the event for the Case sample&quot;</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkInt</span><span class=\"p\">(</span>\n        <span class=\"n\">peSupportHotspotCase</span><span class=\"p\">,</span>\n        <span class=\"s2\">&quot;overall pair-end read support threshold for the event in hot-spot region for the Case sample&quot;</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkInt</span><span class=\"p\">(</span>\n        <span class=\"n\">srSupportHotspotCase</span><span class=\"p\">,</span>\n        <span class=\"s2\">&quot;overall split-reads support threshold for the event in hot-spot region for the Case sample&quot;</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkInt</span><span class=\"p\">(</span>\n        <span class=\"n\">peSupportControl</span><span class=\"p\">,</span>\n        <span class=\"s2\">&quot;overall pair-end read support threshold for the event for the Control sample&quot;</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkInt</span><span class=\"p\">(</span>\n        <span class=\"n\">srSupportControl</span><span class=\"p\">,</span>\n        <span class=\"s2\">&quot;overall split-reads support threshold for the event for the Control sample&quot;</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkInt</span><span class=\"p\">(</span>\n        <span class=\"n\">peSupportHotspotControl</span><span class=\"p\">,</span>\n        <span class=\"s2\">&quot;overall pair-end read support threshold for the event in hot-spot region for the Control sample&quot;</span><span class=\"p\">)</span>\n    <span class=\"n\">cp</span><span class=\"o\">.</span><span class=\"n\">checkInt</span><span class=\"p\">(</span>\n        <span class=\"n\">srSupportHotspotControl</span><span class=\"p\">,</span>\n        <span class=\"s2\">&quot;overall split-reads support threshold for the event in hot-spot region for the Control sample&quot;</span><span class=\"p\">)</span>\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">verbose</span><span class=\"p\">):</span>\n        <span class=\"n\">logger</span><span class=\"o\">.</span><span class=\"n\">info</span><span class=\"p\">(</span><span class=\"s2\">&quot;FilterDellyCalls: All Input Parameters look good for filtering these VCF file.&quot;</span><span class=\"p\">)</span>\n        <span class=\"n\">logger</span><span class=\"o\">.</span><span class=\"n\">info</span><span class=\"p\">(</span><span class=\"s2\">&quot;FilterDellyCalls: We will filter the given VCF file now.&quot;</span><span class=\"p\">)</span>\n    <span class=\"c1\"># Make a string of all the variables</span>\n    <span class=\"n\">thresholdVariablesList</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"n\">svlength</span><span class=\"p\">,</span>\n                              <span class=\"n\">mapq</span><span class=\"p\">,</span>\n                              <span class=\"n\">mapqHotspot</span><span class=\"p\">,</span>\n                              <span class=\"n\">caseAltFreqHotspot</span><span class=\"p\">,</span>\n                              <span class=\"n\">caseTotalCountHotspot</span><span class=\"p\">,</span>\n                              <span class=\"n\">controlAltFreqHotspot</span><span class=\"p\">,</span>\n                              <span class=\"n\">caseAltFreq</span><span class=\"p\">,</span>\n                              <span class=\"n\">caseTotalCount</span><span class=\"p\">,</span>\n                              <span class=\"n\">controlAltFreq</span><span class=\"p\">,</span>\n                              <span class=\"n\">peSupport</span><span class=\"p\">,</span>\n                              <span class=\"n\">srSupport</span><span class=\"p\">,</span>\n                              <span class=\"n\">peSupportHotspot</span><span class=\"p\">,</span>\n                              <span class=\"n\">srSupportHotspot</span><span class=\"p\">,</span>\n                              <span class=\"n\">peSupportCase</span><span class=\"p\">,</span>\n                              <span class=\"n\">srSupportCase</span><span class=\"p\">,</span>\n                              <span class=\"n\">peSupportHotspotCase</span><span class=\"p\">,</span>\n                              <span class=\"n\">srSupportHotspotCase</span><span class=\"p\">,</span>\n                              <span class=\"n\">peSupportControl</span><span class=\"p\">,</span>\n                              <span class=\"n\">srSupportControl</span><span class=\"p\">,</span>\n                              <span class=\"n\">peSupportHotspotControl</span><span class=\"p\">,</span>\n                              <span class=\"n\">srSupportHotspotControl</span><span class=\"p\">]</span>\n    <span class=\"n\">thresholdVariables</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;,&quot;</span><span class=\"o\">.</span><span class=\"n\">join</span><span class=\"p\">(</span><span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">v</span><span class=\"p\">)</span> <span class=\"k\">for</span> <span class=\"n\">v</span> <span class=\"ow\">in</span> <span class=\"n\">thresholdVariablesList</span><span class=\"p\">)</span>\n\n    <span class=\"n\">hotspotDict</span> <span class=\"o\">=</span> <span class=\"n\">chl</span><span class=\"o\">.</span><span class=\"n\">ReadHotSpotFile</span><span class=\"p\">(</span><span class=\"n\">hotspotFile</span><span class=\"p\">)</span>\n    <span class=\"n\">blacklist</span> <span class=\"o\">=</span> <span class=\"n\">cbl</span><span class=\"o\">.</span><span class=\"n\">ReadBlackListFile</span><span class=\"p\">(</span><span class=\"n\">blacklistFile</span><span class=\"p\">)</span>\n    <span class=\"n\">outputVcf</span> <span class=\"o\">=</span> <span class=\"n\">os</span><span class=\"o\">.</span><span class=\"n\">path</span><span class=\"o\">.</span><span class=\"n\">splitext</span><span class=\"p\">(</span><span class=\"n\">os</span><span class=\"o\">.</span><span class=\"n\">path</span><span class=\"o\">.</span><span class=\"n\">basename</span><span class=\"p\">(</span><span class=\"n\">inputVcf</span><span class=\"p\">))[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">+</span> <span class=\"s2\">&quot;_filtered.vcf&quot;</span>\n    <span class=\"n\">outputFile</span> <span class=\"o\">=</span> <span class=\"n\">os</span><span class=\"o\">.</span><span class=\"n\">path</span><span class=\"o\">.</span><span class=\"n\">join</span><span class=\"p\">(</span><span class=\"n\">outputDir</span><span class=\"p\">,</span> <span class=\"n\">outputVcf</span><span class=\"p\">)</span>\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"ow\">not</span> <span class=\"n\">os</span><span class=\"o\">.</span><span class=\"n\">path</span><span class=\"o\">.</span><span class=\"n\">isfile</span><span class=\"p\">(</span><span class=\"n\">inputVcf</span><span class=\"p\">)):</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">verbose</span><span class=\"p\">):</span>\n            <span class=\"n\">logger</span><span class=\"o\">.</span><span class=\"n\">warning</span><span class=\"p\">(</span><span class=\"s2\">&quot;VCF file </span><span class=\"si\">%s</span><span class=\"s2\"> does not exists.&quot;</span><span class=\"p\">,</span> <span class=\"n\">inputVcf</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">outputFile</span><span class=\"p\">)</span>\n    <span class=\"n\">vcf_reader</span> <span class=\"o\">=</span> <span class=\"n\">vcf</span><span class=\"o\">.</span><span class=\"n\">Reader</span><span class=\"p\">(</span><span class=\"nb\">open</span><span class=\"p\">(</span><span class=\"n\">inputVcf</span><span class=\"p\">,</span> <span class=\"s1\">&#39;r&#39;</span><span class=\"p\">))</span>\n    <span class=\"n\">vcf_writer</span> <span class=\"o\">=</span> <span class=\"n\">vcf</span><span class=\"o\">.</span><span class=\"n\">Writer</span><span class=\"p\">(</span><span class=\"nb\">open</span><span class=\"p\">(</span><span class=\"n\">outputFile</span><span class=\"p\">,</span> <span class=\"s1\">&#39;w&#39;</span><span class=\"p\">),</span> <span class=\"n\">vcf_reader</span><span class=\"p\">)</span>\n    <span class=\"n\">samples</span> <span class=\"o\">=</span> <span class=\"n\">vcf_reader</span><span class=\"o\">.</span><span class=\"n\">samples</span>\n    <span class=\"n\">pattern</span> <span class=\"o\">=</span> <span class=\"n\">re</span><span class=\"o\">.</span><span class=\"n\">compile</span><span class=\"p\">(</span><span class=\"n\">caseID</span><span class=\"p\">)</span>\n    <span class=\"c1\"># Get the case and control id</span>\n    <span class=\"n\">caseIDinVcf</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n    <span class=\"n\">controlIDinVcf</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n    <span class=\"k\">for</span> <span class=\"n\">sample</span> <span class=\"ow\">in</span> <span class=\"n\">samples</span><span class=\"p\">:</span>\n        <span class=\"n\">match</span> <span class=\"o\">=</span> <span class=\"n\">re</span><span class=\"o\">.</span><span class=\"n\">search</span><span class=\"p\">(</span><span class=\"n\">pattern</span><span class=\"p\">,</span> <span class=\"n\">sample</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">match</span><span class=\"p\">):</span>\n            <span class=\"n\">caseIDinVcf</span> <span class=\"o\">=</span> <span class=\"n\">sample</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">controlIDinVcf</span> <span class=\"o\">=</span> <span class=\"n\">sample</span>\n    <span class=\"c1\"># Check if ID are assigned properly or not</span>\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">caseIDinVcf</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">logger</span><span class=\"o\">.</span><span class=\"n\">error</span><span class=\"p\">(</span><span class=\"s2\">&quot;FilterDellyCalls: caseID was not assigned properly, please make sure that the vcf case id and the provided case id match&quot;</span><span class=\"p\">)</span>\n        <span class=\"n\">sys</span><span class=\"o\">.</span><span class=\"n\">exit</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">)</span>\n    <span class=\"k\">else</span><span class=\"p\">:</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">verbose</span><span class=\"p\">):</span>\n            <span class=\"n\">logger</span><span class=\"o\">.</span><span class=\"n\">info</span><span class=\"p\">(</span><span class=\"s2\">&quot;FilterDellyCalls:Case ID is: </span><span class=\"si\">%s</span><span class=\"s2\"> file&quot;</span><span class=\"p\">,</span> <span class=\"n\">caseIDinVcf</span><span class=\"p\">)</span>\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">controlIDinVcf</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">logger</span><span class=\"o\">.</span><span class=\"n\">error</span><span class=\"p\">(</span><span class=\"s2\">&quot;FilterDellyCalls: controlID was not assigned properly, please make sure that the vcf control id and the provided control id match&quot;</span><span class=\"p\">)</span>\n        <span class=\"n\">sys</span><span class=\"o\">.</span><span class=\"n\">exit</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">)</span>\n    <span class=\"k\">else</span><span class=\"p\">:</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">verbose</span><span class=\"p\">):</span>\n            <span class=\"n\">logger</span><span class=\"o\">.</span><span class=\"n\">info</span><span class=\"p\">(</span><span class=\"s2\">&quot;FilterDellyCalls:Control ID is: </span><span class=\"si\">%s</span><span class=\"s2\"> file&quot;</span><span class=\"p\">,</span> <span class=\"n\">controlIDinVcf</span><span class=\"p\">)</span>\n    \n    <span class=\"c1\"># Traversing the VCF</span>\n    <span class=\"k\">for</span> <span class=\"n\">record</span> <span class=\"ow\">in</span> <span class=\"n\">vcf_reader</span><span class=\"p\">:</span>\n        <span class=\"c1\"># Define all variables:</span>\n        <span class=\"p\">(</span><span class=\"n\">chrom1</span><span class=\"p\">,</span>\n         <span class=\"n\">start1</span><span class=\"p\">,</span>\n         <span class=\"n\">start2</span><span class=\"p\">,</span>\n         <span class=\"n\">chrom2</span><span class=\"p\">,</span>\n         <span class=\"nb\">filter</span><span class=\"p\">,</span>\n         <span class=\"n\">svlengthFromDelly</span><span class=\"p\">,</span>\n         <span class=\"n\">mapqFromDelly</span><span class=\"p\">,</span>\n         <span class=\"n\">svtype</span><span class=\"p\">,</span>\n         <span class=\"n\">preciseFlag</span><span class=\"p\">,</span>\n         <span class=\"n\">peSupportFromDelly</span><span class=\"p\">,</span>\n         <span class=\"n\">srSupportFromDelly</span><span class=\"p\">,</span>\n         <span class=\"n\">contype</span><span class=\"p\">,</span>\n         <span class=\"n\">caseDR</span><span class=\"p\">,</span>\n         <span class=\"n\">caseDV</span><span class=\"p\">,</span>\n         <span class=\"n\">caseRR</span><span class=\"p\">,</span>\n         <span class=\"n\">caseRV</span><span class=\"p\">,</span>\n         <span class=\"n\">caseFT</span><span class=\"p\">,</span>\n         <span class=\"n\">controlDR</span><span class=\"p\">,</span>\n         <span class=\"n\">controlDV</span><span class=\"p\">,</span>\n         <span class=\"n\">controlRR</span><span class=\"p\">,</span>\n         <span class=\"n\">controlRV</span><span class=\"p\">,</span>\n         <span class=\"n\">controlFT</span><span class=\"p\">)</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"kc\">None</span> <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">22</span><span class=\"p\">))</span>\n        <span class=\"n\">chrom1</span> <span class=\"o\">=</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">CHROM</span>\n        <span class=\"n\">start1</span> <span class=\"o\">=</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">POS</span>\n        <span class=\"nb\">filter</span> <span class=\"o\">=</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">FILTER</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"nb\">filter</span><span class=\"p\">)</span> <span class=\"o\">&lt;</span> <span class=\"mi\">1</span><span class=\"p\">):</span>\n            <span class=\"nb\">filter</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;PASS&quot;</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"nb\">filter</span> <span class=\"o\">=</span> <span class=\"nb\">filter</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"n\">preciseFlag</span> <span class=\"o\">=</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">is_sv_precise</span>\n        <span class=\"c1\"># print &quot;Precise:&quot;,preciseFlag,&quot;:&quot;,type(preciseFlag)</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"s2\">&quot;END&quot;</span> <span class=\"ow\">in</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">INFO</span><span class=\"p\">):</span>\n            <span class=\"n\">start2</span> <span class=\"o\">=</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">INFO</span><span class=\"p\">[</span><span class=\"s1\">&#39;END&#39;</span><span class=\"p\">]</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"s2\">&quot;CHR2&quot;</span> <span class=\"ow\">in</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">INFO</span><span class=\"p\">):</span>\n            <span class=\"n\">chrom2</span> <span class=\"o\">=</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">INFO</span><span class=\"p\">[</span><span class=\"s1\">&#39;CHR2&#39;</span><span class=\"p\">]</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"s2\">&quot;SVTYPE&quot;</span> <span class=\"ow\">in</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">INFO</span><span class=\"p\">):</span>\n            <span class=\"n\">svtype</span> <span class=\"o\">=</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">INFO</span><span class=\"p\">[</span><span class=\"s1\">&#39;SVTYPE&#39;</span><span class=\"p\">]</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"s2\">&quot;SVLEN&quot;</span> <span class=\"ow\">in</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">INFO</span><span class=\"p\">):</span>\n            <span class=\"n\">svlengthFromDelly</span> <span class=\"o\">=</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">INFO</span><span class=\"p\">[</span><span class=\"s1\">&#39;SVLEN&#39;</span><span class=\"p\">]</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">svtype</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;TRA&quot;</span><span class=\"p\">):</span>\n                <span class=\"n\">svlengthFromDelly</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"n\">svlengthFromDelly</span> <span class=\"o\">=</span> <span class=\"nb\">abs</span><span class=\"p\">(</span><span class=\"n\">start2</span> <span class=\"o\">-</span> <span class=\"n\">start1</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"s2\">&quot;MAPQ&quot;</span> <span class=\"ow\">in</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">INFO</span><span class=\"p\">):</span>\n            <span class=\"n\">mapqFromDelly</span> <span class=\"o\">=</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">INFO</span><span class=\"p\">[</span><span class=\"s1\">&#39;MAPQ&#39;</span><span class=\"p\">]</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"s2\">&quot;PE&quot;</span> <span class=\"ow\">in</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">INFO</span><span class=\"p\">):</span>\n            <span class=\"n\">peSupportFromDelly</span> <span class=\"o\">=</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">INFO</span><span class=\"p\">[</span><span class=\"s1\">&#39;PE&#39;</span><span class=\"p\">]</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"s2\">&quot;SR&quot;</span> <span class=\"ow\">in</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">INFO</span><span class=\"p\">):</span>\n            <span class=\"n\">srSupportFromDelly</span> <span class=\"o\">=</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">INFO</span><span class=\"p\">[</span><span class=\"s1\">&#39;SR&#39;</span><span class=\"p\">]</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"s2\">&quot;CT&quot;</span> <span class=\"ow\">in</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">INFO</span><span class=\"p\">):</span>\n            <span class=\"n\">contype</span> <span class=\"o\">=</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">INFO</span><span class=\"p\">[</span><span class=\"s1\">&#39;CT&#39;</span><span class=\"p\">]</span>\n        <span class=\"n\">caseCalls</span> <span class=\"o\">=</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">genotype</span><span class=\"p\">(</span><span class=\"n\">caseIDinVcf</span><span class=\"p\">)</span>\n        <span class=\"n\">controlCalls</span> <span class=\"o\">=</span> <span class=\"n\">record</span><span class=\"o\">.</span><span class=\"n\">genotype</span><span class=\"p\">(</span><span class=\"n\">controlIDinVcf</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"n\">caseCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"p\">,</span> <span class=\"s2\">&quot;FT&quot;</span><span class=\"p\">)):</span>\n            <span class=\"n\">caseFT</span> <span class=\"o\">=</span> <span class=\"n\">caseCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"o\">.</span><span class=\"n\">FT</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"n\">caseCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"p\">,</span> <span class=\"s2\">&quot;DR&quot;</span><span class=\"p\">)):</span>\n            <span class=\"n\">caseDR</span> <span class=\"o\">=</span> <span class=\"n\">caseCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"o\">.</span><span class=\"n\">DR</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"n\">caseCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"p\">,</span> <span class=\"s2\">&quot;DV&quot;</span><span class=\"p\">)):</span>\n            <span class=\"n\">caseDV</span> <span class=\"o\">=</span> <span class=\"n\">caseCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"o\">.</span><span class=\"n\">DV</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"n\">caseCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"p\">,</span> <span class=\"s2\">&quot;RR&quot;</span><span class=\"p\">)):</span>\n            <span class=\"n\">caseRR</span> <span class=\"o\">=</span> <span class=\"n\">caseCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"o\">.</span><span class=\"n\">RR</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"n\">caseCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"p\">,</span> <span class=\"s2\">&quot;RV&quot;</span><span class=\"p\">)):</span>\n            <span class=\"n\">caseRV</span> <span class=\"o\">=</span> <span class=\"n\">caseCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"o\">.</span><span class=\"n\">RV</span>\n\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"n\">controlCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"p\">,</span> <span class=\"s2\">&quot;FT&quot;</span><span class=\"p\">)):</span>\n            <span class=\"n\">controlFT</span> <span class=\"o\">=</span> <span class=\"n\">controlCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"o\">.</span><span class=\"n\">FT</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"n\">controlCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"p\">,</span> <span class=\"s2\">&quot;DR&quot;</span><span class=\"p\">)):</span>\n            <span class=\"n\">controlDR</span> <span class=\"o\">=</span> <span class=\"n\">controlCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"o\">.</span><span class=\"n\">DR</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"n\">controlCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"p\">,</span> <span class=\"s2\">&quot;DV&quot;</span><span class=\"p\">)):</span>\n            <span class=\"n\">controlDV</span> <span class=\"o\">=</span> <span class=\"n\">controlCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"o\">.</span><span class=\"n\">DV</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"n\">controlCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"p\">,</span> <span class=\"s2\">&quot;RR&quot;</span><span class=\"p\">)):</span>\n            <span class=\"n\">controlRR</span> <span class=\"o\">=</span> <span class=\"n\">controlCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"o\">.</span><span class=\"n\">RR</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"n\">controlCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"p\">,</span> <span class=\"s2\">&quot;RV&quot;</span><span class=\"p\">)):</span>\n            <span class=\"n\">controlRV</span> <span class=\"o\">=</span> <span class=\"n\">controlCalls</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"o\">.</span><span class=\"n\">RV</span>\n        <span class=\"c1\"># Make a string of all the variables</span>\n        <span class=\"n\">dellyVariablesList</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"n\">chrom1</span><span class=\"p\">,</span>\n                              <span class=\"n\">start1</span><span class=\"p\">,</span>\n                              <span class=\"n\">start2</span><span class=\"p\">,</span>\n                              <span class=\"n\">chrom2</span><span class=\"p\">,</span>\n                              <span class=\"nb\">filter</span><span class=\"p\">,</span>\n                              <span class=\"n\">svlengthFromDelly</span><span class=\"p\">,</span>\n                              <span class=\"n\">mapqFromDelly</span><span class=\"p\">,</span>\n                              <span class=\"n\">svtype</span><span class=\"p\">,</span>\n                              <span class=\"n\">preciseFlag</span><span class=\"p\">,</span>\n                              <span class=\"n\">peSupportFromDelly</span><span class=\"p\">,</span>\n                              <span class=\"n\">srSupportFromDelly</span><span class=\"p\">,</span>\n                              <span class=\"n\">contype</span><span class=\"p\">,</span>\n                              <span class=\"n\">caseFT</span><span class=\"p\">,</span>\n                              <span class=\"n\">caseDR</span><span class=\"p\">,</span>\n                              <span class=\"n\">caseDV</span><span class=\"p\">,</span>\n                              <span class=\"n\">caseRR</span><span class=\"p\">,</span>\n                              <span class=\"n\">caseRV</span><span class=\"p\">,</span>\n                              <span class=\"n\">controlFT</span><span class=\"p\">,</span>\n                              <span class=\"n\">controlDR</span><span class=\"p\">,</span>\n                              <span class=\"n\">controlDV</span><span class=\"p\">,</span>\n                              <span class=\"n\">controlRR</span><span class=\"p\">,</span>\n                              <span class=\"n\">controlRV</span><span class=\"p\">]</span>\n        <span class=\"n\">dellyVariables</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;,&quot;</span><span class=\"o\">.</span><span class=\"n\">join</span><span class=\"p\">(</span><span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">v</span><span class=\"p\">)</span> <span class=\"k\">for</span> <span class=\"n\">v</span> <span class=\"ow\">in</span> <span class=\"n\">dellyVariablesList</span><span class=\"p\">)</span>\n        <span class=\"c1\"># print chrom1, start1, start2, chrom2, &quot;Coordinate&quot;</span>\n        <span class=\"c1\"># print svlengthFromDelly, mapqFromDelly, svtype, peSupportFromDelly, srSupportFromDelly, contype, &quot;Overall&quot;</span>\n        <span class=\"c1\"># print caseDR, caseDV, caseRR, caseRV, &quot;Case&quot;</span>\n        <span class=\"c1\"># print controlDR, controlDV, controlRR, controlRV, &quot;Control&quot;</span>\n        <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"n\">GetFilteredRecords</span><span class=\"p\">(</span><span class=\"n\">dellyVariables</span><span class=\"p\">,</span> <span class=\"n\">thresholdVariables</span><span class=\"p\">,</span> <span class=\"n\">hotspotDict</span><span class=\"p\">,</span> <span class=\"n\">blacklist</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">filterFlag</span><span class=\"p\">):</span>\n            <span class=\"c1\"># print &quot;Passs&quot;</span>\n            <span class=\"n\">vcf_writer</span><span class=\"o\">.</span><span class=\"n\">write_record</span><span class=\"p\">(</span><span class=\"n\">record</span><span class=\"p\">)</span>\n    <span class=\"n\">vcf_writer</span><span class=\"o\">.</span><span class=\"n\">close</span><span class=\"p\">()</span>\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">verbose</span><span class=\"p\">):</span>\n        <span class=\"n\">logger</span><span class=\"o\">.</span><span class=\"n\">info</span><span class=\"p\">(</span><span class=\"s2\">&quot;FilterDellyCalls: We have finished filtering: </span><span class=\"si\">%s</span><span class=\"s2\"> file&quot;</span><span class=\"p\">,</span> <span class=\"n\">inputVcf</span><span class=\"p\">)</span>\n        <span class=\"n\">logger</span><span class=\"o\">.</span><span class=\"n\">info</span><span class=\"p\">(</span><span class=\"s2\">&quot;FilterFellyCalls: Output hass been written in: </span><span class=\"si\">%s</span><span class=\"s2\"> file&quot;</span><span class=\"p\">,</span> <span class=\"n\">outputFile</span><span class=\"p\">)</span>\n    <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">outputFile</span><span class=\"p\">)</span></div>\n\n\n<div class=\"viewcode-block\" id=\"GetFilteredRecords\"><a class=\"viewcode-back\" href=\"../../../iCallSV/#iCallSV.FilterDellyCalls.GetFilteredRecords\">[docs]</a><span class=\"k\">def</span> <span class=\"nf\">GetFilteredRecords</span><span class=\"p\">(</span><span class=\"n\">dellyVarialbles</span><span class=\"p\">,</span> <span class=\"n\">thresholdVariables</span><span class=\"p\">,</span> <span class=\"n\">hotspotDict</span><span class=\"p\">,</span> <span class=\"n\">blacklist</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    This will ``Filter one record at a time``</span>\n\n<span class=\"sd\">    :param str dellyVariables: str having all delly variables separated by &quot;,&quot;</span>\n<span class=\"sd\">    :param str thresholdVariables: str having all delly threshold variables separated by &quot;,&quot;</span>\n<span class=\"sd\">    :param dict hotspotDict: A dict containing hotspot regions</span>\n<span class=\"sd\">    :param list blacklist: A list containing blacklist regions</span>\n<span class=\"sd\">    :return: A boolean tag indicating True or False</span>\n<span class=\"sd\">    :rtype: bool</span>\n\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    <span class=\"p\">(</span><span class=\"n\">svlength</span><span class=\"p\">,</span>\n     <span class=\"n\">mapq</span><span class=\"p\">,</span>\n     <span class=\"n\">mapqHotspot</span><span class=\"p\">,</span>\n     <span class=\"n\">caseAltFreqHotspot</span><span class=\"p\">,</span>\n     <span class=\"n\">caseTotalCountHotspot</span><span class=\"p\">,</span>\n     <span class=\"n\">controlAltFreqHotspot</span><span class=\"p\">,</span>\n     <span class=\"n\">caseAltFreq</span><span class=\"p\">,</span>\n     <span class=\"n\">caseTotalCount</span><span class=\"p\">,</span>\n     <span class=\"n\">controlAltFreq</span><span class=\"p\">,</span>\n     <span class=\"n\">peSupport</span><span class=\"p\">,</span>\n     <span class=\"n\">srSupport</span><span class=\"p\">,</span>\n     <span class=\"n\">peSupportHotspot</span><span class=\"p\">,</span>\n     <span class=\"n\">srSupportHotspot</span><span class=\"p\">,</span>\n     <span class=\"n\">peSupportCase</span><span class=\"p\">,</span>\n     <span class=\"n\">srSupportCase</span><span class=\"p\">,</span>\n     <span class=\"n\">peSupportHotspotCase</span><span class=\"p\">,</span>\n     <span class=\"n\">srSupportHotspotCase</span><span class=\"p\">,</span>\n     <span class=\"n\">peSupportControl</span><span class=\"p\">,</span>\n     <span class=\"n\">srSupportControl</span><span class=\"p\">,</span>\n     <span class=\"n\">peSupportHotspotControl</span><span class=\"p\">,</span>\n     <span class=\"n\">srSupportHotspotControl</span><span class=\"p\">)</span> <span class=\"o\">=</span> <span class=\"n\">thresholdVariables</span><span class=\"o\">.</span><span class=\"n\">split</span><span class=\"p\">(</span><span class=\"s2\">&quot;,&quot;</span><span class=\"p\">)</span>\n    <span class=\"p\">(</span><span class=\"n\">chrom1</span><span class=\"p\">,</span>\n     <span class=\"n\">start1</span><span class=\"p\">,</span>\n     <span class=\"n\">start2</span><span class=\"p\">,</span>\n     <span class=\"n\">chrom2</span><span class=\"p\">,</span>\n     <span class=\"nb\">filter</span><span class=\"p\">,</span>\n     <span class=\"n\">svlengthFromDelly</span><span class=\"p\">,</span>\n     <span class=\"n\">mapqFromDelly</span><span class=\"p\">,</span>\n     <span class=\"n\">svtype</span><span class=\"p\">,</span>\n     <span class=\"n\">preciseFlag</span><span class=\"p\">,</span>\n     <span class=\"n\">peSupportFromDelly</span><span class=\"p\">,</span>\n     <span class=\"n\">srSupportFromDelly</span><span class=\"p\">,</span>\n     <span class=\"n\">contype</span><span class=\"p\">,</span>\n     <span class=\"n\">caseFT</span><span class=\"p\">,</span>\n     <span class=\"n\">caseDR</span><span class=\"p\">,</span>\n     <span class=\"n\">caseDV</span><span class=\"p\">,</span>\n     <span class=\"n\">caseRR</span><span class=\"p\">,</span>\n     <span class=\"n\">caseRV</span><span class=\"p\">,</span>\n     <span class=\"n\">controlFT</span><span class=\"p\">,</span>\n     <span class=\"n\">controlDR</span><span class=\"p\">,</span>\n     <span class=\"n\">controlDV</span><span class=\"p\">,</span>\n     <span class=\"n\">controlRR</span><span class=\"p\">,</span>\n     <span class=\"n\">controlRV</span><span class=\"p\">)</span> <span class=\"o\">=</span> <span class=\"n\">dellyVarialbles</span><span class=\"o\">.</span><span class=\"n\">split</span><span class=\"p\">(</span><span class=\"s2\">&quot;,&quot;</span><span class=\"p\">)</span>\n    <span class=\"c1\"># print &quot;PreciseFlagInFilter:&quot;,preciseFlag,&quot;:&quot;,type(preciseFlag)</span>\n    <span class=\"c1\"># Get if its a hotspot or not</span>\n    <span class=\"n\">hotspotTag</span> <span class=\"o\">=</span> <span class=\"n\">chl</span><span class=\"o\">.</span><span class=\"n\">CheckIfItIsHotspot</span><span class=\"p\">(</span><span class=\"n\">chrom1</span><span class=\"p\">,</span> <span class=\"n\">start1</span><span class=\"p\">,</span> <span class=\"n\">chrom2</span><span class=\"p\">,</span> <span class=\"n\">start2</span><span class=\"p\">,</span> <span class=\"n\">hotspotDict</span><span class=\"p\">)</span>\n    <span class=\"c1\"># Get if its a blacklist or not</span>\n    <span class=\"n\">blacklistTag</span> <span class=\"o\">=</span> <span class=\"n\">cbl</span><span class=\"o\">.</span><span class=\"n\">CheckIfItIsBlacklisted</span><span class=\"p\">(</span><span class=\"n\">chrom1</span><span class=\"p\">,</span> <span class=\"n\">start1</span><span class=\"p\">,</span> <span class=\"n\">chrom2</span><span class=\"p\">,</span> <span class=\"n\">start2</span><span class=\"p\">,</span> <span class=\"n\">blacklist</span><span class=\"p\">,</span> <span class=\"mi\">20</span><span class=\"p\">)</span>\n    <span class=\"c1\"># Get the flag for pass and fail for tumor and normal</span>\n    <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n    <span class=\"c1\"># print &quot;CaseControlPassFlag:&quot;, casePassFlag, &quot; : &quot;, controlPassFlag</span>\n\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">hotspotTag</span><span class=\"p\">):</span>\n        <span class=\"n\">casePassFlag</span> <span class=\"o\">=</span> <span class=\"n\">GetCaseFlag</span><span class=\"p\">(</span>\n            <span class=\"n\">caseDR</span><span class=\"p\">,</span>\n            <span class=\"n\">caseDV</span><span class=\"p\">,</span>\n            <span class=\"n\">preciseFlag</span><span class=\"p\">,</span>\n            <span class=\"n\">caseRR</span><span class=\"p\">,</span>\n            <span class=\"n\">caseRV</span><span class=\"p\">,</span>\n            <span class=\"n\">caseAltFreqHotspot</span><span class=\"p\">,</span>\n            <span class=\"n\">caseTotalCountHotspot</span><span class=\"p\">)</span>\n        <span class=\"n\">controlPassFlag</span> <span class=\"o\">=</span> <span class=\"n\">GetControlFlag</span><span class=\"p\">(</span>\n            <span class=\"n\">controlDR</span><span class=\"p\">,</span>\n            <span class=\"n\">controlDV</span><span class=\"p\">,</span>\n            <span class=\"n\">preciseFlag</span><span class=\"p\">,</span>\n            <span class=\"n\">controlRR</span><span class=\"p\">,</span>\n            <span class=\"n\">controlRV</span><span class=\"p\">,</span>\n            <span class=\"n\">controlAltFreqHotspot</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"nb\">filter</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;PASS&quot;</span> <span class=\"ow\">and</span> <span class=\"n\">controlPassFlag</span> <span class=\"ow\">and</span> <span class=\"n\">casePassFlag</span><span class=\"p\">):</span>\n            <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">svlengthFromDelly</span> <span class=\"o\">!=</span> <span class=\"s2\">&quot;None&quot;</span><span class=\"p\">):</span>\n                <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">svlengthFromDelly</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">svlength</span><span class=\"p\">)):</span>\n                    <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n                    <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">filterFlag</span><span class=\"p\">)</span>\n                <span class=\"k\">else</span><span class=\"p\">:</span>\n                    <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n                <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">filterFlag</span><span class=\"p\">)</span>\n\n            <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">filterFlag</span> <span class=\"ow\">is</span> <span class=\"kc\">False</span><span class=\"p\">):</span>\n                <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">svlengthFromDelly</span> <span class=\"o\">!=</span> <span class=\"s2\">&quot;None&quot;</span><span class=\"p\">):</span>\n                    <span class=\"k\">if</span><span class=\"p\">((</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">svlengthFromDelly</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">svlength</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">mapqFromDelly</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">mapqHotspot</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">peSupportFromDelly</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">peSupportHotspot</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseDV</span><span class=\"p\">)</span> <span class=\"o\">&gt;</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">peSupportHotspotCase</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlDV</span><span class=\"p\">)</span> <span class=\"o\">&lt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">peSupportHotspotControl</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlDV</span><span class=\"p\">)</span> <span class=\"o\">&lt;</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseDV</span><span class=\"p\">))):</span>\n                        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">preciseFlag</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;True&quot;</span><span class=\"p\">):</span>\n                            <span class=\"k\">if</span><span class=\"p\">((</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">srSupportFromDelly</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">srSupportHotspot</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseRV</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">srSupportHotspotCase</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlRV</span><span class=\"p\">)</span> <span class=\"o\">&lt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">srSupportHotspotControl</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlRV</span><span class=\"p\">)</span> <span class=\"o\">&lt;</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseRV</span><span class=\"p\">))):</span>\n                                <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n                                <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">filterFlag</span><span class=\"p\">)</span>\n                            <span class=\"k\">else</span><span class=\"p\">:</span>\n                                <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n                        <span class=\"k\">else</span><span class=\"p\">:</span>\n                            <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n                            <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">filterFlag</span><span class=\"p\">)</span>\n                    <span class=\"k\">else</span><span class=\"p\">:</span>\n                        <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n                <span class=\"k\">else</span><span class=\"p\">:</span>\n                    <span class=\"k\">if</span><span class=\"p\">((</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">mapqFromDelly</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">mapqHotspot</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">peSupportFromDelly</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">peSupportHotspot</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseDV</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">peSupportHotspotCase</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlDV</span><span class=\"p\">)</span> <span class=\"o\">&lt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">peSupportHotspotControl</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlDV</span><span class=\"p\">)</span> <span class=\"o\">&lt;</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseDV</span><span class=\"p\">))):</span>\n                        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">preciseFlag</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;True&quot;</span><span class=\"p\">):</span>\n                            <span class=\"k\">if</span><span class=\"p\">((</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">srSupportFromDelly</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">srSupportHotspot</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseRV</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">srSupportHotspotCase</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlRV</span><span class=\"p\">)</span> <span class=\"o\">&lt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">srSupportHotspotControl</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlRV</span><span class=\"p\">)</span> <span class=\"o\">&lt;</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseRV</span><span class=\"p\">))):</span>\n                                <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n                                <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">filterFlag</span><span class=\"p\">)</span>\n                            <span class=\"k\">else</span><span class=\"p\">:</span>\n                                <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n                        <span class=\"k\">else</span><span class=\"p\">:</span>\n                            <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n                            <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">filterFlag</span><span class=\"p\">)</span>\n                    <span class=\"k\">else</span><span class=\"p\">:</span>\n                        <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n    <span class=\"k\">else</span><span class=\"p\">:</span>\n        <span class=\"n\">casePassFlag</span> <span class=\"o\">=</span> <span class=\"n\">GetCaseFlag</span><span class=\"p\">(</span><span class=\"n\">caseDR</span><span class=\"p\">,</span> <span class=\"n\">caseDV</span><span class=\"p\">,</span> <span class=\"n\">preciseFlag</span><span class=\"p\">,</span> <span class=\"n\">caseRR</span><span class=\"p\">,</span>\n                                   <span class=\"n\">caseRV</span><span class=\"p\">,</span> <span class=\"n\">caseAltFreq</span><span class=\"p\">,</span> <span class=\"n\">caseTotalCount</span><span class=\"p\">)</span>\n        <span class=\"n\">controlPassFlag</span> <span class=\"o\">=</span> <span class=\"n\">GetControlFlag</span><span class=\"p\">(</span>\n            <span class=\"n\">controlDR</span><span class=\"p\">,</span>\n            <span class=\"n\">controlDV</span><span class=\"p\">,</span>\n            <span class=\"n\">preciseFlag</span><span class=\"p\">,</span>\n            <span class=\"n\">controlRR</span><span class=\"p\">,</span>\n            <span class=\"n\">controlRV</span><span class=\"p\">,</span>\n            <span class=\"n\">controlAltFreq</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"nb\">filter</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;PASS&quot;</span> <span class=\"ow\">and</span> <span class=\"n\">controlPassFlag</span> <span class=\"ow\">and</span> <span class=\"n\">casePassFlag</span><span class=\"p\">):</span>\n            <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">svlengthFromDelly</span> <span class=\"o\">!=</span> <span class=\"s2\">&quot;None&quot;</span><span class=\"p\">):</span>\n                <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">svlengthFromDelly</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">svlength</span><span class=\"p\">)):</span>\n                    <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n                    <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">filterFlag</span><span class=\"p\">)</span>\n                <span class=\"k\">else</span><span class=\"p\">:</span>\n                    <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n                <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">filterFlag</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">filterFlag</span> <span class=\"ow\">is</span> <span class=\"kc\">False</span><span class=\"p\">):</span>\n            <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">svlengthFromDelly</span> <span class=\"o\">!=</span> <span class=\"s2\">&quot;None&quot;</span><span class=\"p\">):</span>\n                <span class=\"c1\"># print svlengthFromDelly, svlength, mapqFromDelly, mapq,</span>\n                <span class=\"c1\"># peSupportFromDelly, peSupport, caseDV, peSupportCase, controlDV,</span>\n                <span class=\"c1\"># peSupportControl</span>\n                <span class=\"k\">if</span><span class=\"p\">((</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">svlengthFromDelly</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">svlength</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">mapqFromDelly</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">mapq</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">peSupportFromDelly</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">peSupport</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseDV</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">peSupportCase</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlDV</span><span class=\"p\">)</span> <span class=\"o\">&lt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">peSupportControl</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlDV</span><span class=\"p\">)</span> <span class=\"o\">&lt;</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseDV</span><span class=\"p\">))):</span>\n                    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">preciseFlag</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;True&quot;</span><span class=\"p\">):</span>\n                        <span class=\"k\">if</span><span class=\"p\">((</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">srSupportFromDelly</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">srSupport</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseRV</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">srSupportCase</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlRV</span><span class=\"p\">)</span> <span class=\"o\">&lt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">srSupportControl</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlRV</span><span class=\"p\">)</span> <span class=\"o\">&lt;</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseRV</span><span class=\"p\">))):</span>\n                            <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n                            <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">filterFlag</span><span class=\"p\">)</span>\n                        <span class=\"k\">else</span><span class=\"p\">:</span>\n                            <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n                    <span class=\"k\">else</span><span class=\"p\">:</span>\n                        <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n                        <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">filterFlag</span><span class=\"p\">)</span>\n                <span class=\"k\">else</span><span class=\"p\">:</span>\n                    <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"k\">if</span><span class=\"p\">((</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">mapqFromDelly</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">mapq</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">peSupportFromDelly</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">peSupport</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseDV</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">peSupportCase</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlDV</span><span class=\"p\">)</span> <span class=\"o\">&lt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">peSupportControl</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlDV</span><span class=\"p\">)</span> <span class=\"o\">&lt;</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseDV</span><span class=\"p\">))):</span>\n                    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">preciseFlag</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;True&quot;</span><span class=\"p\">):</span>\n                        <span class=\"k\">if</span><span class=\"p\">((</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">srSupportFromDelly</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">srSupport</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseRV</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">srSupportCase</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlRV</span><span class=\"p\">)</span> <span class=\"o\">&lt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">srSupportControl</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlRV</span><span class=\"p\">)</span> <span class=\"o\">&lt;</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseRV</span><span class=\"p\">))):</span>\n                            <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n                            <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">filterFlag</span><span class=\"p\">)</span>\n                        <span class=\"k\">else</span><span class=\"p\">:</span>\n                            <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n                    <span class=\"k\">else</span><span class=\"p\">:</span>\n                        <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n                        <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">filterFlag</span><span class=\"p\">)</span>\n                <span class=\"k\">else</span><span class=\"p\">:</span>\n                    <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n\n        <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">blacklistTag</span><span class=\"p\">):</span>\n            <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n            <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">filterFlag</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">filterFlag</span> <span class=\"o\">=</span> <span class=\"n\">filterFlag</span></div>\n\n    <span class=\"c1\"># return(filterFlag)</span>\n\n\n<div class=\"viewcode-block\" id=\"GetCaseFlag\"><a class=\"viewcode-back\" href=\"../../../iCallSV/#iCallSV.FilterDellyCalls.GetCaseFlag\">[docs]</a><span class=\"k\">def</span> <span class=\"nf\">GetCaseFlag</span><span class=\"p\">(</span><span class=\"n\">caseDR</span><span class=\"p\">,</span> <span class=\"n\">caseDV</span><span class=\"p\">,</span> <span class=\"n\">preciseFlag</span><span class=\"p\">,</span> <span class=\"n\">caseRR</span><span class=\"p\">,</span> <span class=\"n\">caseRV</span><span class=\"p\">,</span> <span class=\"n\">caseAltFreq</span><span class=\"p\">,</span> <span class=\"n\">caseTotalCount</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    This will ``check if the case sample passes or not``</span>\n\n<span class=\"sd\">    :param int caseDR: int representing number of reference reads for case reported by delly</span>\n<span class=\"sd\">    :param int caseDV: int representing number of variant reads for case reported by delly</span>\n<span class=\"sd\">    :param str preciseFlag: str representing if an event is precise or imprecise</span>\n<span class=\"sd\">    :param int caseRR: int representing number of split reference reads for case reported by delly</span>\n<span class=\"sd\">    :param int caseRV: int representing number of split variant reads for case reported by delly</span>\n<span class=\"sd\">    :param float caseAltFreq: float representing altratio threshold for case</span>\n<span class=\"sd\">    :param int caseTotalCount: int repeseting readcount threshold for case</span>\n<span class=\"sd\">    :return: A boolean tag indicating True or False</span>\n<span class=\"sd\">    :rtype: bool</span>\n\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    <span class=\"n\">caseAltAf</span> <span class=\"o\">=</span> <span class=\"mf\">0.0</span>\n    <span class=\"n\">caseCovg</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"n\">caseFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">caseDR</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">caseDR</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">caseDV</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">caseDV</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">caseRR</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">caseRR</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">caseRV</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">caseRR</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">preciseFlag</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;True&quot;</span><span class=\"p\">):</span>\n        <span class=\"n\">caseCovg</span> <span class=\"o\">=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseRR</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseRV</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span><span class=\"p\">((</span><span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">caseRR</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"mf\">0.0</span><span class=\"p\">)</span> <span class=\"ow\">or</span> <span class=\"p\">(</span><span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">caseRV</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"mf\">0.0</span><span class=\"p\">)):</span>\n            <span class=\"n\">caseAltAf</span> <span class=\"o\">=</span> <span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">caseRV</span><span class=\"p\">)</span> <span class=\"o\">/</span> <span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseRR</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseRV</span><span class=\"p\">))</span>\n\n    <span class=\"k\">else</span><span class=\"p\">:</span>\n        <span class=\"n\">caseCovg</span> <span class=\"o\">=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseDR</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseDV</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span><span class=\"p\">((</span><span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">caseDR</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"mf\">0.0</span><span class=\"p\">)</span> <span class=\"ow\">or</span> <span class=\"p\">(</span><span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">caseDV</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"mf\">0.0</span><span class=\"p\">)):</span>\n            <span class=\"n\">caseAltAf</span> <span class=\"o\">=</span> <span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">caseDV</span><span class=\"p\">)</span> <span class=\"o\">/</span> <span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseDR</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseDV</span><span class=\"p\">))</span>\n\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">caseAltAf</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">caseAltFreq</span><span class=\"p\">)</span> <span class=\"ow\">and</span> <span class=\"n\">caseCovg</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseTotalCount</span><span class=\"p\">)):</span>\n        <span class=\"n\">caseFlag</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n    <span class=\"k\">elif</span><span class=\"p\">((</span><span class=\"n\">preciseFlag</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;True&quot;</span><span class=\"p\">)</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"n\">caseRV</span> <span class=\"o\">&gt;=</span> <span class=\"mi\">5</span><span class=\"p\">)</span> <span class=\"ow\">and</span> <span class=\"p\">(</span><span class=\"n\">caseCovg</span> <span class=\"o\">&gt;=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">caseTotalCount</span><span class=\"p\">))):</span>\n        <span class=\"n\">caseFlag</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n    <span class=\"k\">else</span><span class=\"p\">:</span>\n        <span class=\"n\">caseFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n    <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">caseFlag</span><span class=\"p\">)</span></div>\n\n\n<div class=\"viewcode-block\" id=\"GetControlFlag\"><a class=\"viewcode-back\" href=\"../../../iCallSV/#iCallSV.FilterDellyCalls.GetControlFlag\">[docs]</a><span class=\"k\">def</span> <span class=\"nf\">GetControlFlag</span><span class=\"p\">(</span><span class=\"n\">controlDR</span><span class=\"p\">,</span> <span class=\"n\">controlDV</span><span class=\"p\">,</span> <span class=\"n\">preciseFlag</span><span class=\"p\">,</span> <span class=\"n\">controlRR</span><span class=\"p\">,</span> <span class=\"n\">controlRV</span><span class=\"p\">,</span> <span class=\"n\">controlAltFreq</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    This will ``check if the control sample passes or not``</span>\n\n<span class=\"sd\">    :param int controlDR: int representing number of reference reads for control reported by delly</span>\n<span class=\"sd\">    :param int controlDV: int representing number of variant reads for control reported by delly</span>\n<span class=\"sd\">    :param str preciseFlag: str representing if an event is precise or imprecise</span>\n<span class=\"sd\">    :param int controlRR: int representing number of split reference reads for control reported by delly</span>\n<span class=\"sd\">    :param int controlRV: int representing number of split variant reads for control reported by delly</span>\n<span class=\"sd\">    :param float controlAltFreq: float representing altratio threshold for control</span>\n<span class=\"sd\">    :return: A boolean tag indicating True or False</span>\n<span class=\"sd\">    :rtype: bool</span>\n\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    <span class=\"n\">controlAltAf</span> <span class=\"o\">=</span> <span class=\"mf\">0.0</span>\n    <span class=\"n\">controlCovg</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"n\">controlFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">controlDR</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">controlDR</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">controlDV</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">controlDV</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">controlRR</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">controlRR</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">controlRV</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">controlRR</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">preciseFlag</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;True&quot;</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span><span class=\"p\">((</span><span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">controlRR</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"mf\">0.0</span><span class=\"p\">)</span> <span class=\"ow\">or</span> <span class=\"p\">(</span><span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">controlRV</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"mf\">0.0</span><span class=\"p\">)):</span>\n            <span class=\"n\">controlAltAf</span> <span class=\"o\">=</span> <span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">controlRV</span><span class=\"p\">)</span> <span class=\"o\">/</span> <span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlRR</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlRV</span><span class=\"p\">))</span>\n\n    <span class=\"k\">else</span><span class=\"p\">:</span>\n        <span class=\"k\">if</span><span class=\"p\">((</span><span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">controlDR</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"mf\">0.0</span><span class=\"p\">)</span> <span class=\"ow\">or</span> <span class=\"p\">(</span><span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">controlDV</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"mf\">0.0</span><span class=\"p\">)):</span>\n            <span class=\"n\">controlAltAf</span> <span class=\"o\">=</span> <span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">controlDV</span><span class=\"p\">)</span> <span class=\"o\">/</span> <span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlDR</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">controlDV</span><span class=\"p\">))</span>\n\n    <span class=\"k\">if</span><span class=\"p\">(</span><span class=\"n\">controlAltAf</span> <span class=\"o\">&lt;=</span> <span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">controlAltFreq</span><span class=\"p\">)):</span>\n        <span class=\"n\">controlFlag</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n    <span class=\"k\">else</span><span class=\"p\">:</span>\n        <span class=\"n\">controlFlag</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n    <span class=\"k\">return</span><span class=\"p\">(</span><span class=\"n\">controlFlag</span><span class=\"p\">)</span></div>\n</pre></div>", "title": "iCallSV.FilterDellyCalls", "customsidebar": null, "current_page_name": "_modules/iCallSV/FilterDellyCalls", "sidebars": null, "parents": [{"link": "../../", "title": "Module code"}], "alabaster_version": "0.7.9"}