<commit_before># BLAT tools
# based on Sri's code

import subprocess
import os

hg_idx = '~/genome/hg19.2bit'

def start_gfServer(file2idx,tileSize=7,stepSize=2,minMatch=1,maxGap=4):
    params = (tileSize,stepSize,minMatch,maxGap,file2idx)
    cmd = "gfServer -tileSize=%i -stepSize=%i -minMatch=%i -maxGap=%i start localhost 17779 %s" % params
    p = subprocess.Popen(cmd,shell=True)
    return p

def stop_gfServer(p):
    cmd = "gfServer stop localhost 17779"
    q = subprocess.Popen(cmd,shell=True)
    return q

def poll_sequence(seq,file2idx,minScore=10,minIdentity=70):
    nibdir = os.path.dirname(file2idx)
    params = (minScore,minIdentity,nibdir)
    cmd = "gfClient -minScore=%i -minIdentity=%i -nohead localhost 17779 %s /dev/stdin /dev/stdout" % params
    p = subprocess.Popen(cmd,shell=True,stdin=subprocess.PIPE,stdout=subprocess.PIPE)
    p.stdin.write(">query\n%s\n" % seq)
    p.stdin.close()
    
    num = 0
    for line in p.stdout:
        if line == "Output is in /dev/stdout":
            continue
        num += 1
    
    return num
<commit_msg>final bug<commit_after># BLAT tools
# based on Sri's code

import subprocess
import os

hg_idx = '~/genome/hg19.2bit'

def start_gfServer(file2idx,tileSize=7,stepSize=2,minMatch=1,maxGap=4):
    params = (tileSize,stepSize,minMatch,maxGap,file2idx)
    cmd = "gfServer -tileSize=%i -stepSize=%i -minMatch=%i -maxGap=%i start localhost 17779 %s" % params
    p = subprocess.Popen(cmd,shell=True)
    return p

def stop_gfServer(p):
    cmd = "gfServer stop localhost 17779"
    q = subprocess.Popen(cmd,shell=True)
    return q

def poll_sequence(seq,file2idx,minScore=10,minIdentity=70):
    nibdir = os.path.dirname(file2idx)
    params = (minScore,minIdentity,nibdir)
    cmd = "gfClient -minScore=%i -minIdentity=%i -nohead localhost 17779 %s /dev/stdin /dev/stdout" % params
    p = subprocess.Popen(cmd,shell=True,stdin=subprocess.PIPE,stdout=subprocess.PIPE)
    p.stdin.write(">query\n%s\n" % seq)
    p.stdin.close()
    
    num = 0
    for line in p.stdout:
        if line == "Output is in /dev/stdout\n":
            continue
        num += 1
    
    return num

{'fraction_non_alphanumeric': 0.12964684014869887, 'fraction_numerical': 0.02973977695167286, 'mean_word_length': 3.5326315789473686, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, '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': '3880007', 'n_tokens_mistral': 850, 'n_tokens_neox': 795, 'n_words': 165}