Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added multiple testing correction and adjusted the config
  • Loading branch information
Martyna Gajos committed Apr 10, 2021
1 parent b324799 commit 5a351ec
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Scripts/filterPausing.py
Expand Up @@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
import os
import pandas as pd
import statsmodels.stats.multitest as mtest

dfs=[]
for fn in snakemake.input:
Expand All @@ -10,5 +11,7 @@
df=pd.read_csv(fn,delimiter='\t',header=None)
dfs.append(df)
df=pd.concat(dfs,sort=[0,1],ignore_index=True)
df[4]=1.-df[4]/100
df[4]=mtest.fdrcorrection(df[4])[1]
df.to_csv(snakemake.output[1],sep='\t',index=False,header=False)
df[df[4]>=snakemake.params[0]].to_csv(snakemake.output[0],sep='\t',index=False,header=False)
df[df[4]<snakemake.params[0]].to_csv(snakemake.output[0],sep='\t',index=False,header=False)
2 changes: 1 addition & 1 deletion Snakefile
Expand Up @@ -77,7 +77,7 @@ rule FilterPeaks:
"Results/Significant_{prefix}.bed",
"Results/All_{prefix}.bed"
params:
config["percentile"]
config["padj"]
script:
"Scripts/filterPausing.py"

Expand Down
8 changes: 5 additions & 3 deletions config.yaml
Expand Up @@ -26,10 +26,12 @@ window_size: 200
#minimal number of reads to call a peak
minimum_intensity: 5

#
#should reads with no supporting density in the window be included
include_spikes: FALSE

#number of redistributions of reads done to obtain the distribution of
#the expected maximum
bootstrap_N: 10000

#
percentile: 95
#adjusted pvalue required to report as significant
padj: 0.05

0 comments on commit 5a351ec

Please sign in to comment.