Skip to content
Permalink
5a351ecf97
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
17 lines (16 sloc) 534 Bytes
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import os
import pandas as pd
import statsmodels.stats.multitest as mtest
dfs=[]
for fn in snakemake.input:
if os.stat(fn).st_size == 0:
continue
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)