From 1c2ae5ffaf4ef454c31eb8cee6d5633b63a9e46b Mon Sep 17 00:00:00 2001 From: Luca Penso Dolfin Date: Tue, 8 Aug 2023 16:48:09 +0200 Subject: [PATCH] Update calculate_enrichment_barcodes_z_test.py --- calculate_enrichment_barcodes_z_test.py | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/calculate_enrichment_barcodes_z_test.py b/calculate_enrichment_barcodes_z_test.py index daf3c70..55cbdc9 100644 --- a/calculate_enrichment_barcodes_z_test.py +++ b/calculate_enrichment_barcodes_z_test.py @@ -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([]) @@ -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] @@ -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] @@ -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) -# +