<commit_before>#! /usr/bin/env python3

import sys
import re

counters_re=re.compile(r"CS=([0-9]+),([0-9]+),([0-9]+),([0-9]+)")

# ../../ococo/ococo_debug_counters.py <(bcftools view ./exp.1.02__Borrelia__0.07-ococo/2_alignments.dyn/5_vcf/00000.vcf.gz ) <(samtools mpileup ./exp.1.01__Borrelia__0.07/2_alignments.dyn/3.2_sorted_bam/00000.bam)

if len(sys.argv)!=3:
	print()
	print("Usage: ococo_debug_counter.py infile.vcf infile.pileup");
	print()
	print("\tinfile.vcf     - output of ococo")
	print("\tinfile.pileup  - output of samtools mpileup")
	print()
	sys.exit(-1)

vcf_fn=sys.argv[1]
pileup_fn=sys.argv[2]

def next_vcf_rec(vcf_fo):
	vcf_line=None

	while vcf_line==None or vcf_line[0]=="#" or vcf_line.strip()=="":
		vcf_line=vcf_fo.readline()
		#print(vcf_line)
		if len(vcf_line)==0:
			return [None,None,(None,None,None,None)]

	parts=vcf_line.split("\t")
	ref=parts[0]
	pos=int(parts[1])
	rm=counters_re.match(parts[7])
	counters=(rm.group(1),rm.group(2),rm.group(3),rm.group(4))
	return [ref,pos,counters]

def next_pileup_rec(pileup_fo):
	pileup_line=None<commit_msg>Fix break from the main loop.<commit_after>#! /usr/bin/env python3

import sys
import re

counters_re=re.compile(r"CS=([0-9]+),([0-9]+),([0-9]+),([0-9]+)")

# ../../ococo/ococo_debug_counters.py <(bcftools view ./exp.1.02__Borrelia__0.07-ococo/2_alignments.dyn/5_vcf/00000.vcf.gz ) <(samtools mpileup ./exp.1.01__Borrelia__0.07/2_alignments.dyn/3.2_sorted_bam/00000.bam)

if len(sys.argv)!=3:
	print()
	print("Usage: ococo_debug_counter.py infile.vcf infile.pileup");
	print()
	print("\tinfile.vcf     - output of ococo")
	print("\tinfile.pileup  - output of samtools mpileup")
	print()
	sys.exit(-1)

vcf_fn=sys.argv[1]
pileup_fn=sys.argv[2]

def next_vcf_rec(vcf_fo):
	vcf_line=None

	while vcf_line==None or vcf_line[0]=="#" or vcf_line.strip()=="":
		vcf_line=vcf_fo.readline()
		#print(vcf_line)
		if len(vcf_line)==0:
			return None

	parts=vcf_line.split("\t")
	ref=parts[0]
	pos=int(parts[1])
	rm=counters_re.match(parts[7])
	counters=(rm.group(1),rm.group(2),rm.group(3),rm.group(4))
	return [ref,pos,counters]

def next_pileup_rec(pileup_fo):
	pileup_line=None
{'fraction_non_alphanumeric': 0.19693450998606596, 'fraction_numerical': 0.04551788202508128, 'mean_word_length': 5.3916913946587535, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3792564', 'n_tokens_mistral': 1060, 'n_tokens_neox': 1003, 'n_words': 126}