Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions calculate_enrichment_barcodes_z_test.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
##!/usr/bin/env python3.5
import csv

import os
import re
import sys
from difflib import ndiff
from difflib import SequenceMatcher
import numpy as np
from statsmodels.stats.proportion import proportions_ztest


#script to check for presence and count a set of barcodes in a file
#
#usage: calculate_enrichment_barcodes_z_test.py countfile countfile2

#outdir = sys.argv[1]

countfile = sys.argv[1]
countfile2 = sys.argv[2]

cont=0
#cont2=0

count_dict = dict([])
seq_dict= dict([])
Expand All @@ -31,7 +26,6 @@

with open(countfile,'r') as f:
for line in f:
#reader=csv.reader(line,delimiter='\t')
line1=line.split("\t")
seq=line1[1]
count=line1[0]
Expand All @@ -41,7 +35,6 @@
nobs2=0
with open(countfile2,'r') as f:
for line in f:
#reader=csv.reader(line,delimiter='\t')
line1=line.split("\t")
seq=line1[1]
count=line1[0]
Expand All @@ -59,14 +52,4 @@
# pval=str('{0:0.3f}'.format(pval))
print(str(seq)+"\t"+str(count)+"\t"+str(count2)+"\t"+str(nobs)+"\t"+str(nobs2)+"\t"+str(pval) )

#with open(filename,'r') as f:
# for line in f:
# seq=line
# seq=seq.strip('\n')
# seq_dict[seq]=seq
# print("count for seq "+ seq + " is "+count_dict[seq])
# if seq in count_dict:
# print(count_dict[seq]+"\t"+seq)
# else:
# print("0\t"+seq)
#